Nucleo 32 STM32L4 power consumption, measured with PPK
I have a Nucleo 32 board with STM32L432KC. I am using Power Profiler Kit II to measure the power consumption. I connected PPK Vout to Nucleo's 5V (pin 4 on CN4), GND to GND and the PPK is set as a source meter.
Program on MCU is running for 2s in RUN mode (80 MHz, LED on) and then for 2s in STOP 2 mode (LED off).
Code to enter the STOP 2 mode:
HAL_SuspendTick();
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET);
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);RTC and GPIO are used to wake up:
if(HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x02000, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK)
{
printf("Error setting RTC wakeup timer\n");
Error_Handler();
}
else
{
printf("RTC wakeup timer set\n");
}void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
UNUSED(GPIO_Pin);
if(GPIO_Pin == GPIO_PIN_12)
{
SystemClock_Config();
HAL_ResumeTick();
}
}
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
{
UNUSED(hrtc);
SystemClock_Config();
HAL_ResumeTick();
}On top of that the RTC Calendar is used to get the hour:
HAL_RTC_GetTime(&hrtc, &time, RTC_FORMAT_BIN);
HAL_RTC_GetDate(&hrtc, &date, RTC_FORMAT_BIN);
wakeup_current_time = time.Minutes * 60 + time.Seconds;
PPK shows that the power consumption for RUN mode is 12,8 mA, which I think is ok. However the power consumption for STOP 2 mode is 2,6 mA which is very high. According to the spec it should be 1,4 uA. Why is it like that? What am I missing?
