cancel
Showing results for 
Search instead for 
Did you mean: 

Read Protection level 1

kRaje.1
Associate II

When I tried to enable read protection level 1 through STM32Cube Programmer(using ST link and J link), I was able to do so successfully. However, after enabling read protection, none of the peripherals worked properly—specifically, the push button and USART. I also tried this on STM32WL and STM32U0 boards. Could you please help me understand the reason for this issue and provide a proper solution?

5 REPLIES 5
######
Senior

I've not worked with those devices, however just thought I'd make a suggestion...

Are you accidentally trying to re-read the flash with the debug tool again? I believe in Level 1 doing this will cause a mass erase of the flash as per the documentation.

Hi, I even tried activating read protection level 1 with the firmware(using HAL ApI's). After activating read protection, I removed the debugger connection, but I'm still facing the same issue.

Hi,

I tried activating Read Protection Level 1 using  bare metal. After enabling read protection, I disconnected the debugger, but my controller keeps resetting due to the option bytes reset. I’ve included the code below. Could you please provide some suggestions?

Looks like your code resets unconditionally.

You should check for the RDP level and only modify option bytes if necessary.

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

Sorry if this doesn't help either...

Just noticed in your bare metal code that you read the option register, and then ensure that Boot0 is set with an OR, but you aren't actually modifying the Boot1 bit (either setting or clearing) - you are just preserving what it was in your original register. 

RDP Level 1 won't let you boot from SRAM or other modes, so maybe your Boot0/1 settings aren't quite right, and its booting from the wrong place and then stopping / resetting.

Best of luck with it.