Skip to content

Flashing the Jetson Dev Kit

Jozef Šiška edited this page Sep 17, 2020 · 32 revisions

This total-beginner's guide will walk you through the process of flashing a newly-generated image your Jetson development kit! This is supported on all of the Jetson development kits -- TK1, TX1, TX2, Nano, AGX Xavier, and Xavier NX.

  • If you're using a branch based off an older version of L4T (anything older than L4T R32.3.1), you'll need to generate your image with some extra settings. Add the following lines to the local.conf in your build directory:

      IMAGE_CLASSES += "image_types_tegra"               
      IMAGE_FSTYPES = "tegraflash"
    

    If you're using a branch based of L4T R32.3.1 or later, those settings are included in the machine configuration files, so no modification to your local.conf file is required.

    This will generate an additional flashing script along with the image that we'll use to program the bootloader, rootfs, and other necessary artifacts to the Jetson's on-board eMMC (or boot flash and SDcard, for Nano SKU 0000). While you're generating the image with these new settings, feel free to continue on to the next step (or go get a soda or something).

  • Bitbake should have now made a new zip file or compressed tar archive (depending on which branch/version youare building) called <image-type>-${MACHINE}.tegraflash.zip or <image-type>-${MACHINE}.tegraflash.tar.gz in the image output directory (tmp/deploy/images/${MACHINE}). Extract this to somewhere else that's convenient. The package includes copies of the necessary tools for flashing the device, as well as the image and bootloader files that will be put there. NOTE that some users have reported problems using graphical file management tools to unpack the tegraflash.tar.gz files, resulting in unreadable rootfs partitions, so you should use command-line tar.

  • (Pre-L4T R32.3.1) For the Jetson Nano development kit (module SKU 0000 with QSPI flash and SDcard), you will also need the SDcard image: <image-type>-${MACHINE}.sdcard. Copy that image onto an SDcard directly from you development machine with dd if=<image-name> of=/dev/<sdcard-device> bs=1M conv=fsync. You may need to use sudo for this. The default SDcard image size is 16GiB, so this could take a few minutes. Once done, properly eject the SDcard from your host and insert it into the slot on the underside of the Nano module.

  • (L4T R32.3.1 and later) For the Jetson Nano development kit (module SKU 0000 with QSPI flash and SDcard), you should insert an SDcard into your device before flashing.

  • Now, make sure the board is plugged in and powered on before continuing.

  • Plug a micro-USB cable into the board's USB0 port and connect it to your host machine. For Jetson Xavier AGX development kits, use the USB-C connector on the board.

  • On your board, while holding the recovery button (REC), press reset (RST) to boot into recovery mode. You'll see the lights briefly flash off and on. You may need to hold the REC button down for at least three seconds after releasing RST to have the device fully switch to recovery mode. For the Nano carrier board, unless you have connected buttons to the header pins, use a jumper (REC to GND) to put the device into recovery mode when the device is powered on.

  • Now, simply sudo ./doflash.sh, wait for it to do its thing, and voila! The script will cold-reboot the Jetson, and you've got a hot new image flashed!

    • Note: Depending on your python configuration, you may need to modify the second line of doflash.sh from something like tegraflash.py --bl cboot.bin... to python tegraflash.py --bl cboot.bin...
  • (L4T R32.3.1 and later) For the Jetson Nano development kit with module SKU 0000 (MACHINE jetson-nano-qspi-sd), the tegraflash package also includes a dosdcard.sh script that you can use to format an SDcard image or write to an SDcard inserted into a card reader/writer on you host system directly. However, you should flash the device via USB at least once (with the SDcard inserted) to ensure that the QSPI flash has been updated with the current bootloader.

Flashing without root access

To avoid having to use sudo or be root to program the Jetson flash, add some udev rules to put the USB interface into a group that you belong to. For example:

# Jetson TK1
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7140", GROUP="plugdev"
# Jetson TX1
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7721", GROUP="plugdev"
# Jetson TX2
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7c18", GROUP="plugdev"
# Jetson TX2i
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7018", GROUP="plugdev"
# Jetson TX2-4GB
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7418", GROUP="plugdev"
# Jetson AGX Xavier
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7019", GROUP="plugdev"
# Jetson Xavier NX
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7e19", GROUP="plugdev"
# Jetson Nano
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7f21", GROUP="plugdev"

Add these rules to a file under /etc/udev/rules.d on your development host, then reboot or restart udev (or systemd-udevd) to have them take effect.

Clone this wiki locally