JetsonHacks

Developing on NVIDIA® Jetson™ for AI on the Edge

Jetson Nano Style – Serial Console

A Serial Debug Console is a useful tool for embedded development, remote access, and those times when the development kit has issues that you need to observe. Looky here:

Note: April, 2020 – Article and video update to include Jetson Nano B01.

Note: July, 2021 – Article and video update to include Jetson Nano B01, Jetson Nano 2GB and Jetson Xavier NX.

Background

The story of serial data transfer over wires goes back almost a hundred years. I’ve heard stories that Ferdinand Magellan first discovered a serial cable on his journeys, but lost it to the great tangle in the battle of Mactan in 1521. Apparently it was later rediscovered in America where teletypewriters used serial communication technology over telegraph wires, the first patents around stop/start method of synchronization over wires being granted around 1916. 

Note: July, 2021 – With the introduction of the Jetson Nano B01, subsequent Jetson Nano form factor devices (currently the Jetson Nano, Jetson Nano 2GB, and Jetson Xavier NX) use a common header layout and location for the serial debug console. The header is located underneath the compute module. In this article, we may refer to this header as the “Jetson Nano header” or J50.

Serial communication in the computer industry is ubiquitous, in this case we are going to connect a PC up to the Jetson Nano Style Developer Kit via a UART. This UART is the serial console on the Jetson Nano which allows direct access to the serial and debug console. Quite a handy thing to have when the going gets hardcore.

In addition to providing the typical console, the serial console is useful in many other situations. This includes the ability to choose menu entries for different boot Images (Linux kernel images), as well accessing a Nano that does not have a keyboard, mouse, networking or display.

Installation

Because the Nano communicates over a basic serial cable, almost any computer with serial terminal software can communicate with the Jetson. There are a wide range and variety of software terminal emulators out there. In this video, a laptop running Ubuntu and the program Minicom is shown. Other platforms and software programs can be used including Windows and Macintosh boxen.

The Jetson Nano headers use TTL logic. While there are various ways to interface with it, we chose to convert the signal to USB. In the video, we use an Adafruit USB to TTL Serial Cable – Debug / Console Cable [954] available from Amazon.

There are a wide variety of offerings for these types of cable. The products fall in two camps. The first camp uses FTDI chips for TTL to USB conversion, the second camp uses PL2303HX chips. The Adafruit cable is in the latter camp. One thing to keep in mind is that a driver for the appropriate chip may be required for the cable to work correctly with your particular operating system. The driver for the PL2303HX was already installed on the machine being used in the demonstration.

Wiring

There are two versions of the Jetson Nano. The newer version can be identified by the two CSI camera connectors. This is version B01. The earlier version, A02, had only one connector.

The wiring is straightforward. Before starting, make sure that there is no power to the Jetson. Wire the cable according to your Jetson Nano style version:

Jetson Nano B01, Jetson Nano 2GB, Jetson Xavier Nx

The serial debug console is available on the J50 header on the Jetson Nano. The J50 header is located on the edge of the carrier board opposite the I/O connectors. The connector is underneath the Jetson module, directly below the SD Card reader.

Jetson Nano J50 Pin 4 (TXD) → Cable RXD (White Wire)
Jetson Nano J50 Pin 3 (RXD) → Cable TXD (Green Wire)
Jetson Nano J50 Pin 7 (GND) → Cable GND (Black Wire)

The Jetson Nano J50 pins are also silkscreened on the underside of the board. Here’s what it should look like:

Jetson Nano A02

The serial debug console is available on the J44 header on the Jetson Nano. Connect the serial cable:

Jetson Nano J44 Pin 2 (TXD) → Cable RXD (White Wire)
Jetson Nano J44 Pin 3 (RXD) → Cable TXD (Green Wire)
Jetson Nano J44 Pin 6 (GND) → Cable GND (Black Wire)

The Jetson Nano J44 pins are also silkscreened on the underside of the board. Here’s what it should look like:

Software

Before you can connect with a serial terminal application on the other computer, you will need to determine the port to which the Jetson Nano connects. This is dependent on the computer you are using.

In the video on the Ubuntu PC, we open a new Terminal and:

$ dmesg −−follow

