Nvidia Jetson

Flashing Jetson Device

Access reference

Pre-requisites

Power up the Jetson device and attach a USB-C to USB-C cable to the computer that will be doing the flashing (preferably a Linux system).

Boot the device in forced-recovery mode:

In a Jetson AGX Orin

Assuming the buttons are:

To set device to force recovery mode:

  1. Press and hold "Force Recovery Button"
  2. Plug in the device to power OR Press and release "Power Button"
  3. Wait 2 seconds
  4. Release "Force Recovery Button"

Environment Variables

Your host system must be configured to set certain environment variables:

The files can be downloaded from: here.

Flashing Process

Extract and Install Pre-requisites

tar xf ${L4T_RELEASE_PACKAGE}
sudo tar xpf ${SAMPLE_FS_PACKAGE} -C Linux_for_Tegra/rootfs/
cd Linux_for_Tegra/
sudo ./apply_binaries.sh
sudo ./tools/l4t_flash_prerequisites.sh

Ensure that your Jetson developer kit is configured and connected to your Linux host.

Put your Jetson developer kit into Force Recovery Mode.

Flashing Commands

Jetson Orin Nano Developer Kit and Jetson Orin NX Developer Kit (NVMe)

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal

Jetson Orin Nano Developer Kit and Jetson Orin NX Developer Kit (USB)

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device sda1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal

Jetson Orin Nano Developer Kit and Jetson Orin NX Developer Kit(SD)

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device mmcblk1p1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal

Jetson AGX Orin Developer Kit

sudo ./flash.sh jetson-agx-orin-devkit internal

Jetson AGX Xavier Developer Kit

sudo ./flash.sh jetson-agx-xavier-devkit internal

Jetson Xavier NX Developer Kit (SD card)

sudo ./flash.sh jetson-xavier-nx-devkit internal

Post-Flashing

Restart the device and connect to it over screen. And then continue thorugh the post-installation process on the TUI.

screen /dev/ttyACM0 115200

Setting Boot to NVMe instead of Internal Storage

In some cases, you may have an additional NVMe SSD included in the device that you want to use as the boot drive.

The process is easy to do after initial flashing and set-up.

Prepare the SSD

First, ensure that the SSD is properly formatted and partitioned. You can use the gdisk or fdisk command to partition the SSD, followed by formatting it with mkfs.ext4 (assuming you're using an ext4 filesystem).

sudo mkfs.ext4 /dev/nvme0n1

Mount the SSD

Create a mount point for the SSD:

sudo mkdir /mnt/ssd

Mount the SSD temporarily:

sudo mount /dev/nvme0n1 /mnt/ssd

Transfer the Root Filesystem

If the goal is to boot directly from the SSD, transfer the root filesystem from the internal storage to the SSD.

You can use rsync to copy all files while preserving permissions:

sudo rsync -axHAX / /mnt/ssd

After copying, ensure that /mnt/ssd/etc/fstab has entries for the new root filesystem (you can update it using the UUID of the SSD partition using the blkid command).

Identify the UUID of the SSD Partition

Use the blkid command to find the UUID of the SSD partition where you transferred the root filesystem. This command lists all block devices and their corresponding UUIDs.

sudo blkid

Look for the entry corresponding to your SSD partition (e.g., /dev/nvme0n1p1), and note the UUID.

Example output:

/dev/nvme0n1p1: UUID="1234abcd-12ab-34cd-56ef-1234567890ab" TYPE="ext4"

Edit /mnt/ssd/etc/fstab

Open the fstab file located in /mnt/ssd/etc/fstab with your preferred text editor. This file defines how disk partitions are mounted at boot.

sudo nano /mnt/ssd/etc/fstab

Update the Root Filesystem Entry

Find the line in the fstab file corresponding to the root filesystem (/). Replace the current device identifier (which might be something like /dev/mmcblk0p1 or /dev/sda1) with the UUID of the SSD partition.

Example: Before:

/dev/mmcblk0p1  /  ext4  defaults  0  1

After:

UUID=1234abcd-12ab-34cd-56ef-1234567890ab  /  ext4  defaults  0  1

Update Boot Configuration

To boot from the SSD, modify the bootloader configuration. This step can vary depending on your Orin's bootloader configuration.

The boot configuration is typically located in /boot/extlinux/extlinux.conf. You can edit this file and change the root= parameter to point to the new SSD partition (e.g., /dev/nvme0n1p1).

Example:

label primary
menu label primary kernel
linux /boot/Image
initrd /boot/initrd
append root=/dev/nvme0n1p1 rw rootwait
# append root=UUID=<uuid> rw rootwait

If the bootloader supports UUID, you can use UUID=<uuid> instead of the /dev/nvme0n1p1.

Reboot and Test

After editing the fstab, reboot the system and ensure it is now booting from the SSD as the root filesystem.

sudo reboot

Once booted, you can confirm that the root filesystem is mounted from the SSD:

df -h /

This should show the root filesystem as mounted on /dev/nvme0n1p1 or whichever SSD partition you used.