How to feed New Line ('\n') from my Nucleo-F44rZE board to PC terminal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 4:02 AM
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.
- Labels:
-
STM32F4 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 4:13 AM
Is your terminal printing in hex and not interpreting the ascii meaning of a character?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 6:23 AM
Your question makes sense, in my view.
@TH.16.336​ What happens if you send other data values (0x31 => "1" or 0x42 => "B") ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 7:42 AM
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
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 9:46 AM
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 designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 10:08 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 10:10 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 10:10 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-27 11:06 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-28 12:55 AM
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.
A complex system designed from scratch never works and cannot be patched up to make it work.
