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.
3 years, 10 months ago.
Page level flash erase on STM32F411RE
I would like to port my flash wear levelling library to the STM32F411RE target using the mbed OS.
I need read/write and page erase operations. I was thinking about using
FLASH_Erase_Sector() from hal/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.h for erasing. The only caveat is the required flash space:
- the erase function takes a sector to be erased as parameter
- the sector size is 64KB I think.
- I need at least 2 pages for each wear levelled group (one page keeps a copy of important data while the second page is being erased)
This leads to use 128KB for each wear levelled group and it will not fit into the global 512KB of flash of the target device. Is there a way to erase smaller pages only (eg. erase 512B at a time) ?