2025-08-30 9:49 PM - edited 2025-08-31 9:46 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.
2025-09-25 3:40 AM
Hello @sandeep_kumar_v
I suggest you follow the example on the X-CUBE-EEPROM | Product - STMicroelectronics made for the STM32WL. It should show you the correct way to implement the EEPROM on the STM32WL.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.