STM32MP1: Persist data in flash memory from Cortex M4 core
Hello,
I want to persist data in flash memory from the Cortex M4 program.
I created a section in the linker file:
.mySection 0x000000001002f000 :
{
KEEP(*(.mySection))
} >RAM1_dataSo i know where my data is in the RAM memory but i don't know how to write this data in flash memory so it can be persisted.
I saw a lot of examples for other STM products that use function similar to this:
void Write_Flash(uint8_t data)
{
HAL_FLASH_Unlock();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGSERR );
FLASH_Erase_Sector(FLASH_SECTOR_6, VOLTAGE_RANGE_3);
HAL_FLASH_Program(TYPEPROGRAM_WORD, FlashAddress, data);
HAL_FLASH_Lock();
}But i can't find the HAL library containing HAL_FLASH_XXXX function for the STM32mp1 series... Does this library exists?
How can i save the data in the flash memory or somewhere that is persisted after a hardware reboot?
Do i need to transfert data from M4 Core to A7 Core or does another solution exists for the STM32mp1 series? (i prefer to avoid to transfert data between the 2 core)
Best regards,
Ludovic Feltz.
