Question
Enabling 2 USART with different baud rate on STM32L0 Discovery board
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