cancel
Showing results for 
Search instead for 
Did you mean: 

How to wake-up from sleep-mode on STM32L072

h.graf
Associate

I've modified the AT-command example from the X-CUBE-SFOX package to add another serial interface as a command link.

Now you can enter AT-commands via LPUART1 connected to terminal program on PC or send them from another CPU via USART1 and forward the payload to Sigfox.

Everthing works fine as long as LPUART1 is busy (connected to PC or short-cut between TX/RX). From the original example the firmware enters low-power mode if LPUART1 is idle.

I configured the USART1 to wake-up on RX-interrupt as well and expected that either an interrupt on LPUART1 or USART1 would trigger the activation. Didn't work.

Is there anything special I have to configure that the CPU reacts on both RX-interrupts?

2 REPLIES 2

Which one of the low-power modes are you using?

Are you sure you are using the SLEEP mode? If you are using the STOP mode then most likely your USART1's clock turns off that's why it doesn't generate an interrupt on incoming data. You should configure your USART1 to use, for example, the LSE clock source, then use the RCC_CSR's LSEON bit when entering STOP mode to leave it running. Or you can configure USART1 to use HSI16 and use the RCC_CR's HSI16KERON bit leave it running.

Make sure to read the "Wakeup from Stop mode using USART" section in the reference manual.

h.graf
Associate

Thanks for the hint!

I'm not sure (debugging is not working, and printing on LPUART prevents the SW from entering low-power mode) but I guess it is the STOP mode.

I've configured USART1 to use HSI16 and have now enabled HSI16KERON bit as well.

Unfortunately no change.

I guess I have to check more closely what the vcom-task for LPUART is doing with the interrupts.