2020-10-20 11:52 PM
Hi,
I have been working in Lower devices ( STM32L0),
Using 1MHZ Clock. ( MSI)
I m using Standy Mode to reduce current consumption when i am not using controller. In Standby mode with accelerometer i am expecting 37uA current but sometimes it is consuming 500 uA to 1 ma.
I Suspect 3 things,
1) capacitors , started to reduce the capacitors in VCC line( removed C5,C6,C7,C8,C9,C10,C33 ,C34 ) and kept C19 as 4.7ua and C32 as 0.1ua near vddio2 pin after that in some devices the problem solved but after some days if i measure the same devices , the problem exits. (Capacitor details i have attached in circuit diagram)
2) In some devices in standby LED is glowing (Mildly), So i thought some clock is ON in Standby So i Started disabling all clocks while going to standby and when i disabled APB2 Clock current consumption Reduces by 150uA.
3) When i have go through some websites , there preferred to give different power suppy to VDD and VDDA pin. So , i pulled the VDDA pin off and gave 2.9v separately and found current consumption is reduced in some devices.
I have attached my standby Code:
__HAL_RCC_PWR_CLK_ENABLE();
ACCLR_StandbyMode();
__HAL_RCC_APB2_FORCE_RESET(); // added to control power in Standby
RCC->APB1RSTR = 0xEFFFFFFFU; // PWR_EN , all periperal disabled
SET_BIT(PWR->CR, PWR_CSR_SBF); // Standby clear
SET_BIT(PWR->CR, PWR_CSR_WUF_Pos); //Wakeup clear
CLEAR_BIT(PWR->CR, PWR_CSR_PVDO_Pos); // PVD Clear
RTC_AlarmDisable(RTC_ALARM_A);
RTC_AlarmDisable(RTC_ALARM_B);
RTC_TamperDisable(RTC_TAMPER_1);
RTC_TamperDisable(RTC_TAMPER_2);
RTC_WakeupTimerDisable();
/* Clear PWR wake up Flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
/* Clear Alarm A flag */
__HAL_RTC_ALARM_CLEAR_FLAG(&hrtc, RTC_FLAG_ALRAF);
/* Clear Alarm B flag */
__HAL_RTC_ALARM_CLEAR_FLAG(&hrtc, RTC_FLAG_ALRBF);
/* Clear RTC Tamper 1 Flag */
__HAL_RTC_TAMPER_CLEAR_FLAG(&hrtc,RTC_FLAG_TAMP1F);
/* Clear RTC Tamper 2 Flag */
__HAL_RTC_TAMPER_CLEAR_FLAG(&hrtc,RTC_FLAG_TAMP2F);
/* Clear RTC Wake Up timer Flag */
__HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&hrtc, RTC_FLAG_WUTF);
/* Enable Ultra low power mode */
HAL_PWREx_EnableUltraLowPower();
/* Enter the Standby mode */
HAL_PWR_EnterSTANDBYMode();
2020-10-21 05:07 AM
All I can suggest is that try a bare board with just the micro and minimum required passive components. Capacitors are usually not a problem unless they are leaking (I had trouble with one capacitor with a lowish voltage rating - I now try to have a voltage rating as high as possible for reliability), but leave them off your "bare" test board maybe. I would be more concerned about the state of your pins when you enter standby, whether they are floating, analog, output-low etc. (the Led glowing could be a sign that the pin is floating instead of being set output-low) If you get the current you expect with the bare board, I would try touching the pins to see how stable the current consumption is (probably not a recommended method - but something I do to check for floating pins, maybe someone else will have a more professional method)
2020-10-22 01:14 AM
HI greg, thanks for ur reply. Tried tat also current consumption is same. I removed all components and try measuring the voltage of the GPIO in standby , voltage ranges from 0.1 to 0.8v (Measured all pins).
Is there a way to Pull Gpio pin Low in Standby ?
or to have a backup memory of the GPIO pins in standby ?
2020-10-22 01:48 AM
Did you consider the PA1 divider? The additional sensor?
2020-10-22 02:27 AM
Hi Bonnes, that pin is for ADC , i removed that pin also when measuring .
2020-10-31 10:38 AM
Also do this before going into low-power mode:
DBGMCU->CR = 0; // Disable debug and trace in low-power modes