Programming a Data in to Flash memory STM32G series
Hello Every one I am using NUCLEO-G0B1RE board when trying to store the data in to flash memory address its not updating after erasing but individually if I try only erase or only write data in to flash memory it is working
please suggest me below is my code
at run time i would like to erase and update the data suggest me if went wrong in the code
uint32_t BaseAddr = 0x08041000; //global variable.
uint64_t FlashData = 0xee;////global variable.
inside main function
HAL_FLASH_Unlock();
FLASH_PageErase(2,258);
HAL_FLASH_Lock();
HAL_Delay(100);
HAL_FLASH_Unlock();
HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, BaseAddr, FlashData);
HAL_FLASH_Lock();
