2020-09-04 03:10 PM
I am working with a STM32L552ze on a nucleo-144 board and hoping to get to the lowest power consumption available for this processor. However currently I am at 450uA on the MCU power pin. When i first started i was at about .181uA. This is with the same exact code....... in between it was configured to read the vbat value from ADC but that was then removed from the code.
currently before going into shutdown I do the following.
CLEAR_BIT(tmpADC_Common->CCR,ADC_CCR_VBATEN); //clear the vbaten in CCR
HAL_PWREx_DisableBatteryCharging(); //dis able vbat charging
HAL_ADC_Stop(&hadc1);//STOP and disable ADC
HAL_ADC_DeInit(&hadc1); DeInit ADC
//disable GPIO clocks
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOA_CLK_DISABLE();
HAL_ADCEx_DisableVoltageRegulator(&hadc1); //disable voltage regulator
HAL_ADCEx_EnterADCDeepPowerDownMode(&hadc1); //ADC set to deep power down mode
HAL_PWREx_EnableUltraLowPowerMode(); //enable processor low power mode
HAL_PWR_DisableBkUpAccess();
HAL_PWREx_DisableSRAM2ContentRetention();
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE|RCC_OSCILLATORTYPE_MSI;
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
RCC_OscInitStruct.MSIState = RCC_MSI_OFF;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
GPIO_InitTypeDef GPIO_Init;
/* configure the GPIO_LED pin */
GPIO_Init.Pin = LED_G_Pin;
GPIO_Init.Mode = GPIO_MODE_INPUT;
GPIO_Init.Pull = GPIO_NOPULL;
HAL_GPIO_Init(LED_G_GPIO_Port, &GPIO_Init);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
HAL_PWREx_EnterSHUTDOWNMode();
I am wondering if there is someplace I should be looking I have seen others commenting on low power with this processor able to get, 1.2uA ...
2020-09-04 05:00 PM
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE|RCC_OSCILLATORTYPE_MSI;
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
RCC_OscInitStruct.MSIState = RCC_MSI_OFF;
This doesn't actually do anything. You're just setting the configuration values but not actually turning off the LSE or MSI. You need a call to HAL_RCC_something to make it take effect.
2020-09-04 05:14 PM
I forgot to copy the lines out of the file to the post, this was fixed in the post.