cancel
Showing results for 
Search instead for 
Did you mean: 

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

TH.16.336
Associate III

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.

9 REPLIES 9
Uwe Bonnes
Principal II

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

Your question makes sense, in my view.

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

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 Venmo Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist

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 ...

Hi Bonnes,

Yes it was printing in hex. when I switched to ASCII mode, the issue resolved. It was feeding the new line.

Thanks for the reply.

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.

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.

As informed, it's working in ASCII mode.

But the terminal evening printing the ASCII char of that value like LF or CR and then feeding a new line.

Is there any way to avoid printing it on terminal and just feed new line?

So this is a terminal configuration issue - nothing to do with the STM32 or Nucleo.

You need to correctly configure the terminal - RTFM for details.