|
发表于 2019-8-6 17:53:46
|
显示全部楼层
看看终止代码。
启动代码大家都知道,程序引导到 main() ,但跳出 main() 之后就很少有人关注了,终止代码方式不一样。
有的在最后安排一条复位指令,有的安排一条停机指令,有个输出终止运行的状态信息,有的啥也不做根本就没有这部分。
我这个启动代码在执行完 main() 之后是停在这的。
void __thumb_startup(void)
{
// Setup registers
__init_registers();
// setup hardware
__init_hardware();
// zero-fill the .bss section
zero_fill_bss();
// initialize the floating-point library
#ifdef __VFPV4__
__fp_init();
#endif
// call C++ static initializers
__call_static_initializers();
// initializations before main, user specific
__init_user();
// call main(argc, &argv)
exit(main(0, argv));
// should never get here
while (1);
}
另一个BOOTLOADER 的在做完IAP之后是重启或者重映射加载到APP里去。
所以具体还是要看启动代码(或者终止代码)。 |
|