AnsweredAssumed Answered

About stm32L  stop mode uart

Question asked by guo sir on Nov 26, 2017
Latest reply on Nov 26, 2017 by Clive One

hi everyone~

Before  enter stop mode ,I called HAL_UART_DeInit(&huart3) an  after it was  wake up from stop mode(wake up by rtc), I called HAL_UART_Init(&huart3),but after wake up uart3 can't work. What should I do?

 

before enter stop mode:

  huart3.Instance = USART3;
  if (HAL_UART_DeInit(&huart3) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

 

 

wake up from stop mode:

  huart3.Instance = USART3;
  huart3.Init.BaudRate = 9600;
  huart3.Init.WordLength = UART_WORDLENGTH_8B;
  huart3.Init.StopBits = UART_STOPBITS_1;
  huart3.Init.Parity = UART_PARITY_NONE;
  huart3.Init.Mode = UART_MODE_TX_RX;
  huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  huart3.Init.OverSampling = UART_OVERSAMPLING_16;
  if (HAL_UART_Init(&huart3) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

Outcomes