System time is not updated upon exit from stm32f4xx stop mode until return from stop_mode_power_down_hook(). Global interrupts enable prior to return, so this can cause execution of IRQs before updating this system time.
This can cause IRQs that call host_rtos_get_time() to receive the wrong time.
In ThreadX, tx_time_get() is noted to be allowed from ISRs, so this is a very valid use case.
with threadx, one can call tx_time_increment() prior to returning from stop_mode_power_down_hook() and return 0 from this function.