2020-09-17 09:15 PM
Hi all,
Could someone help me to clarify about the power consumption of STM32WB55CG, I can't see the difference between 2 series STM32WB55Cx and STM32WB55Rx related to "Low power modes". But in my case, I can put STM32WB55Rx (In Nucleo board) to Stop 2 mode with only 2.5uA consumption but it cost 60uA with the STM32WB55Cx once (USB dongle).
Here is the code I extracted from the ST Example
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
/* Configure all GPIO port pins in Analog Input mode (floating input trigger OFF) */
/* Note: Debug using ST-Link is not possible during the execution of this */
/* example because communication between ST-link and the device */
/* under test is done through UART. All GPIO pins are disabled (set */
/* to analog input mode) including UART I/O pins. */
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.Pin = GPIO_PIN_All;
GPIO_InitStructure.Mode = GPIO_MODE_ANALOG;
GPIO_InitStructure.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
HAL_GPIO_Init(GPIOE, &GPIO_InitStructure);
HAL_GPIO_Init(GPIOH, &GPIO_InitStructure);
/* Disable GPIOs clock */
__HAL_RCC_GPIOA_CLK_DISABLE();
__HAL_RCC_GPIOB_CLK_DISABLE();
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOE_CLK_DISABLE();
__HAL_RCC_GPIOH_CLK_DISABLE();
/* In case of debugger probe attached, work-around of issue specified in "ES0394 - STM32WB55Cx/Rx/Vx device errata":
2.2.9 Incomplete Stop 2 mode entry after a wakeup from debug upon EXTI line 48 event
"With the JTAG debugger enabled on GPIO pins and after a wakeup from debug triggered by an event on EXTI
line 48 (CDBGPWRUPREQ), the device may enter in a state in which attempts to enter Stop 2 mode are not fully
effective ..."
*/
LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_48);
LL_C2_EXTI_DisableIT_32_63(LL_EXTI_LINE_48);
/* Disable all used wakeup source */
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
/* Re-enable wakeup source */
/* ## Setting the Wake up time ############################################*/
/* RTC Wakeup Interrupt Generation:
the wake-up counter is set to its maximum value to yield the longuest
stop time to let the current reach its lowest operating point.
The maximum value is 0xFFFF, corresponding to about 33 sec. when
RTC_WAKEUPCLOCK_RTCCLK_DIV = RTCCLK_Div16 = 16
Wakeup Time Base = (RTC_WAKEUPCLOCK_RTCCLK_DIV /(LSI))
Wakeup Time = Wakeup Time Base * WakeUpCounter
= (RTC_WAKEUPCLOCK_RTCCLK_DIV /(LSI)) * WakeUpCounter
==> WakeUpCounter = Wakeup Time / Wakeup Time Base
To configure the wake up timer to maximum value, the WakeUpCounter is set to 0xFFFF:
Wakeup Time Base = 16 /(~32.000KHz) = ~0.5 ms
Wakeup Time = 0.5 ms * WakeUpCounter
Therefore, with wake-up counter = 0xFFFF = 65,535
Wakeup Time = 0,5 ms * 65,535 = 32,7675 s ~ 33 sec. */
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x0FFFF, RTC_WAKEUPCLOCK_RTCCLK_DIV16);
/* Enter STOP 2 mode */
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
/* ... Stop 2 mode ... */
Thanks in advanced.
Solved! Go to Solution.
2020-09-22 08:19 PM
Resolved, I'm sorry I forgot to power the VDDRF pin !!
2020-09-22 08:19 PM
Resolved, I'm sorry I forgot to power the VDDRF pin !!