2022-04-04 01:45 AM
Dear,
on STM32L083 I use internal eeprom. I found out, that when I use function
HAL_FLASHEx_DATAEEPROM_Program
and during execution of this function the power voltage of mcu falls down (uplugged battery from device) - then in eeprom are saved wrong data (probably only in sectors which I wanted to modify by calling the function above).
I use BOR Level1. Also I tried to activate PVD and in its IRQ callbacks I just added while(1); until the mcu goes to reset.
Is there any solution for that?
Thank you very much, Jan.
Solved! Go to Solution.
2022-04-29 03:01 AM
Thank you fo reply.
I have already solved it by mirroring the eeprom memory place. Now my value is stored on 3 places in the eeprom - after reading I compare the 3 values and if any 2 are equal then I take them as correct. It cost more memory area, but it seems like it i working.
2022-04-28 08:59 AM
The problem is that PVD and BOR alone are of no use if the voltage fails at that moment, because the write/erase process must be completed successfully.
Yes, there is a solution: decoupling capacitors with appropriate size to power the STM32L0xx during the full write or erase operation and before the supply voltage goes below the minimum VDD (1.8V with BOR enabled).
Does it answer your question?
Regards
/Peter
2022-04-29 03:01 AM
Thank you fo reply.
I have already solved it by mirroring the eeprom memory place. Now my value is stored on 3 places in the eeprom - after reading I compare the 3 values and if any 2 are equal then I take them as correct. It cost more memory area, but it seems like it i working.
2022-04-29 03:23 AM
Increasing the size of the buffer capacitors is not an option because that would be the safest method?
Regards
/Peter
2022-04-29 03:34 AM
I am not sure if I understand. When I add another capacitors - where is solution? I do not know when the battery is going to unplug..
2022-04-29 03:40 AM
Well, with the PVD you can continuously check the supply voltage via the PVD_IN and start a write action in case of a voltage drop. Of course, the buffer capacitors must be large enough to successfully complete the write action.
Regards
/Peter
2022-05-03 04:02 AM
If the problem is resolved, please mark this topic as answered by selecting Select as best under your preferred answer. This will help other users find that answer faster.
/Peter