cancel
Showing results for 
Search instead for 
Did you mean: 

Mass Erase and protected pages

gahelton12
Associate II
Posted on November 24, 2009 at 04:11

Mass Erase and protected pages

5 REPLIES 5
gahelton12
Associate II
Posted on May 17, 2011 at 13:31

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.

armmcu
Associate II
Posted on May 17, 2011 at 13:31

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.

gahelton12
Associate II
Posted on May 17, 2011 at 13:31

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 ?

gahelton12
Associate II
Posted on May 17, 2011 at 13:31

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.

Thanks

armmcu
Associate II
Posted on May 17, 2011 at 13:31

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 ''