Skip to main content
laurentwawrzyniak9
Associate II
March 12, 2015
Question

STM32F3: Back to Read Protect level 0

  • March 12, 2015
  • 3 replies
  • 816 views
Posted on March 12, 2015 at 14:27

eg:

The 10 first pages of Flash are write protected.

The read protect level 1 is activated.

What's happen when going back to level 0 ?

According Reference manual, a mass erase is done but what's happen to the write protected pages. I expect that they are not erased. Is is the case ?

#flash
This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
March 12, 2015
Posted on March 12, 2015 at 18:08

I expect that they are not erased. Is is the case ?

Surely it wouldn't be that hard to test your hypothesis, then you'd know.

I foresee two outcomes

a) The part is completely erased.

b) The mass erase throws an error, nothing is erased and the part is still locked.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
jpeacock
Associate
March 12, 2015
Posted on March 12, 2015 at 18:31

Downgrading read protection for flash must trigger a mass erase or there's no protection against code readout and no purpose in read protection level 1.  If write protection was a higher level than read protection then it's a simple matter to take a competitor's device set at read 1, force write protect on all blocks with the JTAG, and then force read 0 via JTAG to recover the flash intact.

  Jack Peacock

laurentwawrzyniak9
Associate II
March 13, 2015
Posted on March 13, 2015 at 13:07

I did a test and conclusion is  that going back to Read Protection Level 0 erases all pages even those set as write protected.

I also noticed that if you have previously activated the  write protection on some pages then when activating the read protection level 1, the write protection is removed ! (not documented in reference manual)