Modifying single byte or word and also large struct into flash
Hi,
I would like to change at runtime some user-defined variables stored in Flash (so they remain on the system after power off). I have defined them as const and some are just 16 bits vars and others are more complex large structures. What is the best way to do that?
I came across the Flash Sector erase function but don't want to risk using a whole block erase (i.e. reading block, changing specific byte, word or struct then write back the entire sector with new values). Are there other options?
Also which include files do I need? Still getting familiar with the documentation, I came across three possible header files to include but not sure which to include in my code of these:
#include <stm32l4xx_hal_flash.h>
#include <stm32l4xx_hal_flash_ex.h>
#include <stm32l4xx_hal_flash_ramfunc.h>
could someone please clarify that too.
Thank you :smiling_face_with_smiling_eyes:
