Question
STM32L010RB, STOPmode with RTC wakeup.
New to STM32 low power devices.
I cannot get power consumption of the nucelo to below 120ua when measuring at IDD. I have configured the ISR and RTC as per NUCLEO-L031K6\Examples\PWR\PWR_STOP_RTC
Any assistance would be highly appreciated.
I can get the module to also go into Standby but am experiencing the same high current.
void Stop_For(int seconds) {
GPIO_InitTypeDef GPIO_InitStructure = { 0 };
/* Enable GPIOs clock */
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOC_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(GPIOH, &GPIO_InitStructure);
/* Disable GPIOs clock */
__HAL_RCC_GPIOA_CLK_DISABLE();
__HAL_RCC_GPIOB_CLK_DISABLE();
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOH_CLK_DISABLE();
//RTC
MX_RTC_Init();
/* Start WakeUp Timer */
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, seconds, RTC_WAKEUPCLOCK_CK_SPRE_16BITS); //2 seconds
/*Clear all related wakeup flags*/
/* Enable Power Control clock */
//__HAL_RCC_PWR_CLK_ENABLE();
/* Enable Ultra low power mode */
//HAL_PWREx_EnableUltraLowPower();
/* Enable the fast wake up from Ultra low power mode */
//HAL_PWREx_EnableFastWakeUp();
/*Suspend Tick increment to prevent wakeup by Systick interrupt.
Otherwise the Systick interrupt will wake up the device within 1ms (HAL time base)*/
HAL_SuspendTick();
/* Enter Sleep Mode , wake up is done once Key push button is pressed */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFE);
/* Resume Tick interrupt if disabled prior to s mode entry*/
HAL_ResumeTick();
SystemClock_Config();
MX_GPIO_Init();
}