Next, plug in the Serial Cable. You will see a driver assign the cable a port number. In the video, the cable is ttyUSB0.

In the video, we use the Minicom application. Other programs/platforms should be similar. We’ll cover the video walkthrough. Install Minicom:

$ sudo apt-get install minicom

To start Minicom:

$ sudo minicom

The ‘sudo’ is used because of serial port permissions. You’re then ready to configure the Settings to communicate with the Jetson Nano.

Settings

An important part of serial communication is settings that are used to communicate between the devices. Rather than go through a lengthy discussion of each setting and it’s meaning, let’s distill it into the settings themselves.

First set the device, in the video the device was ‘/dev/ttyUSB0‘.

Connection speed is 115200, with 8 bits, no parity, and 1 stop bit (115200 8N1). For these three wire cables, the correct setting is software control, no hardware control. If you choose a 5 wire setup with RTS and CTS lines, then select hardware control, and no software control.

In Minicom, Ctrl A Z brings up the main menu. Select the ‘cOnfigure Minicom’ menu item, enter the settings, and make sure that you save the configuration as described in the video. After that task is complete, exit Minicom and restart to have the settings take effect.

$ sudo minicom

Now power on the Jetson Nano, at which point you will see the kernel log starting to scroll on the Minicom window on the host.

There are a wide variety of ways to interact with the Nano through the serial console, one of the more useful tips is to interrupt the startup process with a keystroke to be able to interact with the bootloader.

You can also choose different kernels during this process when they are present. If you do not interrupt the process with a keystroke, the Nano will boot and you will be at a Terminal prompt.

Conclusion

The Serial Console is a useful tool to help debug the startup sequence, load different Linux kernels, or simply act as a headless console. All it takes is a cable, and you can talk to your Jetson Nano!

Note

July, 2021

  • Article update to include Jetson Nano 2GB, Jetson Xavier NX

April, 2020

  • Article update to include Jetson Nano B01


Facebook
Twitter
LinkedIn
Reddit
Email
Print

18 Responses

  1. Thank you for your article. Serial console works fine, but I’m unable to get /dev/ttyTHS1 to work on pin header J41 (TX pin 8 to white) and (RX pin 10 to green).

  2. Ok so I see that pins 8 and 10 are running at 1.8V so they’ll need level shifting. But I don’t see any exposed 1.8V pin that I can use as a reference for a level shifter.

  3. After following the entire procedure and exactly doing as instructe, when i supplied power it dint boot up. Can you help me with that?

  4. I do not own a jetson yet. So can you please confirm that the boot loader (grub or whatever) and the OS have the correct settings in place for the serial console to just work?

    In RHEL this would be something like:
    grub.cfg:
    GRUB_SERIAL_COMMAND=”serial –speed=115200″
    GRUB_CMDLINE_LINUX=”panic=15 unit=0 word=8 parity=no stop=1 console=ttyS0,115200n8″

    and adding ttyS0 to /etc/securetty.

    Thanks,
    Oliver

  5. Very informative! With serial cable for debugging and launching programs that is quite convenient. Just one question. Does Jetson board support a second UART that I can connect another TTL-USB? I want to keep ttyUSB0 as console (to launch program and debugging) but another ttyUSB1 to run a customized serial communication program between PC and Jetson. If not, then I’d have to use the same ttyUSB0 to launch a server side program in Jetson, turn off Minicomm, and launch the client program from PC. Thanks.

      1. I downloaded the latest SD card image which is JP 4.4, and it seems the serial console doesn’t work well. The initial boot will hung there when the console prompts “click OK for initial configuration” and it won’t go through any initial setup like user, language, timezone, network, etc.

        Later I found that the serial console works just fine with image JP 4.2.3 (I didn’t test image 4.3 yet) and it is able to walk me through the initial configuration w/o any issues.

        By looking at the actual image file name in JP 4.4, it shows sd-blob-b01.img, so I wonder maybe the image is for board B01 while I’m using board A02. I’ll try out JP 4.4 again when I have a B01 board available.

Leave a Reply

Your email address will not be published. Required fields are marked *

Disclaimer

Some links here are affiliate links. If you purchase through these links I will receive a small commission at no additional cost to you. As an Amazon Associate, I earn from qualifying purchases.

Books, Ideas & Other Curiosities