cancel
Showing results for 
Search instead for 
Did you mean: 

Linking issues when using @eeprom with Cosmic toolset

RallyTronics
Associate II
Posted on August 23, 2013 at 05:18

My application builds fine until I add the @eeprom keyword to a declaration.  Now I get the following linker errors:

#error clnk Debug\nos.lkf:1 symbol _FLASH_CR2 not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\lib\libm0.sm8)eeprom.o )

#error clnk Debug\nos.lkf:1 symbol _FLASH_NCR2 not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\lib\libm0.sm8)eeprom.o )

#error clnk Debug\nos.lkf:1 symbol _FLASH_IAPSR not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\lib\libm0.sm8)eeprom.o )

Any thoughts on this one?  Cosmic has been less than responsive.

3 REPLIES 3
jdf25252
Associate II
Posted on August 23, 2013 at 16:51

''Less than responsive'' is being kind though all things considered I like the Cosmic compiler best of all the compilers I use.

Anyway, I bet you're using the ST include files ''stm8s.h''.  They define the IO as structures.  Cosmic also provides an IO file ''iostm8.h'' which, of course, does it differently with different names.  Look in ''C:\Program Files\COSMIC\CXSTM8\Hstm8'' for the include file for your cpu & you'll find a line like

volatile char FLASH_CR2     @0x505b;    /* Flash Control Register 2 */

volatile char FLASH_NCR2    @0x505c;    /* Flash Complementary Control Reg 2 */

volatile char FLASH_IAPSR   @0x505f;    /* Flash in-appl Prog. Status reg */

copy & paste them into one of your files.  I think that's all you'll need.

jdf

RallyTronics
Associate II
Posted on August 24, 2013 at 05:13

Thanks John,

I was just getting around to defining my own when your response came in.  I will give it a go.

John

luca239955_stm1_st
Senior II
Posted on August 26, 2013 at 10:40

Hello,

this issue is explained page 52 of the user manual.

Regards.