How to reset STM32L4 after activating ReadOut Protection Level 1?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-17 10:32 PM
Hello!
I have a problem with STM32L496RG booting from flash after activating readout protection level 1. The issue is that MCU seems to get stuck in system bootloader code. The only way to get it to boot from main flash is to apply power on reset.
Accroding to RM0351 section 3.5.1 the readout protection is activated by system reset or power-on reset if debug was active. In my case I have no debugger connected and still the system reset is not enough to activate RDP and boot from main flash.
I have tried activating readout protection option bit via STM32CubeProgrammer and also from my firmware. In firmware, after calling HAL_FLASH_OB_Launch() the MCU ends up in unknown state where it does not respond to system bootloader command nor start executing program from main flash.
In my application I have backup power source constantly connected and there is no easy way for end user to apply power-on reset after firmware update. Is it known bug/feature for this device or am I doing something wrong? Is there any possible way to reset the MCU after RDP is activated?
- Labels:
-
RDP
-
STM32L4 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-09 1:37 AM
I'm seeing similar issue with STM32L462 when using the ROM bootloader via UART to enable readout protection. It just hangs after enabling RDP level 1 and requires power cycling to recover. With several other STM32 MCUs (F0, F3, H7, ...) this seems to work ok when doing it identically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-09 2:42 AM
Didn' verify this, so can't promise it will help: 6.1.1 says POR is generated when exiting from Standby or Shutdown mode. So, try to enter Standby mode with a wakeup by RTC or similar. And ensure that DBG_STANDBY is not set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-01 1:59 AM
Hello, same issue on STM32L476RE. In the code I program some option bytes (BOR level, BFB2..) and than launch the programming with HAL_FLASH_OB_Launch() and everything works okay: the MCU reset and the option are applied. When including the RDP level in these option the MCU did not reset anymore but get stuck and need a powering on-off cycle to restart... Any advice?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-01 2:11 AM
I got the solution from Frantz LEFRERE (ST Employee). He provided the attached example project that solved the issue for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-01 3:56 AM
Thanks, it works! I only had to add "CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);" before entering in standby mode, otherwise the OB programming procedure did not works. (Thanks to the comment of @Andreas Bolsch​ )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-07 4:23 AM
Is it possible to get this working when the flashing is done using the stock bootloader via UART?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-29 8:01 AM
Same question for me.. did you find a workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-30 1:18 AM
No. I tried doing version of that TEST_RDP code that would run off from RAM, but for some reason I cannot get it to run..
