cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB standby mode WKUPx

jirdom
Associate II

I'm working with the p-nucleo-wb55, and I would like to configure the pin PA0 , PC13 to wake up the MCU from Standby Mode. I configued PA0 and PC13 from STM32CubeMX to GPIO_EXTI0 and GPIO_EXTI13 respectively.

Config:

PA0 : External Interrupt with Falling edge , Pull-up

PC13 : External Interrupt with Falling edge , Pull-up

In my code I set the sequence that I follow to enable the WKUP line is:

HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);

HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_LOW);

HAL_PWR_EnterSTANDBYMode();

But interrupt from PA0 , PC13 not working in standby mode.

I reference from

RM0434: Multiprotocol wireless 32-bit MCU Arm®-based Cortex®-M4 with FPU, Bluetooth® Low-Energy and 802.15.4 radio solution

6 REPLIES 6
Le Corre Pierre
Associate III

Hello @jirdom​ ,

This does not exactly points to your solution but you can have a look inside the STM32Cube_FW_WB_V1.2.0 under Projects\P-NUCLEO-WB55.Nucleo\Examples\PWR.

You will find 5 examples detailing how to go to the various low power mode and use the various wake up sources:

  • PWR_LPRUN: How to enter and exit the Low-power run mode
  • PWR_LPSLEEP: How to enter the Low-power sleep mode and wake up from this mode by using an interrupt
  • PWR_PVD: How to configure the programmable voltage detector by using an external interrupt line. External DC supply must be used to supply Vdd
  • PWR_STANDBY_RTC: How to enter the Standby mode and wake-up from this mode by using an external reset or the RTC wakeup timer
  • PWR_STOP2_RTC: How to enter the Stop 2 mode and wake-up from this mode using an external reset or RTC wakeup timer

Pierre.

Hi Le Corre Pierre(ST Employee)

Thank for your information.

Do have example wake up from standby mode with WKUPx?

I checked from stm32wb55rg datasheet (LINK) on page 35. Standby mode able to wakeup by RF, Reset pin 5 I/Os (WKUPx) BOR, RTC, IWDG.

And the I/Os with wakeup from Standby/Shutdown capability are: PA0, PC13, PC12, PA2, PC5

HSpre.1
Associate III

Hi JIrdom

Did you ever find solution to your problem? I can use the example PWR_STANDBY_RTC and wake up from rtc and wake up from wakeup pin with bare code.

But as soon as i add BLE funtionality wakeup pin does not work anymore. , but RTC wakeup works fine

eloibonte
Associate II

Hello @jirdom​ and @HSpre.1​ ,

I am working on a project with the STM32WB55xx MCU.

I was wondering, even a long time after, if you had found a solution to your problem. I encounter exactly the same situation and I don't know what to do. On the datasheet, ST says :

"Standby Mode - Wakeup capability : Radio system (Bluetooth Low Energy, 802.15.4) ".

But then I couldn't wake up the MCU with RF or even with the WKUPx pins.

If you have any idea I would really appreciate your help :)

Thank you very much,

Best regards,

Eloi B.

PierreL
Associate III

Hello @eloibonte @HSpre.1  @jirdom 

I am working on a project with the STM32WB55

Even a long time after, I wondered if you had found a solution to your problem. I encounter the same situation and I don't know what to do.

I have a timer that after 5 sec launch the offmode :

	HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
	count++;
	
		if (count > 5)
		{
			count = 0;
			//HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
			//HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN2);
			//HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN3);
			//HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN4);
			HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN5);

			  /* Clear all related wakeup flags*/
			  __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

			  /* Enable WakeUp Pin PWR_WAKEUP_PIN2 connected to PC.13 */
			  //HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
			 // HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2);
			  //HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN3);
			 // HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4);
			  HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN5);

			  PWR_EnterOffMode();
}

 With this example, I do enter in Off mode (the Led stop to blink). But none (even if uncomment ) of the wake up pin work. (The led do not goes to blink)

But there are correctly set as you can see:

PierreL_0-1734098675028.png

 

Remyhx
Associate III

Wonder if somebody found the solution.

I use the stm32wb with rf and uart (at least during debug stage) and have an external pull down on SYS_WKUP_4. A button will feed it with 3.3V/Vcc if it has to wakeup.

First problem is that I have to use HAL_SuspendTick(); to prevent the uart and most probably also the rf to interfere (otherwise it will not sleep and continue). next I use:

 

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4);

 

to set the wakeup pin. 
 
It will go into standby mode, but waking up is not enabled. I also enabled sys_wkup_4 by selecting it in cubemx (pin editor). No extra code is created.
 
In AN5289 : "When the user application must enter Standby mode, it must first stop all RF activities, and fully reinitialize CPU2 when coming out of Standby mode." 
I don't need the reinitialization, but how do I correctly stop RF?