Skip to main content
jephua
Associate III
August 5, 2014
Question

Enabling 2 USART with different baud rate on STM32L0 Discovery board

  • August 5, 2014
  • 2 replies
  • 819 views
Posted on August 05, 2014 at 12:16

Hi, I have used STM32CubeMx to generate the initialization code for USART1 and USART2.

USART1 is 56700bps while USART2 is 9600bps. In the main, I could send data out to USART1 but was unable to send data out to USART2... What could be the issue??? I have tried setting up USART2 alone but also could not send data out. I am using the following code:

int result = HAL_UART_Transmit(&huart2, uart2_data, sizeof(uart2_data), 1000);
if (result != HAL_OK) {
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
}

The result was HAL_OK... #hal #stm32l0-stm32l0-discovery
This topic has been closed for replies.

2 replies

stm32cube-t
ST Employee
August 29, 2014
Posted on August 29, 2014 at 13:57

Hello Eugene,

Note that on STM32L0 Discovery board, the USART2 can not be used reliably as the pins it uses (PA2/PA3 and alternate PA15) have been connected to the Linear Touch Sensor (PA2/PA3) and to the e-Paper display (SPI on PA15). [See board documentation for details]

Best Regards

jephua
jephuaAuthor
Associate III
September 3, 2014
Posted on September 03, 2014 at 03:12

Hi, thanks for the information :) Didn't read the manual carefully heh