正在做norflash启动,但是代码烧写进 norflash后不能运行,于是用仿真器仿真程序做如下测试:
1、将norFlash代码拷贝到ram内运行,正常运行(LED灯闪烁)
uint32 pos;
//----- 将代码拷贝到ram
for(pos = 0; pos < 4*1024; pos++)
{
*(uint8*)(0x402F0400+pos) = *(uint8 *)(0x13F80000+pos);
}
void (*appEntryNOR)();
appEntryNOR = (void (*)(void)) 0x402F0400;
//----- 运行代码
(*appEntryNOR)();
while(1);
2、直接跳转到norFlash运行,运行失败。
void (*appEntryNOR)(); appEntryNOR = (void (*)(void)) 0x13F80000; (*appEntryNOR)(); while(1);
因为自己做的bootloader norflash启动失败,所以做如上测试,想问下,1、2有何区别?谢谢。