cancel
Showing results for 
Search instead for 
Did you mean: 

STM32LO51, I want to achieve lowest possible power in sleep while still being able to wake up using UART at 115200 baud rate

AV.9
Associate II

I want to be getting my characters , including the first one from uart at 115200 baud rate and use UART to wake up from sleep, how do I do this ? The sleep mode and low power sleep mode, with all gpios changed to analog no pull and all other peripherals disabled, still give a current draw of more than 2.2mA .

I put it to low power sleep using

HAL_SuspendTick(); // Suspend the system tick timer during low-power modes

HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);

The stop mode does not wake up with uart, I have tried using

__HAL_RCC_HSISTOP_ENABLE() ;

   HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI);

   __HAL_RCC_HSISTOP_DISABLE() ;

So mthat UART1 on HSI wiould still wake up, but it doesn't

What else can I do to achieve low power in low power sleep mode or get the stop mode working to get under 1.2mA in sleep ? I can turn off everything except for UART1, which I'm already doing right now

2 REPLIES 2
Guenael Cadier
ST Employee

HI @av.9​ 

Some ideas of things to check :

  • check in Reference Manual if UART instance you are using is supporting wake up from stop mode. Should be available in following table.


_legacyfs_online_stmicro_images_0693W00000dDUywQAG.png

  • do you call HAL_UARTEx_EnableStopMode() before calling HAL_PWR_EnterSTOPMode() ? It is needed for allowing UART to wake up from stop mode (bit UESM in CR1).
  • for waking up, RXNE interrupt should be enabled. do you start a Reception process prior entering the Stop mode ? for example by calling HAL_UART_Receive_IT() API

Hope this helps.

Regards

Danish1
Lead II

Sleep mode leaves the processor clock running at whatever speed you had it before, and that clock is still fed to the peripherals. To reduce current consumption in sleep mode, you need to slow that clock down.

For example if you are using HSE or HSI with PLL to get 32 MHz, at core-voltage range 1, the current consumption will be typically 1.7 mA, worst-case 2.4 mA

But if your clock is only 16 MHz you can set core voltage range 2 so current consumption is typically 700 uA, worst-case 950 uA.

On top of this consumption, there is the consumption of each peripheral that is still enabled during sleep.

I'm pretty sure 115200 can easily be handled with a 16 MHz clock, but I don't know if you need to run faster when awake. It can get messy to switch between clock frequencies because you need to update the baud-rate generator of any UARTs.

(I'm consciously not addressing why you can't wake up from stop).