cancel
Showing results for 
Search instead for 
Did you mean: 

Board resets systematically from standby mode

nogema
Associate II

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

10 REPLIES 10

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
Up vote any posts that you find helpful, it shows what's working..

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

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

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?

I define NDEBUG and I rebuild the project, but same problem

After many attempts, sometimes the consumption stays at 1 µA for 6 consecutive resets, but sometimes it switchs to 0.5 mA after 1 resets.

Before my function EnterStandbyMode() where I copied your code, I put the code from DBG_Init() :

LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_46);
HAL_DBGMCU_DisableDBGSleepMode();
HAL_DBGMCU_DisableDBGStopMode();
HAL_DBGMCU_DisableDBGStandbyMode();

Without this piece of code, the consumption switchs to 0.5 mA after 1 resets each time.

EDIT : the reason why the consumption stayed at 1 µA after consecutive resets was a bug with the button. So my problem doesn't come from there

Use the dedicated Code Snippet button, when posting code.

HAL_DBGMCU_DisableDBG***() functions do the same as section 3 in my article. If adding those makes a difference, that means you still have not implemented properly the section 3.

Disabling EXTI is not necessary. Actually disabling any interrupts at peripheral level can potentially create issues. This rises another question... Maybe you are entering the Standby mode from ISR (interrupt service routine)?

I am entering in standby mode only with your code after having received an ACK from TTN.

I went back in the reference manual and I found that "All registers are reset after wakeup from Standby except for PWR extended status and status clear register (PWR_EXTSCR)".

In fact at first boot with 1 µA, PWR->EXTSCR = 37376 and after a reset with 0.5 mA, PWR->EXTSCR = 39424. The difference corresponds with the 11th bit C2SBF. However, my project uses only the CPU1 and when I define DUAL_CORE, I get many compilation errors in stm32wlxx_ll_***.h files about member names