2022-08-09 02:40 AM
2022-08-09 03:15 AM
If you have backup-battery or supercapacitor connected to the VBat pin, then the RTC peripheral including its backup registers are retained. This gives you 32 registers, each of 32 bits, to store whatever you regard as important.
If that's not enough, you could write values to non-volatile storage, either in external EEPROM (or FRAM) or some of the FLASH in the stm32L4 (note the stm32 will freeze for a few milliseconds during flash-writing, and you will have to manage erasing of pages; ST have examples of EEPROM-emulation).
Unless your hardware can interrupt the cpu as power is dropping (but not so low that you don't have time to save the registers), you will need to update your stored values either as they change or periodically.
Hope this helps,
Danish
2022-08-09 03:15 AM
If you have backup-battery or supercapacitor connected to the VBat pin, then the RTC peripheral including its backup registers are retained. This gives you 32 registers, each of 32 bits, to store whatever you regard as important.
If that's not enough, you could write values to non-volatile storage, either in external EEPROM (or FRAM) or some of the FLASH in the stm32L4 (note the stm32 will freeze for a few milliseconds during flash-writing, and you will have to manage erasing of pages; ST have examples of EEPROM-emulation).
Unless your hardware can interrupt the cpu as power is dropping (but not so low that you don't have time to save the registers), you will need to update your stored values either as they change or periodically.
Hope this helps,
Danish