0
\$\begingroup\$

I'm experimenting with standby mode on STM32F407VGT6. I know how to put MCU into standby mode(or I think to know that). I'm doing that with this init function:

void MX_RTC_Init(void) {

   RTC_TimeTypeDef sTime = {0};  
   RTC_DateTypeDef sDate = {0};

   /** Initialize RTC Only  */   hrtc.Instance = RTC;  
   hrtc.Init.HourFormat = RTC_HOURFORMAT_24;  
   hrtc.Init.AsynchPrediv =127; 
   hrtc.Init.SynchPrediv = 255; 
   hrtc.Init.OutPut = RTC_OUTPUT_WAKEUP; 
   hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; 
   hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; 
   if (HAL_RTC_Init(&hrtc) != HAL_OK)   {
      Error_Handler();
   }

   /** Initialize RTC and set the Time and Date */
   sTime.Hours = 0x13;
   sTime.Minutes = 0x20;
   sTime.Seconds = 0x0;
   sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
   sTime.StoreOperation = RTC_STOREOPERATION_RESET;
   if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK)
   {
      Error_Handler();
   }
   sDate.WeekDay = RTC_WEEKDAY_THURSDAY;
   sDate.Month = RTC_MONTH_JANUARY;
   sDate.Date = 0x30;
   sDate.Year = 0x20;

   if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK)
   {
      Error_Handler();
   }
   HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);

}

This init function allows to wake up MCU from standby mode with wakeup pin(PA0) and with timer(currently period is ~20sec). Next function is called when I want to put MCU into standby mode:

void Enter_StandbyMode(void)
{   
    __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&hrtc, RTC_FLAG_WUTF);

    HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
    __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
    HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);

    HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 40960,RTC_WAKEUPCLOCK_RTCCLK_DIV16);

    HAL_PWR_EnterSTANDBYMode();

}

Again this works as I expect(I used diode to indicate when MCU wake-up from standby) but my question is next one:

Why I still have voltage on pins when MCU is in standby mode? And when I use multimeter to measure current I got ~30mA power consumption in normal mode(when MCU isn't in standby mode) and ~0.58mA(which is ~580uA) when MCU is in standby mode. I read in datasheet that MCU in standby mode can have power consumption less then 5uA. Every hint and idea are welcome

\$\endgroup\$
  • \$\begingroup\$ What other components are on the board that might have a quiescent current? Or are you measuring directly the current to the MCU? \$\endgroup\$ – Maximilian Gerhardt Feb 12 at 11:10
  • \$\begingroup\$ I measure current on JP1, Idd pins (datasheet says that we can take off jumper on Idd pins and then we can connect multimeter to measure current [st.com/content/ccc/resource/technical/document/application_note/… page 20). On MCU i have usb-uart board and just rx/tx pins and gnd are connected to MCU, one adc, 5v is used from mcu for supplying LCD, sim800l is connected to MCu via Rx/Tx pins and gnd \$\endgroup\$ – subavet995 Feb 12 at 11:38
  • \$\begingroup\$ "one adc" Is there a potentiometer, by any chance? "I still have voltage on pins" which pins? \$\endgroup\$ – Maple Feb 12 at 13:02
  • \$\begingroup\$ On pins which I configurate for utilization (5V, 3V, Tx pin,..). No there isn't any potentiometer. \$\endgroup\$ – subavet995 Feb 12 at 13:43
  • \$\begingroup\$ Your link goes nowhere, and you are referring to a jumper, but have only specified a microcontroller - you need to specify what board you are using if it is COTS. The USB/Serial bridge is a microprocessor as is the sim800l , they will draw current too. They may have low power modes you can put them in. \$\endgroup\$ – Clifford Feb 12 at 17:35
1
\$\begingroup\$

Have you enabled the Clock for the Power Module? It is kind of confusing that you have to enable something to reduce the power consumption.

Deactivating all clocks of unused Peripherals will also lead to a major power reduction. We also measure higher current consumption while the controller is still connected to a debugger.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ I didn't find something like that. I try with this to reduce power consumption: __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(); This thing is only what I find which looks like clock for power module:__HAL_RCC_PWR_CLK_SLEEP_ENABLE(); I got same power sonsumption. \$\endgroup\$ – subavet995 Feb 13 at 10:15
  • \$\begingroup\$ My bad, was not paying attention to your controller family. In STM32L4 family the function name is __HAL_RCC_PWR_CLK_ENABLE. For F0 family your solution might be correct. \$\endgroup\$ – A.R.C. Feb 13 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.