Skip to main content
TH.16.336
Associate III
January 27, 2020
Question

How to feed New Line ('\n') from my Nucleo-F44rZE board to PC terminal?

  • January 27, 2020
  • 3 replies
  • 3707 views

Hello All,

I am using Nucleo-F44rZE board. From my nucleo board, I want to send a new line char to my terminal which actually has to fee a line in terminal when it recieves it.

I have the following code, which actually prints 0A in my terminal instead of feeding a new line.

uint8_t nl = 0x0A; // ascii value for new line feed

HAL_UART_Transmit(&huart5, &nl, 1, 100); // Go to the next line

Please help to understand this behavior and find the solution for this.

This topic has been closed for replies.

3 replies

Uwe Bonnes
Chief
January 27, 2020

Is your terminal printing in hex and not interpreting the ascii meaning of a character?

Guenael Cadier
ST Employee
January 27, 2020

Your question makes sense, in my view.

@TH.16.336​ What happens if you send other data values (0x31 => "1" or 0x42 => "B") ?

Tesla DeLorean
Guru
January 27, 2020

What Terminal application, in what mode?

Try different terminal software. Some will show CR LF info

Things like RealTerm have an ASCII, ANSI and HEX mode

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TH.16.336
TH.16.336Author
Associate III
January 28, 2020

Yes it was printing in hex. I am using real term.

when I switched to ASCII mode, the issue resolved. It was feeding the new line.

Thanks for the reply.

Andrew Neil
Super User
January 27, 2020

As already asked, what "terminal" are you using?

What happens if you connect two instances of that terminal together (via a "null modem") ?

If you get the same behaviour (LF printing as "0A" instead of doing a line-feed) with that - then it's clearly an issue with your terminal, not the Nucleo!

Note that LF = Line Feed, and CR = Carriage Return - you may need both to get a new line ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
TH.16.336
TH.16.336Author
Associate III
January 28, 2020

Yes it was printing in hex. I am using real term.

when I switched to ASCII mode, the issue resolved. It was feeding the new line.

Thanks for the reply.