I am trying to implement EEPROM Emulation on an STM32F07x using the driver supplied by ST. Problem is on attempting to initialise the emulated flash, the driver fails and always returns NO_VALID_PAGE. I have changed the defines for the Page Size and the EEPROM start address to match the Reference Manual but it doesn't work.


There is a subtle bug in the eeprom.h file. The calculation of the PAGE1_BASE_ADDRESS is based on 1Kb value page rather than using the define which is supposed to accommodate different page sizes in the MCU's.

Change the define

#define PAGE1_BASE_ADDRESS    ((uint32_t)(EEPROM_START_ADDRESS + 0x0400))


  • \$\begingroup\$ 3 years later and this error is still present in STM32Cube F4 library version 1.24, release date 08-February-2019 :/ \$\endgroup\$ – Galaxy Aug 20 at 12:27
  • \$\begingroup\$ Maybe someone should tell them ;) \$\endgroup\$ – Rev1.0 Aug 20 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.