<CR> is replaced with <LF> on Apalis Ixora

I’m using Apalis-Ixora board for RS232 communications. I choose apalis-uart2.
Connected device to a Laptop with Docklight for sending some commands.
From docklight I sent
abcdefghijklmnopqrstuvwxyz\r\n.

And did cat /dev/apalis-uart2 | od -A n -t x1 on the apalis terminal.
This is what I received in terminal, when sending commands from Docklight.
image

On every I expected to get 0x0D, but here it is `0x0A’.

I tried by C code too, same result…

Greetings @kkabh,

The issue here might be due to the default settings of the UART interface. Using stty -a one can see the settings and configurations for a UART interface. Running this locally on the module I see:

stty -a -F /dev/apalis-uart2
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0

You can map these settings to what they do via stty documentation like this: https://www.computerhope.com/unix/ustty.htm

But it seems there are settings that can translate CR to LF and vice versa. It even differs based on input and output sides. Perhaps playing around with these settings can help.

Best Regards,
Jeremias

Hi @kkabh,

Is this issue solved ? Kindly revert back if you still facing the issue.

Best Regards
Ritesh Kumar