cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing EEPROM with Cosmic compiler

jark
Associate II
Posted on July 26, 2010 at 20:46

Accessing EEPROM with Cosmic compiler

10 REPLIES 10
jark
Associate II
Posted on May 17, 2011 at 15:09

Hi,

    The problem was that I was not 'unlocking' the EEPROM before writing to it.  I needed to #include the stm8s_flash.h file at the beginning and then the code to write to the eeprom looked like:

    .......

    FLASH_Unlock(FLASH_MEMTYPE_DATA);

    Cstd = Cstd *factor;

    FLASH_Lock(FLASH_MEMTYPE_DATA);

    ..........

where Cstd is the variable in eeprom.