STOP1 UART Wakeup 115200
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code and a linker script content. Please read this post: How to insert source code.
I have a STM32L433RCT3 and I'm exploring using the USART wakeup feature from STOP1 on RXNE. To improve the wakeup time and not miss any data, I clock the USART directly from the HSI and I configured the wakeup clock to be the HSI. I'm wondering if someone could confirm this is a safe thing to do at 115200 baudrate? I'd rather not use the USART's UCESM: USART Clock Enable in Stop mode bit to keep the clock running in STOP1 mode (significantly more sleep current).
From what I understand, the HSI takes a maximum of 6.2us to start up & stabilize? (Section 6.3.8 of Datasheet). Do you add the startup time (1.2us) and the stabilize time (5us) or do I just take the stabilize time?
At 115200 baudrate, there is a bit coming every 8.68us. Theoretically, do I have the time to wakeup, start/stabilize the HSI, process the USART byte (Interrupt into ring buffer), and not mess-up receiving the next byte? I enable irq right after STOP1 mode to ensure the RXNE interrupt is serviced ASAP.
HAL_SuspendTick();
HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI);
__enable_irq();
HAL_ResumeTick();
SystemClock_Config_fromSTOP();
I'm seeing it work on the bench, but I'm not sure how close I'm getting to the edge of what is safe operation?
Any help is appreciated, thanks!
