Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Nucleo-L152RE + IDB05A1: Force the board in a low power mode and wake up as soon as a device wants to connect with the IDB05A1 (BLE)


Hello,

One specification of my system is the long live of my peripheral (Nucleo-L152RE+ IDB05A1). The most time, my peripheral is in advertising mode. I know that as soon as IDB05A1 advertising I can put µc in standby, the IDB05A1 will work autonomously and continue to advertise. If the IDB05A1 find a central it will wake up the microcontroller.


1. I tried to enter low power modes with following pre-built functions:

‘’HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI );

HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFE );

HAL_PWR_EnterSTANDBYMode();’’

The Microcontroller reach the low power mode but the current is around 1mA which is far too much. In these modes I couldn’t wake up the microcontroller.


2. On the web I found following function. With it I had a similar current consumption but the microcontroller is able to be wake up:

‘’void EnterStandbyMode(void)
{
/* Wait that user release the User push-button */

/* Disable all used wakeup sources */
//LL_PWR_DisableWakeUpPin(LL_PWR_WAKEUP_PIN1);
CLEAR_BIT(PWR->CSR, PWR_CSR_EWUP1);

/* Clear all wake up Flag */
//LL_PWR_ClearFlag_WU();
SET_BIT(PWR->CR, PWR_CR_CWUF);

/* Enable wakeup pin */
//LL_PWR_EnableWakeUpPin(LL_PWR_WAKEUP_PIN1);
SET_BIT(PWR->CSR, PWR_CSR_EWUP1);

/* Enable ultra low power mode */
//LL_PWR_EnableUltraLowPower();
SET_BIT(PWR->CR, PWR_CR_ULP);

/** Request to enter STANDBY mode
* Following procedure describe in STM32L1xx Reference Manual
* See PWR part, section Low-power modes, Standby mode
*/
/* Set STANDBY mode when CPU enters deepsleep */
//LL_PWR_SetPowerMode(LL_PWR_MODE_STANDBY);
MODIFY_REG(PWR->CR, PWR_CR_PDDS, PWR_CR_PDDS);

/* Set SLEEPDEEP bit of Cortex System Control Register */
//LL_LPM_EnableDeepSleep();
SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));

/* This option is used to ensure that store operations are completed */

  1. if defined ( __CC_ARM)

__force_stores();

  1. endif

/* Request Wait For Interrupt */
__WFI();
}’’


3. After the wake up the microcontroller restarts. I know which interrupt is incoming but it’s incoming a lot of times so I can’t find a fitting logic which secure that the microcontroller is not getting in low power mode again.
At the moment when a device want connect to my microcontroller it is in ... standby -> wake up -> standby -> wake up -> stanby...

By the way I work with STM32CubeMX and SW4STM32.


I hope you can help me with the current consumption problem and the logic. If you have any ideas about this issues, feel free to share your thoughts


Best regards,
Tobias

 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs