How to write on memory and keep it when my card is off power
Hi everyone !
I am new to the ST Community, so please forgive me in advance if my request lacks clarity or information. I am facing an issue: I want to store a data in my memory that will be updated approximately every second or a bit more, that will be determined later. To achieve this, I am using the following function:
void WriteDataToFlash(uint32_t data) {
HAL_FLASH_Unlock();
FLASH_Erase_Sector(FLASH_SECTOR_7, VOLTAGE_RANGE_3);
HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, FLASH_USER_START_ADDR, data);
HAL_FLASH_Lock();
}It works very well, my values change as I want them to. However, the problem I am encountering is that when I turn off my board and turn it back on, or even when I debug it, my memory seems to reset, even though I don't have a function that would cause my memory to reset. I believe there's something I'm missing, and since I'm new to working with memories, I'm having trouble identifying my mistake. Just to let you know, I am coding on an STM32F439VIT6 used on hardware other than Nucleo.
Thank you in advance to those who take the time to read.
