* File: main.c
* Author: WuhanR&Dembest
* Desc: cmain entry
* History:
/* includes files*/
#include"2410lib.h"
/*********************************************************************************************
* name: main
* func: c code entry
* para: none
* ret: none
* modify:
* comment:
*********************************************************************************************/
void main(intargc,char **argv)
{
sys_init(); /* Initials3c2410's Clock, MMU, Interrupt,Port and UART */
memory_test();
while(1)
{
};
}
/****************************************************/
* File: memory.c
* Author: WuhanR&D Center, embest
* Desc: memorytest file
* History:
*****************************************************/
#include"def.h"
#include"option.h"
void memory_test(void)
{
int i;
UINT32T data;
int memError=0;
UINT32T *pt;
// memory test
uart_printf("\nMemoryTest(%xh-%xh):WR\n", _RAM_STARTADDRESS+0xe00000,
(_ISR_STARTADDRESS&0xf0ff0000));
//memory write
pt=(UINT32T*)(_RAM_STARTADDRESS+0xe00000);
while((UINT32T)pt<(_ISR_STARTADDRESS&0xf0ff0000))
{
*pt=(UINT32T)pt;
pt++;
}
//MEMORY READ
uart_printf("MemoryTest(%xh-%xh):RD\n", _RAM_STARTADDRESS+0xe00000,
(_ISR_STARTADDRESS&0x0f0ff0000));
//uart_printf("\b\bRD");
pt=(UINT32T*)(_RAM_STARTADDRESS+0xe00000);
while((UINT32T)pt<(_ISR_STARTADDRESS&0xf0ff0000))
{data=*pt;
if(data!=(UINT32T)pt)
{memError=1;
uart_printf("\b\bFAIL:0x%x=0x%x\n",i,data);
break;}
pt++;}
if(memError==0)
uart_printf("\n\b\bO.K.\n");}
尽量多的注释,非常急
青春有我