I am currently working on debugging a serial connection between a Jetson Orin Nano, and some custom microchip.
To make it very simple - I am doing this:
1.)
stty -F /dev/ttyTHS0 115200 -parity cs8 -cstopb
while true; do
echo -e "#something#something/r/n" >> /dev/ttyTHS0
sleep 1
done
2.) echoing what is coming in on ser.µC.RX to ser.µC.TX.
3. ) Trying to read the answer with cat < /dev/ttyTHS0 - not getting anything.
So I did a little bit of research - finding, that the ttyTHS0 seems to have DMA.
→ [A] so I am wondering - does the good old way of echo and cat work on DMA-UARTs?
[B] Is there a way, to just use ttyS0 (any interaction of mine with it causes an Input/output error so far)?
What do you mean about custom microchip?
Do you mean that you setup the serial communication from Orin Nano devkit with other microchip?
Yes: [[Jetson Orin Nano Module] Devkit]<{UART0-RTxD}>[µController]
It seems you are verifying with loopback test.
Basically - yes. The µC reads and responds with the same packages.
Do you connect the TX/RX of UART1?
No - UART0. Pin 22 and Pin 32 on the DevKIT.
We figured out, that we had a problem with our ground-connection between the devices, and therefore my question [A] is solved (yes, echo and cat work for debugging basic functionality).
Regarding question [B]:
Looking for /dev/ttyS0 in the forum gave some answers - simplest one for me was this:
If you are talking about /dev/ttyTHS0, it should be UART1.
The UART0 is from the M.2 Key E.
You could refer to the following thread about the mapping for UART interface for Orin Nano devkit. OrinNX : How to check UART is working? - #3 by KevinFFF
Could you help to confirm which UART do you want to use?
/dev/ttyS0 would use 8250 driver.
May I know what’s your use case?
make the debug message output from UART1 (uarta@3100000)?