Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 4 months ago.
EEPROM Emulation on STM32F0 device
Hi,
I am using NUCLEO-F072 board, with STM32F072RB microcontroller. I am trying to emulate EEPROM in flash of the mcu. I am following the reference code for HAL flash driver. I am having a problem with read/write in the flash region. On erasing and writing in Flash, I am getting status as HAL_OK. But on reading the same location I am getting read value as 0xFFFF. I am sharing the code files. Someone, please help me to solve the problem.
/media/uploads/Akshat123/main.cpp /media/uploads/Akshat123/eeprom.h /media/uploads/Akshat123/eeprom.cpp
Thank you.
1 Answer
7 years, 4 months ago.
Hi,
I think that you are making a mistake when calling read.
Your code is
readValue = readEEPROMHalfWord(DEVICE_STATUS);
So... you are reading the address 0x0000 when you really wish to read the address of variable "i". Please try:
Modifiy
readValue = readEEPROMHalfWord(i);
Best regards