QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1460|回复: 0

莫名其妙的数据访问终止错误

[复制链接]
发表于 2005-8-5 15:41:58 | 显示全部楼层 |阅读模式
我编的测试例程主文件如下:

void * test_function[][2]=       
{
        (void *)Counter,        "Counter test     ",/* 计数器测试 */
        (void *)Test_Led,        "LED test          ",
        (void *)Test_KeyBoard,        "keyboard          ",
        (void *)Timer_Pwm,"Test PWM and pwm timer   ",
        (void *)Test_Rtc,        "RTC test    ",
        (void *)Test_Adc,        "ADC sampling test      ",
        (void *)Test_Printf,"Test Printf   ",
                0,        0
};


void Main(void)
{       
    U32 i;
   
    __rt_lib_init();

    rSYSCFG = SYSCFG_8KB;       

#if (PLLON == 1)       
    ChangePllValue(PLL_M,PLL_P,PLL_S);
   
#endif
  
    Port_Init();
   
    Isr_Init();
   
    Uart_Init(0,115200);
   
     Delay(0);  /* 校准延时时间 */
   
    while(1)
    {
       i = 0;
      
       Uart_Printf("\n\n\n       Welcome to SW44B0 test!             \n");
       Uart_Printf("            Now,let's start.                   \n\n");
       
      while(1)
      {   
          Uart_Printf("%2d:%s",i+1,test_function[1]);
          i++;
          if((int)(test_function[0]) == 0)
          {
                Uart_Printf("\n");
                break; /* 退出循环 */
           }
           if((i%4) == 0)
                Uart_Printf("\n");
      }
               
     Uart_Printf("\nPlease select which peripheral you want to test:");
               
     i = Uart_GetIntNum();
               
     i--;
               
    Uart_Printf("\n");
               
    if((i < (sizeof(test_function)/) )
             ( (void (*)(void)) (test_function[0]) )();
}
   
}

当i=2~7时,即选择运行Test_Led以后六个测试函数时,程序可以正常运行。可是,当i = 1,即选择运行Counter函数时,总是出现DataAbort

exception即数据访问中止异常。我觉得很纳闷,counter测试例程和其它功能测试函数几乎一样,怎么它就会出现数据访问终止呢?

  针对上述问题,我想进行单步调试,可是从CodeWarrior进入axd进行调试时,出现一个错误提示对话框如下:
  The session file 'c:Documetns and Settings\Administrator\default-1-2-0-0.ses'could not be loaded
  点确定后,打开axf文件,发现是乱码,请问这是什么问题?

各位朋友帮帮忙吧,谢谢了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-10 13:59 , Processed in 0.099354 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表