进行此实验时出错了,不明白什么原因:
/*********************************************************************************************
* File: main.c
* Author: embest
* Desc: c main entry
* History:
*********************************************************************************************/
/*------------------------------------------------------------------------------------------*/
/* includes files */
/*------------------------------------------------------------------------------------------*/
#include "2410lib.h"
/*********************************************************************************************
* name: main
* func: c code entry
* para: none
* ret: none
* modify:
* comment:
*********************************************************************************************/
void Main(int argc,char **argv)
{
sys_init(); /* Initial s3c2410's Clock, MMU, Interrupt,Port and UART */
memory_test();
}
/*********************************************************************************************
* File: memory.c
* Author: embest
* Desc: memory test file
* History:
*********************************************************************************************/
/*------------------------------------------------------------------------------------------*/
/* include files */
/*------------------------------------------------------------------------------------------*/
#include "2410lib.h"
/*********************************************************************************************
* name: memory_test
* func: memory test
* para: none
* ret: none
* modify:
* comment:
*********************************************************************************************/
void memory_test(void)
{
int i;
UINT32T data;
int memError=0;
UINT32T *pt;
//
// memory test
//
uart_printf("/nMemory Test(%xh-%xh):WR/n",_RAM_STARTADDRESS+0x10000,(_ISR_STARTADDRESS&0xf0ff0000));
//memory write
pt=(UINT32T *)(_RAM_STARTADDRESS+0x10000);
while((UINT32T)pt<(_ISR_STARTADDRESS&0xf0ff0000))
{
*pt=(UINT32T)pt;
pt++;
}
//MEMORY READ
uart_printf("Memory Test(%xh-%xh):RD/n",_RAM_STARTADDRESS+0x10000,(_ISR_STARTADDRESS&0x0f0ff0000));
//uart_printf("/b/bRD");
pt=(UINT32T *)(_RAM_STARTADDRESS+0x10000);
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");
}
===============================================
===============================================
实验测试结果:
boot success
Embest EduKit Arm Platform Memory Access Test Example
Enter a start address of ram to test(0x3.......):0x30100000
Enter a end address of ram to test(0x3.......):0x30200000
Memory Test(0x30100000-0x30200000):RDMemTest FAIL:0x30001314=0x4fc01
end.
Memory Access Test Example
Enter a start address of ram to test(0x3.......):
boot success
Embest EduKit Arm Platform Memory Access Test Example
Enter a start address of ram to test(0x3.......):0x30100000
Enter a end address of ram to test(0x3.......):0x30100010
Memory Test(0x30100000-0x30100010):RDMemTest FAIL:0x30001314=0xea000056
end.
Memory Access Test Example
Enter a start address of ram to test(0x3.......):o
boot success
Embest EduKit Arm Platform Memory Access Test Example
Enter a start address of ram to test(0x3.......):0x30200004
Enter a end address of ram to test(0x3.......):0x30200010
Memory Test(0x30200004-0x30200010):RDMemTest FAIL:0x30001314=0xea00005d
end.
Memory Access Test Example
Enter a start address of ram to test(0x3.......):