2023-08-24 07:09 AM
hello guys i need help with stm32f103 and stmcube ide
i want to erase a pege of flash memory during runtime of programme ,in my case i want to erase page no 63 i have found this following code in hal_flash_ex.c but i dont know how to use it or modify it to get result
HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError)
or may be i am trying a wrong hal function please help me
this function HAL_FLASH_ErasePage() is not available in my hal driver hal_flash.c or hal_flash_ex.c
thanks
Solved! Go to Solution.
2023-08-25 05:58 AM
this is solution and i found it at chatgpt
HAL_FLASH_Unlock();
// 0x08000000 + (63 * 1024) = 0x0800FC00 //start byte address of page 63
FLASH_PageErase(0x0800FC00);
HAL_FLASH_Lock();
case closed thanks to all
2023-08-24 07:56 PM
Try some of the examples. https://github.com/STMicroelectronics/STM32CubeF1/blob/master/Projects/STM32F103RB-Nucleo/Examples/FLASH/FLASH_EraseProgram/Src/main.c#L83
2023-08-25 05:58 AM
this is solution and i found it at chatgpt
HAL_FLASH_Unlock();
// 0x08000000 + (63 * 1024) = 0x0800FC00 //start byte address of page 63
FLASH_PageErase(0x0800FC00);
HAL_FLASH_Lock();
case closed thanks to all