cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube_FW_F2_V1.4.0\Projects\STM32F207ZG-Nucleo\Examples\UART\UART_Printf , printing garbage data over the terminal

Pranay Dhuri
Associate II
Posted on April 24, 2017 at 09:38

Hi,

I am flashing the UART sample code given in STM32CubeF2 in my STM32F207ZG nucleo board,

It is compiling and flashing well but when I see the output on terminal (Tera term) it is printing garbage data (few characters are matching).

I have seen the baude rate in example is 9600 so a have set the same on tera term as well.

i should get o/p as:-

 UART Printf Example: retarget the C library printf function to the UART

** Test finished successfully. ** 

And what I am getting is-

Õ�RT �òénôæ Eøampìåº òåôaògåô ôhå C ìébòaòy pòénôæ æunãôéïn ôï ôhå Õ�RT

** Tåsô æénéshåd suããåssæuììy® **
4 REPLIES 4
Imen.D
ST Employee
Posted on April 24, 2017 at 11:19

Hi,

Please provide more details about y

our Hyperterminal configuration: 

data length

parity,

..

What's your Data value and

HSE crystal (Does your board have 

HSE crystal 25 MHz 

) ?

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on April 24, 2017 at 12:21

thanks Imen.., as you said problem was with hyper terminal configuration.

My tera term configuration was as-

data - 8 bit

parity - none

It should be -

data- 7 bit

parity - odd

Posted on March 22, 2018 at 23:08

Perfect! Thanks! I had the same problem with the example for the STM32F103RB_Nucleo board. Fixed now!

Posted on March 23, 2018 at 00:16

There is usually a big warning around the USART init code, but is a bit outside normal usage.

  /*♯♯-1- Configure the UART peripheral ♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯*/

  /* Put the USART peripheral in the Asynchronous mode (UART Mode) */

  /* UART configured as follows:

      - Word Length = 8 Bits (7 data bit + 1 parity bit) : BE CAREFUL : Program 7 data bits + 1 parity bit in PC HyperTerminal

      - Stop Bit    = One Stop bit

      - Parity      = ODD parity

      - BaudRate    = 9600 baud

      - Hardware flow control disabled (RTS and CTS signals) */

  UartHandle.Instance        = USARTx;

There are a couple of projects where the HSE_VALUE in stm32fxxx_hal_conf.h is wrong, but the NUCLEO's typically pull 8 MHz from the ST-LINK

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..