Question
EEPROM invalid values
Posted on June 24, 2015 at 09:04
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. #stm8s103-eeprom-flash