cancel
Showing results for 
Search instead for 
Did you mean: 

PWR_EnterSTOPMode not reducing current consumption

aa_talaat
Associate II
Posted on July 04, 2014 at 12:00

I am developing an application based on the STM32VL Discovery board centred around the STM32F100RBT6B microcontroller.

The application interfaces with an SPI TFT LCD based on ST7735, a set of user push buttons, SPI EEPROM, an external sensor and serial port to dump results to a laptop.

The following peripherals are used in the application:

    - GPIOx, AFIO,

    - EXTI (for receiving interrupts from user buttons)

    - BKP

    - DMA1 for fast data transfer to LCD

    - PWR, RCC

    - RTC to generate alarm interupts to read sensor at predefined user intervals.

    - SPI1 to ocmmunicate with the TFT and EEPROM.

    - TIM2 in capture mode to read the sensor

    - TIM3 in PWM to generate a controlled backlight to the LCD.

    - TIM4 to generate 1ms fixed delay that I use instead of the systick as the systicks prevents the STM32 from sleeping.

    - USART1 to communicate the stored reading in the EEPROM to the serial port of a laptop.

The application initially goes through a series of initializations, then a big while loop, checking for different types of actions to take followed by the following line to put the STM32 into stop mode till either an RTC or EXTI interrupt is received.

PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);

The systick is not enabled or configured. The RTC Alarm interrupt is not activated by default at startup.

I am using HSI clock to avoid reconfiguring the clock after waking up from stop mode.

Going through the debugger, I can see that running the stop command causes the debugger to kind of hang, and pausing it shows that it is stuck at the _WFI command, which tells me that the STM32 is stopped and nothing is waking it up.

However, the current consumption does not change from before and after calling the stop command. It remains at 11mA.

TIM3 is used in PWM mode to drive the LCD backlight and I can see that the LCD is still on despite calling the stop command.

I would expected that this command would turn off all peripherals and stops all clocks and take the current consumption to at least below 100uA.

Are there any commands I have to issue manually before the stop command to ensure that the power goes down.
2 REPLIES 2
chen
Associate II
Posted on July 04, 2014 at 13:46

Hi

''Going through the debugger, I can see that running the stop command causes the debugger to kind of hang, and pausing it shows that it is stuck at the _WFI command, which tells me that the STM32 is stopped and nothing is waking it up.''

Yes, stopping the STM32 means the debugger cannot communicate with the STM32 via JTAG/SWD.

''I am using HSI clock to avoid reconfiguring the clock after waking up from stop mode.''

Check the reference manual VERY CAREFULLY. Is the HSI (internal clock) affected by the STOP low power mode. Is the HSI affected by the internal voltage disable?

(I know the RTC does not work off the LSI but this is not documented in the reference manual)

Not sure why you are not seeing the current stay as is.

Have you set the ''peripheral clock enable in low power mode registers'' in the RCC?

(Howeverm I do no think they affect 'STOP' mode - only Sleep mode but please verify for yourself in the reference manual).

Posted on July 04, 2014 at 20:39

If you expect to get to 100uA you're going to have to own the turning off of peripherals and pins to achieve that.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..