AnsweredAssumed Answered

Exiting STOP mode on USART character

Question asked by Gordon Williams on Aug 30, 2013
Latest reply on Sep 1, 2013 by Clive One
Hi, I have a bit of an issue - I'm trying to put an STM32 into STOP mode, but to have it wake up when a character is sent over the USART (and to receive that character).

My code is just:

// .. set up an EXTI for the USART RX pin
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
// disable EXTI for the USART RX pin and swap it back to the USART
RCC_HSEConfig(RCC_HSE_ON);
if( RCC_WaitForHSEStartUp() == SUCCESS) {
  RCC_PLLCmd(ENABLE);
  while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);
  RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
  while(RCC_GetSYSCLKSource() != 0x08);
}

However the character that is received is corrupted. My guess is that maybe the HSE/PLL takes too long to start up, and so the USART is being clocked too slowly initially.

The serial data is coming in at 9600 baud so I hoped that there would be enough time for everything to get up to speed though. Any ideas? This seems like a common thing to want to do.

Outcomes