cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-H723 Standby mode immediate exit on second and subsequent entry

abaril_catalys
Associate II

Hello,

I am evaluating the STM32H723 with the NUCLEO-H723ZG board and I need to use the standby mode with GPIO wake-up.

On the board, I have added a 10k pull-down resistor between pin PA0 (connector CN10 pin 29) and GND. I also have wire that I use to touch PA0 with 3V3.

On the firmware, I use the default project for the NUCLEO-H723ZG. Then, in MCC, I activate PWR Wake-Up 1.

In main.c, I add a simple function to put the MCU into standby mode that only accept the Wake-Up 1 event as the wake-up signal to reset the board. I also flash the yellow LED 10 times before calling the go to standby mode function as a visual indication.

The expected behavior would be that the yellow LED blinks 10 times then it goes dark. When I touch PA0 with the 3.3 V wire, the board should go back alive and blinks the yellow LED 10 times before going dark in standby mode again.

However, this is not what I am experiencing! On start up, the LED blinks 10 times then it goes into standby mode until I touch PA0. Then it restarts and the LED blinks but it doesn't go back into standby mode! It seems to reset immediately when going into standby mode the second and subsequent entry, even if I don't touch the PA0 pin with my 3.3 V wire.

I have to use the reset button or a power cycle to return to the standby mode without exiting immediately.

 

I guess there is something that is not properly reset when exiting the standby mode the first time but I can't get my hand on it so far...

 

I have attached the .ioc and the main.c files of the project.

 

Side note: I have tried the example with the RTC wakeup provide in STM32H7 cubeMX and it works as expected... I don't know why the GPIO pin wake-up doesn't work...

 

Thank you for your time helping me figure out this issue.

 

1 ACCEPTED SOLUTION

Accepted Solutions
abaril_catalys
Associate II

Yes it is true that I didn't reset the "counter" variable. My goal is that the reset on the Exit of Standby mode reset the counter to 0 as the RAM is wiped out.

I found a workaround solution... I went in the examples_LL folder in ST examples for the STM32H723 NUCLEO and found the PWR_EnterStandByMode example. This example use the LL driver to put the processor to sleep and configure wake-up pin 4 (PC13). I copied the function found in this example "EnterStandbyMode" in my project and changed the wake-up pin 4 (PC13) to wake-up pin 1 (PA0). Note that I also add to change the .ioc CubeMX project of my example to use the LL driver for PWR.

Now it is working as expected, the LED blinks 10 times then it goes into standby mode where the LED is turned off. Then I touch the PA0 pin with a 3.3 V wire and the MCU wakes up, blinks the LED 10 times then return to standby mode (instead of waking-up immediately, which was my problem when using the HAL driver).

If it can help others, I have posted the new main.c and .ioc files.

 

 

 

View solution in original post

2 REPLIES 2
LCE
Principal

I'm no "sleep/standby expert", but I see that the counter variable is never reset, could be placed after the enter standby function. So maybe it's only the symptoms (LED not blinking).

Maybe read the RM (or ARM documentation) to set the registers directly and better understand what's going on. So many HAL functions make this a little "hazy", or at least set up the wakeup pins only once.

 

 

abaril_catalys
Associate II

Yes it is true that I didn't reset the "counter" variable. My goal is that the reset on the Exit of Standby mode reset the counter to 0 as the RAM is wiped out.

I found a workaround solution... I went in the examples_LL folder in ST examples for the STM32H723 NUCLEO and found the PWR_EnterStandByMode example. This example use the LL driver to put the processor to sleep and configure wake-up pin 4 (PC13). I copied the function found in this example "EnterStandbyMode" in my project and changed the wake-up pin 4 (PC13) to wake-up pin 1 (PA0). Note that I also add to change the .ioc CubeMX project of my example to use the LL driver for PWR.

Now it is working as expected, the LED blinks 10 times then it goes into standby mode where the LED is turned off. Then I touch the PA0 pin with a 3.3 V wire and the MCU wakes up, blinks the LED 10 times then return to standby mode (instead of waking-up immediately, which was my problem when using the HAL driver).

If it can help others, I have posted the new main.c and .ioc files.