云途HA 调用 __main 来代替 RamInit1
-
由于客户部分应用层采用C++方式开发,但在启动代码,并没有调用全局默认构造函数。 是否可以直接调用KEIL中的__main来构造bss data 以及全局构造函数?也就是要去掉RamInit1 增加__main
-
还要加上这个代码(GCC 和 IAR, keil自行搜索解决):
void CallConstructors(void) { #if defined(__GNUC__) // Get the address of the first entry in .myinit section extern func_ptr __init_array_start[]; // Get the address of the last entry in .myinit section extern func_ptr __init_array_end[]; func_ptr *ptr = __init_array_start; // Call each constructor function while(ptr < __init_array_end) { (*ptr)(); ptr++; } #else __iar_data_init3(); #endif }
-
重写LINK文件后,问题已解决,还是使用的__main
8/11
发帖前请查看
帮助没办法联网的电脑使用YCT
帮助改进和优化YT CONFIG TOOL,有机会抽取YTM32B1ME0 EVB哦...