Skip to main content
nogema
Associate II
July 19, 2022
Question

Board resets systematically from standby mode

  • July 19, 2022
  • 10 replies
  • 4019 views

Hello,

I would like to reach the lowest consumption as possible. I am programming an end node which sends data through TTN. My project is based on the LoRaWAN End Node example with the LoRaWAN middleware.

My fimrware works like that :

  • at boot, the board join to TTN
  • after joined, the board turns in low power mode
  • if the button on the board is pressed, the board wakes up and sends some datas to TTN
  • after received the acknoledge, the board turns in low power mode

The example PWR_STANDBY works without any problem, I reach a consumption of 1.1 µA. I copied the code that configures and turns the board in standby mode into my firmware but at each boot, after reached the function HAL_PWR_EnterSTANDBYMode(), the board resets automatically.

Do you have any idea what I did wrong or miss in my firmware ? I can add the source code if needed.

I am using a custom board with the LoRa E5 STM32WL5EJC module embedded and the STM32WL package.

Thanks you in advance

Regards

This topic has been closed for replies.

10 replies

Tesla DeLorean
Guru
July 19, 2022

STANDBY exits via RESET

Check you don't have any other circuits which will POR when the supply goes away.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
nogema
nogemaAuthor
Associate II
July 20, 2022

I don't have any other circuits and supply on my board

nogema
nogemaAuthor
Associate II
July 20, 2022

Thanks you Piranha, it works !

I copied your code, I changed the wakeup pin because I only use the wakeup pin 1 (A0) and I added some #define because I don't have "PWR_CR1_LPMS_STANDBY". I found the definitions from this post :

https://gist.github.com/jefftenney/02b313fe649a14b4c75237f925872d72?permalink_comment_id=3758206#gistcomment-3758206

In standby mode, the consumption is 1.08 µA and in shutdown mode, 0.39 µA.

But after leaving the standby mode the first time, the consumption reaches 0.5 mA. I must turn off then turn on the supply to have again 1.08 µA. Is there a flag to clear after reset to have the 1.08 µA ?

Regards

Piranha
Principal III
July 20, 2022

You don't have to search the register values on the internet - they are documented in the reference manual.

Seems like the issue 3a is still not solved for you. Did you define the NDEBUG for a non-debug build and tested that build?

Associate III
June 17, 2024

Is there a generic solution to this for all of the STM32 Family?

I am currently trying to enter SHUTDOWN Mode in an STM32U083 and the processor keeps resetting and starting to run the code from the beginning again.

I'm calling:

HAL_PWR_EnterSHUTDOWNMode

I have added:

PWR->SCR = PWR_SCR_CWUF; // Clear wakeup flags

To the  void HAL_PWR_EnterSHUTDOWNMode(void) function but it is still resetting.