AnsweredAssumed Answered

EEPROM invalid values

Question asked by biernacki.michal on Jun 24, 2015
Latest reply on Jun 26, 2015 by biernacki.michal
Hello, I'm pretty new in STM8 programming. I'm making small project on STM8S103F3P6 microcontroller and I need to save some (27 bytes) values in EEPROM memory and reload them at every power up. I saw an example from ST stdLib and tried to change it for my project. And here is my problem. When I try to save more than 1 byte with function FLASH_ProgramByte(), for exaple:
FLASH_ProgramByte(0x4000, 0x12);
FLASH_ProgramByte(0x4001, 0x34);
FLASH_ProgramByte(0x4002, 0x56);
when I view EEPROM content in debugging session, some variables are saved correctly, but some are 0. Also, when I try to reload these values on application start even if EEPROM byte at specific address is set, function FLASH_ReadByte(0x400x); often returns 0, only sometimes returns correct value. MCU is running at 16MHz from HSI. Do I make any mistake? Of course memory is unlocked.