Read Protection level 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-06 1:31 AM
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?
- Labels:
-
STM32U0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-06 2:37 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-06 3:47 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-06 4:57 AM - edited ‎2025-03-06 4:59 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-06 6:11 AM
Looks like your code resets unconditionally.
You should check for the RDP level and only modify option bytes if necessary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-06 7:23 AM
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.
