STM32U545 hold-up time required to log an event to flash
We are working on a design that includes an STM32U545 running at around 1MHz to save battery power for the overall board. We have a requirement to write to an event log when the power is removed (this is the main operating power, not VBAT).
The software will keep the STM32U545 in Stop 2 mode between external events and LPTIM1 events to further minimize power consumption, waking only long enough to read and evaluate the changes in the environment before stopping pending the next event.
One of the events is from the power monitor circuit on the board that will change the level of a signal going into a GPIO of the STM32U5 when the power source (external or battery power, automatically selected by the power monitor) drops below the required voltage. The requirement is that the power-loss event be logged for recovery when the power is restored. To this end, the EE designing the board is including a capacitor to provide hold-up power to allow the software to respond to the power loss event and write the log entry (less than a 128 bit page) to a known location.
I'm the software architect for this project, and I've been tasked with determining how long, from the power loss signal to the completion of the flash write, will be required. Due to board space and other considerations, this must be quite minimal - he's proposing 1ms, but I've not used the STM32U5s previously and we don't have any dev boards for me to simulate the conditions on yet, so it's hard for me to calculate from the timings in the datasheet alone. I have been given 2 days to provide this information to include in a proposal.
Is there a resource that I can use for this? I can work out roughly how much code is involved once the processor wakes up and starts executing the handler. I know the CubeMX tool has a power estimator, but what I need is a time estimate from interrupt to handler execution at a given clock rate and assuming the Stop 2 state as the starting point. I also have not worked out how to configure the timing parameters to set the core clock rate to 1MHz since what I see in the Clock Configuration panel doesn't make a lot of sense to me (am I looking for SYSCLK, HCLK, etc.?).
Thanks in advance.
