I am following this tutorial on how to use the USART port on a STM32 board.
https://www.youtube.com/watch?v=d6MZHdgCQx0
The tutorial says to do the following:
- Clear all pins
- Select your USART pins Tx and Rx
Then make the setting below.
The problem I am having is when I'm receiving the serial data on my PC my terminal program is saying it's getting a frame error and all the data is messed up.
This is the code I am using to send:
uint8_t myTx[13] = "Hello Wolrd\r\n";
HAL_UART_Transmit(&huart2, myTx, 13, 10);
HAL_Delay(1000);
I have checked and the baud rates are all set to 9600.
I don't know what I am doing wrong.
I am using a slightly different board than he is using in the video: mine is a NUCLEO-L031K6
Edit
Logic analyser output:
I have plugged it into a logic analyser and it seems to check out.
Any clues as to why it would show garbage in a terminal program?