2022-09-28 05:22 AM
Hi,
I am currently using stm32wb 55 and I want to achive the shutdown/standby mode with WKUP pin functionality, I tried Several ways but it seems its not working, also there is not any example for the same,Below code is for your reference ....
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
SystemClock_Config();
WkupPin1_Config();
if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
}
HAL_Delay(5000);
BSP_LED_DeInit(LED2);
BSP_LED_DeInit(LED3);
/* Enable WakeUp Pin PWR_WAKEUP_PIN1 connected to PA0 */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
/* Clear all related wakeup flags*/
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF1);
/* Enter the Standby mode */
HAL_PWR_EnterSTANDBYMode();
======================================
/* USER CODE BEGIN 4 */
static void WkupPin1_Config(void)
{
/* Configure Button pin and unmask Wakeup with Interrupt request from line 0.*/
BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
/* Enable wake-up pin pull-up state in Standby mode.*/
HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_0);
HAL_PWREx_EnablePullUpPullDownConfig();
}
Solved! Go to Solution.
2022-11-07 06:14 AM
2022-10-07 06:15 AM
Hello,
An example of WKUP pin functionality to wake up the system from standby will be available soon on STM32 Hotspot GitHub with a dedicated wiki page.
Maybe you can try with this code:
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
SystemClock_Config();
WkupPin1_Config();
if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
}
HAL_Delay(5000);
BSP_LED_DeInit(LED2);
BSP_LED_DeInit(LED3);
/* Disable all used wakeup sources */
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
/* Clear all wake up Flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF1);
/* Enable pull up on wakeup pin PA0 */
HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_0);
/* Enable pull-up and pull-down configuration for CPU1 */
HAL_PWREx_EnablePullUpPullDownConfig();
/* Enable WakeUp Pin PWR_WAKEUP_PIN1 connected to PA0 */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
/* Clear all related wakeup flags*/
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF1);
/* Enter the Standby mode */
HAL_PWR_EnterSTANDBYMode();
======================================
/* USER CODE BEGIN 4 */
static void WkupPin1_Config(void)
{
/* Configure Button pin and unmask Wakeup with Interrupt request from line 0.*/
BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
/* Enable wake-up pin pull-up state in Standby mode.*/
HAL_PWREx_DisableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_0);
HAL_PWREx_EnablePullUpPullDownConfig();
}
Best Regards
2022-10-17 02:41 AM
Hello,
A new example is available on STM32 HotSpot Github STM32WB-BLE-standby which allow to wake up the system from standby from wake-up pin.
Best Regards
2022-10-17 05:59 AM
Hi Remy,
Thanks for the reply,
I have downloaded the project and loaded it as it is in P-Nucleo Board, It's advertising the ble, I am also able to discover and connect it through the ST Ble sensor app, furthormore its also able to connect and led blue is also operating as it is expected. When I disconnect the ble its going to Standby mode.....
Now.....
when I am trying to wake it up through the WKUP5 pin (PC5) by grounded it , its not able to wake-up the system.
one more obervation is LED2 is continously flickering when I upload BLE P2P Server Example (It's happning since past couple of days). Is there any anything wrong ???
Thanks in advance
2022-10-19 01:04 PM
2022-11-07 06:14 AM
2022-11-07 02:07 PM
The functions PWR_EnterOffMode(), PWR_EnterStopMode() and PWR_EnterSleepMode() still can have potential issues, which are described in my article, to which I gave a link in the other post.
A question about the PWR_ExitOffMode() function. As Standby/Shutdown modes cannot be exited without a reset, is this function implemented because the other CPU core or radio can block entering those modes?
2022-11-18 08:43 AM
This example will be of great help!
Nonetheless, opening the project in CubeIde it shows an ioc file that isn't in the repository...
2022-11-21 01:49 AM
Hello,
Indeed, the link to .ioc file will be remove, thanks for your feedback.
Best Regards
2024-09-25 06:30 PM
Hi Sir,
I have check this Github, but that WiKI page not work now.
https://wiki.st.com/stm32mcu/index.php?title=Connectivity:STM32WB_standby_low_power_mode
Is it available to fix it for reference?
Thank you
Best Regards,
Ethan