莫名其妙的数据访问终止错误
我编的测试例程主文件如下:void * test_function[]=
{
(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);
i++;
if((int)(test_function) == 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)/8)) )
( (void (*)(void)) (test_function) )();
}
}
当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文件,发现是乱码,请问这是什么问题?
各位朋友帮帮忙吧,谢谢了。
页:
[1]