2022-04-12 09:38 AM
I've written a simple program which should write data through UART to a PuTTY terminal on my laptop. I have the L4R5ZI Nucleo board, connected to my laptop via USB. I'm only sending 'Hello World \r\n' however, I get 'H9Go]oG #' back every time. All of the baud rate settings in the terminal are the same as my configuration, so I think it must be a clock error. I don't have an oscilloscope to check. Can anyone help? Thanks in advance.
Solved! Go to Solution.
2022-04-12 11:32 AM
No, use PCLK1 or SYSCLK as the clock mux and use HSE bypass as the source for the PLL (or SYSCLK). The Nucleo board should output 8MHz to HSE bypass.
2022-04-12 09:44 AM
The MSI is not very suitable as a clock source for UART, on account of its inaccuracy.
If you have no means to calibrate this and choose an appropriate MSICalibrationValue, using the provided HSE bypass clock source would be better choice.
2022-04-12 09:49 AM
Do you mean like this? I have the same issue when I use this setup.
2022-04-12 09:53 AM
Some reason to use 7-bit rather the 8-bit? Terminal configured to match?
hlpuart1.Init.WordLength = UART_WORDLENGTH_7B;
2022-04-12 10:14 AM
Yes it matches, doesn't change anything
2022-04-12 11:32 AM
No, use PCLK1 or SYSCLK as the clock mux and use HSE bypass as the source for the PLL (or SYSCLK). The Nucleo board should output 8MHz to HSE bypass.
2022-04-12 12:59 PM
Get the typical 115200/8-N-1 working and only then try unpopular options.
2022-04-12 01:06 PM
Does the HAL_UART_Init return an ERROR?
If you unpack the LPUART1->BRR does the math work for the baud rate?
Board jumpered for low voltage VDDIO ?
NUCLEO-L4R5ZI
or
NUCLEO-L4R5ZI-P ??
Engineer buys a scope...
2022-04-13 01:42 AM
Thank you, this worked!