How to write data into board flash memory?
As I am trying to write the data into board flash memory, Is ther any example code to write the 64bytes of data into board flash memory.
I have tried the below shared code but its not showing the result I want.
flashAddress = 0x08040000
void Write_Flash(uint32_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();
}
Can you please help me on this.
