cancel
Showing results for 
Search instead for 
Did you mean: 

Enable the read protection level 2 in the stm32f4x chip from raspberry pi.

KChud.1
Associate II

Hi, 

I make the programming my stm32f4x chip using raspberry pi through OpenOcd. 

It's working and upload the code inboard but I am stuck in read protection level 2.

If we can not enable/active this through openocd then other option is also okay for me.

I just need to active level 2 protection through raspberry pi.

6 REPLIES 6

Hard time deciphering this..

If device is in Level 2 you aren't going to be able to access/modify it.

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

yes ,

i want to this option for code protection. can you please tell me any method to i active the level 2 protection through raspberry pi.

TDK
Guru

You cannot disable level 2 protection, ever. You need a new chip. From the RM:

Memory read protection Level 2 is an irreversible operation. When Level 2 is activated,

the level of protection cannot be decreased to Level 0 or Level 1.

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

No,

i don`t want to disable the level 2.

but i want to enable the level 2 protection.

I want to active this level 2 protection through raspberry pi.

Is it any option like openocd or any other way then i activated this from RPI.

TDK
Guru

Ahh.

This turned up with a Google search:

https://stackoverflow.com/questions/48927028/openocd-how-to-write-option-bytes-to-stm32f4

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

HI,

As per the link i run this query for activate the level 2 protection.

openocd -f interface/stlink-v2-1.cfg -f target/stm32f4x.cfg -c"init" -c "reset halt" -c "mww 0x40023c14 0XCC"  -c"exit"

but still not it entered in level 2. Please correct the query if it wrong.