JetsonHacks

Developing on NVIDIA® Jetson™ for AI on the Edge

Jetson Nano & NX Style – Serial Debug 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.

Note: May, 2023 – Article and video update to add Jetson Orin Nano.

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: May, 2023 – With the introduction of the Jetson Nano B01, subsequent Jetson Nano and NX form factor devices (currently the Jetson Nano, Jetson Nano 2GB, Jetson Xavier NX, and Jetson Orin Nano) 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, Jetson Orin Nano

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

May, 2023

  • Article update to include Jetson Orin Nano

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

24 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.

  6. Hi, my jetson nano dev kit not booting, simply black screen. I tried nvidia sdk flashing and manual flashing as well. still not working. I bought TTL-USB cable and connected to my ubuntu 18.04. it showed up under /dev/ttyUSB0. when try minicom or picocom, curser simply blinking, but not moving forward. could you please help me on this ?

    1. There are several possible things to check. First, has the Jetson worked previously? Second, does the green light come on when you apply power? If the green light is not on, that’s a major issue. The jumper must be present to tell the Jetson to boot from the power jack.

      Third, check the wiring on the TTL-USB cable to make sure that receive and transmit are correct. The receive on the cable goes to transmit on the Jetson, and the transmit on the cable goes to receive on the Jetson. Make sure that the ground is connected. Also, make sure that the power is NOT connected.

      Another thing to note is that you have the correct driver on the host to interface with the TTL-USB chip you are using. Typically this is a FTDI, PL2303, CP2102 or similar TTL to USB chip.

      Even when things are really messed up on the Jetson, you should get some type of output from the boot ROM sequence.

      1. Hi Kangalow, thank your for your response.

        First, has the Jetson worked previously?

        yes, it has worked perfectly fine. I just shutdown jetson normally. when i turned on again, it was not booting up. tried sdk and manual install.

        Second, does the green light come on when you apply power? If the green light is not on, that’s a major issue. The jumper must be present to tell the Jetson to boot from the power jack.

        the jumper is present and yes, the green light is on when powered up.

        Third, check the wiring on the TTL-USB cable to make sure that receive and transmit are correct. The receive on the cable goes to transmit on the Jetson, and the transmit on the cable goes to receive on the Jetson. Make sure that the ground is connected. Also, make sure that the power is NOT connected.

        I did the same.

        Another thing to note is that you have the correct driver on the host to interface with the TTL-USB chip you are using. Typically this is a FTDI, PL2303, CP2102 or similar TTL to USB chip.

        I’m using ubuntu 18.04, it idid detect the TTL-USB device as CP2102.

        minicom, not displaying anything when i connect it to power.

        logs are getting generated when i try to flash manually and using sdkmanager. can I share here the logs ?

  7. If it is any help for anyone, I have a forum issue with Nvidia re a Xavier NX that part flashed JP 5.2 latest but then won’t boot and won’t reflash.

    I setup the USB serial wiring for the NX which is same as Nano 2gb, e.g. under the cpu fan/heatsink with blue wire on third pin from left, white wire on 4th, then skipped 2 pins with black on the 7th from left.

    apt install picocom because I cannot get screen to save the output to a file.

    sudo usermod -aG dialout $USER

    logged completely out (just closing terminal is not enough)

    picocom -b 115200 /dev/TTYUSB0 –logfile my_log.txt

    Powered on the NX and when everything was done pressed Ctrl-A Ctrl-Q

    I now have the output for the nvidia forum, and am hoping there is a way to recover from a boot where it asks me on screen to accept the terms and conditions but the keyboard and mouse do not work at all.

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