Set up usual uart

Hi all, I have a task with solution I can’t find.

I need serial 9-bit 9600 baud uart support on jetson tk1. I’ve found UART2_RXD & UART2_TXD on J3A2 and want to use them with this aim.

So, I have a questions:

  1. How can I add thi UART to kernel?
  2. How can I use it? Is there any example in C, Python, Ruby, et.c.?

Regards,
Alex

Bump!

Bumping after 19 hours on Saturday is a bit hasty.

What’s the logic level voltage you need? Do you have a level shifter? I think the Jetson’s UART is 1.8V.

If your logic levels match, then I think you can try using one of the /dev/ttyTHSx devices. I don’t know which one (if any) matches the pins you mentioned though. Checking the schematics and the pinmux should clarify that.

I’m using UART RX/TX 0 which is mapped to /dev/ttyTHS0. I’m guessing RX/TX 2 is mapped to /dev/ttyTHS2. I didn’t have to add anything to the kernel (using Grinch 21.2.1).
Using it is really straight forward. You can easily find an example for any language, and it should work just by replacing the path to ttyTHx.
Check termios.h manual page if you’re looking to work in C.

ok, I’ll bump after bigger interval next time.

I need 5v, but I have an octocoupler.

I’ve tried an /dev/ttyTHS2, but it have a voltage on both when serial port on /dev/ttyTHS2 is running and not.

Have you solved how to use UART2?

There are two UARTs accessible via J3A2, UART1 and UART2.
UART1 is accessible via /dev/ttyTHS0
UART2 is accessible via /dev/ttyTHS1.

Both UART1 and UART2 use 1.8V logic.

Here’s some code in a related thread that should help to get started:
https://devtalk.nvidia.com/default/topic/793384/tegra-k1-jetson-uart-on-expansion-header-does-not-work/#4608889, but change the port to /dev/ttyTHS1.

You can see a smashing video of the the UART in action (along with level shifting) here:

This thread has been open for a long time, unfortunately I just got around to playing with the UARTs. I’m sure the posters have long since solved the problem and moved on, this answer is here informational purposes.