2025-08-30 9:49 PM
Hi,
I’m working on STM32WLE5 module for storing values in EEPROM. I want to use the last page of flash for storing configuration values of lora.
I have used EE library from GITHUB which uses HAL functions.
I followed 2 sequences for writing into flash:
if I erase the page 1st and write to it, then there is no use of storing in it. So, If I read the flash, I’m not able to write to it.
I have also moved all the functions used for writing into flash to RAM by adding __attribute__((section(“.RamFunc”))) in function definition so that there won’t be stalling of CPU. I have checked in disassembly while debugging that all the related code is running from RAM.
I get hardfault error while HAL_FLASH_Unlock() after erasing the page. Is there any other configuration I need to do for using flash as eeprom.
I want to do the procedure as follows:
Read EEPROM → Erase&update the new values in Flash.