2009-11-23 07:11 PM
Mass Erase and protected pages
2011-05-17 04:31 AM
Does a ''Mass Erase'' operation erase protected flash pages ?
From PM0042 - ''The Mass Erase command can be used to completely erase the user pages of Flash memory. The information block is unaffected by the procedure. The following sequence is recommended:'' etc,etc Since the information block is unaffected, and since the option bytes which protect flash pages are contained inside the information block, it seems as if a Mass Erase operation would not erase protected pages. For my bootloader, I could alway erase and program flash page by page. But a mass erase of the app code area first, while protecting the bootloader, would be more efficient.2011-05-17 04:31 AM
Hi,
I thnik the answer is available in the same document you are refering to ;) . ''The option bytes are always read-accessible and write-protected by default'' ''If a program or an erase operation is performed on a protected page, the Flash memory returns a protection error flag on the Flash memory Status Register (FLASH_SR).'' Cheers.2011-05-17 04:31 AM
So, does this mean that it will erase all pages except for the protected pages, then give me error when it attempts to erase a protected one ?
Or Will it just give me an error from the start and not erase any pages ?2011-05-17 04:31 AM
ST rep has responded to a seperate email on this subject. A mass erase will erase all flash pages except for ''protected'' pages.
This should save a little time when updating the app code with a bootloader. If anyone's experience is different, please respond. Thanks2011-05-17 04:31 AM
Yes it means: ''it will erase all pages except for the protected pages, then give me error when it attempts to erase a protected one ''