2021-01-25 06:17 AM
In code, we do not have call for changing RDP but we have a logic to reset IWDG_STOP bit after wakeup from sleep mode.
We are facing this option byte corruption problem when battery drops below 0%. (We do not have HW support for cutting off power for MCU when battery drops below 0%).
Is there any limitation for modifying option byte or erase/read/write flash (IAP mode) and VCC level. ? Can drop in voltage during ongoing flash read/write/erase operation corrupt Option byte?
2021-01-25 08:02 AM
Power loss or hickup during NVM write is always a problem. NVM write needs a certain voltage range. if you "below 0 %" situation violates this level, bad things may happen.
2021-01-25 08:40 AM
If the nominal bat. voltage is x volts, 0% are 0 volts. But, what does "below 0%" mean?
Are you using BOR?
2021-01-26 09:24 PM
@KnarfB We are not using BOR. Below 0% means below 3.3 where we have observed remaining capacity of battery is <0% (This number is from fuel gauge data), but the actual voltage of battery remains in range of 2.8v to 3.3v.
@Uwe Bonnes But as far as I remember to write to option byte, it has to be unlocked first then only write to it becomes possible.
2021-01-27 12:12 AM
> We are not using BOR.
Then do.
JW
2021-01-27 03:35 AM
> STM32F476
There is no such MCU.
> we have a logic to reset IWDG_STOP bit after wakeup from sleep mode.
Why? DBG_IWDG_STOP bit is for debugging. How is it related to sleep mode in your code?
2021-01-27 06:30 AM
My Bad. Its STM32L476.
2021-01-27 06:37 AM
If you have a fuel gauge shut down before reaching 0 %.
2021-01-27 07:02 AM
@Piranha We are using software watchdog and STOP2 mode for power saving. So in stop2 mode if watchdog is enabled and IWDG_STOP bit is not reset then it keeps waking up the MCU.
2021-01-27 07:09 AM
@Uwe Bonnes Yes we can do that. But my question is doing flash read/write operation in abnormal power condition can corrupt option byte?