BG4RFF 发表于 2017-3-22 21:06:51

求助STM8S903K3定义@eeprom不能编译通过

STM8S903K3定义了@eeprom unsigned char memorySecurity[] = { 0b00000111, 0xff, 0xff, 0xff };

然后编译通不过
#error clnk Debug\cardtest.lkf:1 symbol _FLASH_CR2 not defined ((C:\Program Files\COSMIC\FSE_Compilers\CXSTM8\Lib\libm0.sm8)eeprom.o )
#error clnk Debug\cardtest.lkf:1 symbol _FLASH_NCR2 not defined ((C:\Program Files\COSMIC\FSE_Compilers\CXSTM8\Lib\libm0.sm8)eeprom.o )
#error clnk Debug\cardtest.lkf:1 symbol _FLASH_IAPSR not defined ((C:\Program Files\COSMIC\FSE_Compilers\CXSTM8\Lib\libm0.sm8)eeprom.o )

是需要加什么头文件吗?
使用库开发模式,已经添加使用了FLASH
请高手指点
另外STM8S903K3怎么解除保护,用STlinkV2不能怎么擦除?

BG4RFF 发表于 2017-3-22 21:12:33

Hardware configuration set to <ST-LINK on USB with STM8S903K3 plugged in and SWIM protocol>.
Blank check before programming (when available) is OFF
Verify after programming is ON.
Clear memory before loading a file is ON.
Erase device memory before programming (when available) is OFF
Display a popup window when an error occurs is ON.
Log activity is OFF
> ProgrammingPROGRAM MEMORY area...
Cut Version and Revision of device: 1.2
Error : The device is protected
Operation aborted
Error : < PROGRAM MEMORY programming failed.
Error : < Operation aborted.

无薪税绵 发表于 2017-4-7 08:13:28

1、FLASH_CR2、FLASH_NCR2、FLASH_IAPSR,这三个未定义,请自行添加。
2、用ST-LINK Utility工具可以檫除。

ts2000 发表于 2017-4-7 08:55:03

很明显库文件没加上吧

toofree 发表于 2017-4-7 11:21:23

没用过STM8。
但是一般,添加了.c文件后,在编译路径上也要把对应.h的路径添加上。找个样例程序看看,缺的宏定义在什么地方。如果找不到定义的地方,一般都是在编译环境设置中添加的。
在Keil下用STM32的时候,flash读保护后,无法再次直接擦除、编程。最后用了个在sram了运行的程序,程序中添加flash解除读保护,全速跑程序后,以后就可以擦写了。或者在串口ISP下载的时候,会提示去除读保护。不知道STM8有没有类似的。

五哥1 发表于 2017-4-7 12:20:04


没用过STM8。

NNXia 发表于 2017-4-7 17:23:36

额。。。。路过。。。。

BG4RFF 发表于 2017-4-7 21:48:35

谢谢各位回复
第一个是重新安装后再来就OK
第二个是在STVD的烧写里面选上擦除

中山无雪 发表于 2017-4-7 23:00:27

1 symbol _FLASH_CR2 not defined

提示很明显了吗
页: [1]
查看完整版本: 求助STM8S903K3定义@eeprom不能编译通过