cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to set write protect on flash memory for ever?

MProgrammer
Associate II

Hi,

I want to block flash memory for writng after programming it. It is important that write protect should not be possible to deassert.

I have read about RDP mechanism, but there is information that on level 2 write protection is permament, but only in case of programming flash from JTAG. I need to know how to block flash for programming from booth JTAG and internal program write access.

6 REPLIES 6

Don't have any of the flash write/unlock code in your app?

Often bits in Option Bytes, but don't recall an otp/fuse type method

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

Please include your chip number. Write protect options are chip specific, and there are thousands of STM32 chips, but typically they exist.

If you feel a post has answered your question, please click "Accept as Solution".
MProgrammer
Associate II

Thank you for answer. The chip number is STM32L562​

If you have a trusted "bootloader", it can disable access to the flash controller for the "application".

This protection will be effective until next reset, then the bootloader will get control and repeat.

MProgrammer
Associate II

I found that sentence in RM:

"WRP areas can be modified through option byte changes while RDP level is less than 2."

Does it mean that WriteProtect is permament if I lock WriteProtect in OptionBytes and then I set RDP level 2?

Yes, setting RDP level 2 locks the option bytes.
If you feel a post has answered your question, please click "Accept as Solution".