memtest.c
资源名称:src.rar [点击查看]
上传用户:jankzhpno
上传日期:2022-08-03
资源大小:4763k
文件大小:1k
源码类别:
Windows CE
开发平台:
Visual C++
- /*********************************************
- NAME: memtest.c
- DESC: test SDRAM of SMDK2440 b/d
- HISTORY:
- 03.27.2002:purnnamu: first release
- *********************************************/
- #include "def.h"
- #include "option.h"
- #include "2440addr.h"
- #include "2440lib.h"
- #include "2440slib.h"
- #include "mmu.h"
- void MemoryTest(void)
- {
- int i;
- U32 data;
- int memError=0;
- U32 *pt;
- //
- // memory test
- //
- //Uart_Printf("Memory Test(%xh-%xh):WR",_RAM_STARTADDRESS,(_ISR_STARTADDRESS&0xfff0000));
- //test sdram from _RAM_STARTADDRESS+2M, hzh
- Uart_Printf("Memory Test(%xh-%xh):WR",_RAM_STARTADDRESS+0x00200000,(_ISR_STARTADDRESS&0xffff0000));
- //pt=(U32 *)_RAM_STARTADDRESS;
- pt=(U32 *)(_RAM_STARTADDRESS+0x00200000); //hzh
- while((U32)pt<(_ISR_STARTADDRESS&0xffff0000))
- {
- *pt=(U32)pt;
- pt++;
- }
- Uart_Printf("bbRD");
- //pt=(U32 *)_RAM_STARTADDRESS;
- pt=(U32 *)(_RAM_STARTADDRESS+0x00200000); //hzh
- while((U32)pt<(_ISR_STARTADDRESS&0xffff0000))
- {
- data=*pt;
- if(data!=(U32)pt)
- {
- memError=1;
- Uart_Printf("bbFAIL:0x%x=0x%xn",i,data);
- break;
- }
- pt++;
- }
- if(memError==0)Uart_Printf("bbO.K.n");
- }