Question
EEPROM Emulation works, but to program again I have to erase the entire flash.
- September 24, 2024
- 2 replies
- 1784 views
Hi,
I am using the STM32WB15CC chip in a stm32WB1mmc module on a custom pcb. I need to write to a non volatile uint8_t variable 70,000 times over the lifetime of the device.
I have been using following guide ( https://community.st.com/t5/stm32-mcus/porting-and-using-x-cube-eeprom-with-any-stm32/ta-p/570539 )to implement emulated eeprom. When debugging, my code steps through fine and works great. When I try to restart the debugging session or program a different basic sketch I get an error. To fix this I use the STM32CubeProgrammer to erase the entire flash and then the board can program again.
I have attached a screenshot of the error message.
Here is my eeprom_emul_conf.h variables
/* Configuration of eeprom emulation in flash, can be custom */
#define START_PAGE_ADDRESS 0x08017800U/*!< Start address of the 1st page in flash, for EEPROM emulation */
#define CYCLES_NUMBER 7U /*!< Number of 10Kcycles requested, minimum 1 for 10Kcycles (default),
for instance 10 to reach 100Kcycles. This factor will increase
pages number */
#define GUARD_PAGES_NUMBER 0U /*!< Number of guard pages avoiding frequent transfers (must be multiple of 2): 0,2,4.. */
/* Configuration of crc calculation for eeprom emulation in flash */
#define CRC_POLYNOMIAL_LENGTH LL_CRC_POLYLENGTH_16B /* CRC polynomial lenght 16 bits */
#define CRC_POLYNOMIAL_VALUE 0x8005U /* Polynomial to use for CRC calculation */
