Flash memory erase
I am using STM32L476RGT6. I am trying to read and write operation in the embedded flash memory. I am unable to erase the stored data in the embedded flash memory.
I am following method to erase :
FLASH_EraseInitTypeDef EraseInitStruct;
HAL_FLASH_Unlock();
EraseInitStruct.TypeErase= FLASH_TYPEERASE_PAGES;
EraseInitStruct. Page = 0x0807F800;
EraseInitStruct. NbPages=1;
EraseInitStruct. Banks= 1;//
uint32_t PAGE Error;
if (HAL_FLASHEx_Erase(&EraseInitStruct, &PAGEError) != HAL_OK) {
}
HAL_FLASH_Lock();
