Skip to main content
kRaje.1
Associate III
March 6, 2025
Question

Read Protection level 1

  • March 6, 2025
  • 5 replies
  • 817 views

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?

This topic has been closed for replies.

5 replies

######
Senior II
March 6, 2025

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.

kRaje.1
kRaje.1Author
Associate III
March 6, 2025

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.

kRaje.1
kRaje.1Author
Associate III
March 6, 2025

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?

######
Senior II
March 6, 2025

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.