cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F100RC -- GPIO in standby mode

sysop
Associate II
Posted on March 31, 2012 at 12:02

What is the state of GPIO pins when microcontroller is in standby mode?  Each pin remembers it's own state: input, output, analog, pull-up, logic level on it?  Which document (datasheet, etc) and where specifies this behaviour?

#standby #gpio #stm32f100rc
4 REPLIES 4
alok472
Associate II
Posted on March 31, 2012 at 13:44

for STM32L, i refer Reference Manual, Standby mode explaination

I/O states in Standby mode

In Standby mode, all I/O pins are high impedance except for:

�?

Reset pad (still available)

�?

RTC_AF1 pin (PC13) if configured for Wakeup pin 2 (WKUP2), tamper, time-stamp,

RTC Alarm out, or RTC clock calibration out.

�?

WKUP pin 1 (PA0) and WKUP pin 3 (PE6), if enabled.

I found the smae kind of para in RM0008. (for STM32F)

I guess the it shall be same for STM32F100. Refer to right Reference manual.

sysop
Associate II
Posted on March 31, 2012 at 15:01

I am putting microcontroller in standby mode with code listed below. LED is turned on before entering standby mode. And then microcontroller enters standby mode LED is not turned off.

And because by default all microcontroller pins configured as digital inputs consuming current increases when I move hands close to microcontroller.

What I doing wrong? 

       GPIOA->BSRR=GPIO_BSRR_BR8;   // LED is on

       SCB->SCR |= SCB_SCR_SLEEPDEEP;

        PWR->CR |= PWR_CR_PDDS | PWR_CR_CWUF | PWR_CR_LPDS;

        //PWR->CSR &= ~PWR_CSR_WUF;

        for (n=0; n<10; n++) asm volatile (''nop'');

        asm volatile (''WFE'');

        while (1) {

                GPIOA->BSRR=GPIO_BSRR_BS8;

                delay(10000);

                GPIOA->BSRR=GPIO_BSRR_BR8;

                delay(10000);

        }

alok472
Associate II
Posted on April 01, 2012 at 04:13

I would suggest to use the stm32 fw library code example as reference to enter into the Low Power Mode such as standby.

After entering standby mode, the LED shall be turned off, i guess. Your code looks similar to code from library. You can still use the stm32 library

void PWR_EnterSTANDBYMode(void)

{

  /* Clear Wakeup flag */

  PWR->CR |= PWR_CR_CWUF;

 

  /* Select STANDBY mode */

  PWR->CR |= PWR_CR_PDDS;

 

  /* Set SLEEPDEEP bit of Cortex System Control Register */

  SCB->SCR |= SCB_SCR_SLEEPDEEP;

 

/* This option is used to ensure that store operations are completed */

#if defined ( __CC_ARM   )

  __force_stores();

#endif

  /* Request Wait For Interrupt */

  __WFI();

}

sysop
Associate II
Posted on April 02, 2012 at 20:59

  I forgot to enable clock to power control module...

  RCC->APB1ENR = RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN;