2024-10-15 03:14 AM
I've implemented Read Out Protection in the firmware running on an STM32L010K4T6 MCU, but I'm experiencing unexpected behavior.
2. When I power cycle the device the option byte has a new modified value (Read out protection applied).
3. I have also tried with a system reset but the result is same.
4. I also try out with putting MCU in standby mode and waking up through RTC interrupt but it unable to load option bytes and hang the MCU
We cannot power cycle this device as it is situated in the field. How can we reload option bytes after writing to flash and reset the system without disconnecting power ?
Could you please provide the solutions ?
How to reload option bytes using NRST pin by applying reset through it? Or any work around for the same.
2024-10-17 07:16 PM
STM32L0 reference manual is the document for you to read:
chapter "Reloading Option bytes by software"
It is possible to request an Option byte reloading by setting the OBL_LAUNCH flag to 1 in
the FLASH_PECR register. This bit can be set only when OPTLOCK = 0 (and PELOCK =
0). Setting this bit, the ongoing write/erase is completed, but no new write/erase or read
operation is executed.
The reload of Option bytes generates a reset of the device but without a power-down. The
options must be reloaded after every change of the Option bytes in the NVM, so that the
changes can apply.
2024-10-22 01:43 AM
Hello Jiangfan ,
We had already tried out the workaround suggested by ST, It is mentioned in ST MCU datasheet. It was not working.
To tried search any solution of this issue on ST community/Forum and found one workaround as detailed below.
As per this workaround we have to wake up the ST MCU in standby mode. We able to get expected output by waking up from standby mode.
Below are the steps we followed.
1) Write the option bytes
2) DO NOT set OBL_LAUNCH
3) Set up RTC so it will wake up after a second
4) Enter standby mode and wakeup by RTC.
This will effectively reset everything after a second and MCU FW will work as expected.
Could you please share this workaround and its steps with ST and confirm whether this is correct way to get rid of the issue ?
2024-10-22 01:59 AM
You may try
Below steps.
1) Write the option bytes
2) delay some time, such as 100ms
3) set OBL_LAUNCH
2024-10-22 02:07 AM
Hello Jiangfan ,
After changing RDP level to level1 if i try to access the boot after boot pin false MCU not running user code (may it generates hard fault and going into infinite loop)
Can you please sort this issue.
According to your suggestion option bytes changes if due to ST- link connected to it ,MCU generates Hard fault.
MCU end up with hang state.
Can please reply for this avoiding hard fault after below steps
1)After reloading option bytes by setting OBL_LAUCH bit
2)After changing to level 1 if I communicate with bootloader it generates hard fault for FW
2024-10-22 06:51 PM
to avoid impact of ST- link, you may do the test by disconnecting ST-link.