2022-11-14 05:30 AM
I am trying to build an low power application on the STM32WB5M with the discovery kit.
There is no PWR example for the DK board or the wb5m, so i am using the PWR_STOP2_RTC example for the wb55nucleo - wb55/wb5m are identical.
With measurement on JP5 of the DK i am getting ~330μA for stop2 mode(should be more like 5 μA).
When i try the Current measurement with an external power supply (7.2.4 UM2825) and 3,3V the application does not work at all, but there is no more discription for that kind of measurement.
What am i doing wrong?
Solved! Go to Solution.
2022-11-16 02:16 AM
Hello,
On the STM32WB5MMG Discovery Kit, there is an overconsumption due to ST-Link supply which is connected on STM32WB5MMG supply, so you can't reach a supply current of 3 uA.
Best Regards
2022-11-14 05:44 AM
first see:
https://community.st.com/s/question/0D53W00001vptepSAA/stop-mode-current-with-nucleo32
2022-11-14 06:04 AM
the free pins are set as analog in this example and it is build in release.
When i measure with an custom board with the stm32wb5m i get 50μA, so way less...
So why does the mesurement with the discovery kit not work as expected?
I can not find more informations about the current measurement than in the 7.2.4 in the UM2825. And im doing exactly what is described there.
2022-11-14 05:17 PM
Most likely the DBGMCU_CR register is not reset.
Read more details about it there:
2022-11-15 12:52 AM
it is set as in the example. https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC
The Main function does all what i think is neccessary for the Stop2 mode.
int main (int argc, char *argv[])
{
/* USER CODE BEGIN 1 */
GPIO_InitTypeDef GPIO_InitStructure;
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* Set low-power mode of CPU2 */
/* Note: Typically, action performed by CPU2 on a dual core application.
Since this example is single core, perform it by CPU1. */
/* Note: On STM32WB, both CPU1 and CPU2 must be in low-power mode
to set the entire System in low-power mode, corresponding to
the deepest low-power mode possible.
For example, CPU1 in Stop2 mode and CPU2 in Shutdown mode
will make system enter in Stop2 mode. */
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_RTC_Init();
/* USER CODE BEGIN 2 */
/* Configure LED2 and LED1 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
/* Insert 5 second delay */
HAL_Delay(5000);
/* Turn off the LED2 */
/* Enable GPIOs clock */
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOH_CLK_ENABLE();
/* 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_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(GPIOD, &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_GPIOD_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, 0x0FFF, RTC_WAKEUPCLOCK_RTCCLK_DIV16);
DBGMCU->CR = 0;
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
/* Enter STOP 2 mode */
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
/* ... Stop 2 mode ... */
/* Configure system clock after wake-up from STOP: enable MSI, PLL and select
MSI as system clock source (MSI and PLL are disabled in STOP mode) */
SYSCLKConfig_STOP();
/* Re-configure LED2 */
/* Note: LED state is controlled in function "HAL_SYSTICK_Callback" */
}
}
2022-11-16 02:16 AM
Hello,
On the STM32WB5MMG Discovery Kit, there is an overconsumption due to ST-Link supply which is connected on STM32WB5MMG supply, so you can't reach a supply current of 3 uA.
Best Regards