how to erase a single page of flash memory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-24 7: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.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-25 5: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-24 7: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
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-25 5: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
