存储器实验

进行此实验时出错了,不明白什么原因:

 

/*********************************************************************************************
* 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.......):

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值