3
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

5
\$\begingroup\$

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))

to:

#define PAGE1_BASE_ADDRESS    ((uint32_t)(EEPROM_START_ADDRESS + PAGE_SIZE))
\$\endgroup\$
2
  • \$\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, 2019 at 12:27
  • 1
    \$\begingroup\$ Maybe someone should tell them ;) \$\endgroup\$
    – Rev
    Aug 20, 2019 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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