AnsweredAssumed Answered

stm8l052 COSMIC Compiler EEPROM _FLASH_NCR2 not defined

Question asked by mitterer.andreas on Aug 17, 2015
Latest reply on Aug 20, 2015 by mitterer.andreas
Hallo,

I moved my project from IAR to COSMIC and STVD and now with the COSMIC Compiler I always get the error message "#error clnk Debug\densitometer_st.lkf:1 symbol _FLASH_NCR2 not defined ((C:\Program Files (x86)\COSMIC\32K_Compilers\CXSTM8\Lib\libm0.sm8)eepwrl.o (C:\Program Files (x86)\COSMIC\32K_Compilers\CXSTM8\Lib\libm0.sm8)eeprom.o )
 The command: "clnk -l"C:\Program Files (x86)\COSMIC\32K_Compilers\CXSTM8\Lib"  -o Debug\densitometer_st.sm8 -mDebug\densitometer_st.map Debug\densitometer_st.lkf " has failed, the returned value is: 1
exit code=1.".

I searched on this topic and i found, that somehow it is necessary to manually implement this defines:
volatile char FLASH_CR1     @0x5050;     /* Flash Control Register 1 */
volatile char FLASH_CR2     @0x5051;     /* Flash Control Register 2 */
//volatile char FLASH_NCR2    @0x5051;     /* Flash Complementary Control Reg 2 */
volatile char FLASH_PUKR    @0x5052;     /* Flash Program memory unprotection reg */
volatile char FLASH_DUKR    @0x5053;     /* Data EEPROM unprotection reg */
volatile char FLASH_IAPSR   @0x5054;     /* Flash in-appl Prog. Status reg */

And there it starts to get strange, because my stm8l052c6 does not have a NCR2 register.

So I guess, that i need to set a correct define and the compiler takes all the necessary defines from a file.

I also checked the MCU Selection in STVD. There is the correct one selected.

As you can see, i also tried to define the NCR2 but if i do so, the write command kills the running program.

So please can someone help me with this problem. 
Thanks
Andi

Outcomes