我正在为STM8 CPU (STM8S003K3)开发一个使用宇宙C编译器Ver 4.5.3的程序,我希望在批量生产期间使用ST-LINK/V2设备填充MCU EEPROM的默认值。
在手册中,我读到我必须使用#语用指令ena,我开发了一个简单的代码:
#pragma space extern [] @eeprom @near
static char pippo[] = { 1,2,3,4,5,6,7,8,9,10 };
#pragma space extern [] @near我编译并链接了购买代码,我注意到EEPROM部分的remanins是空的。我报告了几行.map文件
start 00008080 end 00008145 length 197 segment .const
start 00008145 end 00009722 length 5597 segment .text
start 00004000 end 00004000 length 0 segment .eeprom
start 00000000 end 00000000 length 0 segment .bsct你也有类似的问题吗?你是怎么修好的?非常感谢您的帮助和合作。
发布于 2022-06-30 09:18:41
我认为,通过编写@eeprom @near,您是在覆盖@eeprom,所以不要使用@near,您应该做得很好。如果您不想将大量声明放在eeprom中,您可以在每个声明的前面编写@eeprom,如下所示:
@eeprom static char pippo[] = { 1,2,3,4,5,6,7,8,9,10 };https://stackoverflow.com/questions/70845465
复制相似问题