cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U073 LPUART not waking from STOP2

CHemingway
Visitor

Hello,

I'm working on a low power project using STM32U073 with FreeRTOS, LPUART2 and LPTIM1.

To achieve the lowest system power possible I am trying to use STOP2 for when the system is idle.

Currently I have LPTIM1 releasing a semaphore every 1 second which then controls an I2C ASIC by grabbing the latest data then setting it going again for the next measurement.

This part of the project works perfectly and will allow the MCU to fall into STOP2, wait for the LPTIM1 compare interrupt, wake the MCU and control the I2C device before then falling back into STOP2.

While the MCU is in RUN mode, caused by LPTIM1, I can successfully service LPUART2 in that it will respond to a 'request for data' Modbus message.

If a message is sent to the MCU while it is in STOP2 the request for data is missed.

For testing I have disabled LPTIM1 IT and am trying to wake the MCU using LPUART RX alone and force the MCU to hold RUN for 100 ms so that I can see it on my power profiler, but all I am seeing is ~2ms activity ( 250 uA spikes on a 150 uA baseline, where I would be expecting an average of 1.16 mA at full power with a successful LPTIM1 wake ) when the MCU is receiving the byte string.

I have tried using HSI16 ( 38400 baud ) and LSE ( 9600 baud ) but with no success for either.

I have tried LPUART wake on START and RXNE with no difference.

This is all with PROGRAM rather than DEBUG.

In DEBUG the program is successfully entering HAL_UARTEx_WakeupCallback where I am setting 'Comms_Timeout = 100' which is decremented in HAL_IncTick with a guard in PreSleepProcessing to not call HAL_SuspendTick or HAL_PWREx_EnterSTOP2Mode until Comms_Timeout reaches zero.

I have a GPIO toggle in HAL_UARTEx_WakeUpCallback and can see it on a scope when sending UART messages from a host in DEBUG, but not in PROGRAM.

Flashing in DEBUG mode, running then disconnecting the debugger seems to work fine until I power cycle the MCU.

 

Any help or advice would be greatly appreciated.

0 REPLIES 0