STM32F103, erase a function that define in spesial section
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-28 2:13 AM
Posted on May 28, 2015 at 11:13
hi
in my software, define a section named ''My_SECTION'' and put just a function on it. in IAR .icf file define that section write in address 0x08050000. I used debugger, function is correctly wrote in 0x08050000 and has 16 byte length. All other functions are wrote from address 0x08003000. when MCU power on , In main() function, I want to erase function that wrote in address 0x08050000. when erase page at address 0x08050000, page doesn't erase, but if erase just page after or before that, it is erase correctly . I think pages that programed, is locked. Is it possible to erase a page that some of execution code write on it? #flash #stm32f103 #erase
Labels:
- Labels:
-
Flash
-
STM32F1 Series
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-28 7:04 AM
Posted on May 28, 2015 at 16:04
Should erase the same way any other sector.
You'd want to double check if you have write protected any of the sectors, and that you are correctly unlocking, and clearing pending status.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-29 8:51 PM
Posted on May 30, 2015 at 05:51
my erase function:
FLASH_Unlock(); delay_us(100); FLASHStatus = FLASH_ErasePage(PgAdd); ----- this code execute from flash memory and correctly erase pages 0x08050800 and 0x0804f800;Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-30 2:39 AM
Posted on May 30, 2015 at 11:39
OK, thanks clive1.
when i use this code: FlashRead((uint32_t)(0x08050000),SecSize,Buffer_In); FLASH_Unlock(); FLASH_ErasePage(0x50000); FlashRead((uint32_t)(0x08050000),SecSize,Buffer_Out); //----------------- Buffer_Out equal Buffer_In, page does not erase. but when use below code pageerase correctly
: FlashRead((uint32_t)(0x08050000),SecSize,Buffer_In); FLASH_Unlock(); FLASH_ErasePage(0x50000);FLASH_Lock(); // difference
with above code.
FlashRead((uint32_t)(0x08050000),SecSize,Buffer_Out); //------------