NVIDIA Tegra
NVIDIA Tegra Linux Driver Package

Development Guide
32.1 Release


 
Flashing and Booting the Target Device
 
Before You Begin
Flashing a Specific Partition
Increasing Internal Memory Partition for Root File System
Determining the Success of a Driver Update
Use the flash.sh helper script to flash the board with the bootloader and kernel, and optionally, flash the root file system to internal eMMC.
Before You Begin
The following directories must be present:
bootloader—bootloader plus flashing tools, such as NvFlash, CFG, BCT, etc.
kernel—a kernel Image /vmlinux.uimg, DTB files, and kernel modules
rootfs—the root file system that you download
This directory starts empty and you populate it with the sample file system.
nv_tegra—NVIDIA® Tegra® user space binaries and sample applications
Additionally, before running these commands, you must have the USB cable connected to the recovery port.
To flash using a USB
Use the USB device mode default configuration script and associated README that describes how the USB flashing port operates in device mode.
For details, see Quick Install Guide.
To flash the bootloader and kernel
1. Put the target into reset/recovery mode.
Power on the carrier board and hold the RECOVERY button.
Then press the RESET button.
2. Run the flash.sh script that is in the top-level directory of this release. The script must be supplied with the target board (jetson-xavier) for the root file system:
sudo ./flash.sh <platform> <rootdev>
Where <rootdev> depends on where the root file system is located:
For a root file system on the NVIDIA® Jetson AGX Xavier™ module’s internal eMMC, execute the script as follows:
sudo ./flash.sh jetson-xavier mmcblk0p1
To RAM boot to NFS
1. Put the device into reset/recovery mode.
Power on the carrier board and hold the RECOVERY button.
Then press the RESET button.
2. Execute the command:
sudo ./flash.sh -N <ip-addr-of-linux-host>:/<path-to-NFS-rootfs> --rcm-boot jetson-xavier eth0
Flash Script Usage
Locate the most up-to-date usage information by running flash.sh -h (using the flash.sh script included in the release). The basic usage is as follows.
sudo ./flash.sh [options] <platform> <rootdev>
Specify the required parameters and one or more of the options.
Flashing to a Flash Drive
The Jetson AGX Xavier platform (target device) can be booted from a USB device with mass storage class and bulk only protocol, such as a flash drive. Hot plugging is not supported; the flash drive must be attached before the device is booted.
This procedure uses CBoot, and flashes only the kernel and kernel DTB to the USB device. The kernel uses the file system in the target device’s internal eMMC. The target device must be flashed at least once before the procedure is performed to ensure that the file system is available.
To set up a flash drive for booting
1. Connect the USB stick to host computer.
2. Check the USB device’s device name (e.g. /dev/sdb, /dev/sdd, or /dev/sdc):
sudo lshw -quiet -short -c disk
3. Create a new GPT.
sudo parted /dev/sdb mklabel gpt
If the device name is /dev/sdb. The device name fetches it at runtime.
4. Add the kernel partition and allocate 64 MB to it:
sudo parted /dev/sdb mkpart kernel 0MB 64MB
5. Add the kernel-dtb partition and allocate 1 MB to it:
sudo parted /dev/sdb mkpart kernel-dtb 64MB 65MB
6. Print the start, end, and size in sectors of the partitions:
sudo parted /dev/sdb unit s print
7. Write the kernel image to the kernel partition:
sudo dd if=bootloader/boot.img of=<dn>1
8. Write the kernel-dtb image to the kernel-dtb partition:
sudo dd if=bootloader/<dtbname> of=<dn>2
In this procedure:
<dn> is the device name of the USB device, e.g. /dev/sdb.
<dtbname> is the filename of the .dtb file. For the Jetson AGX Xavier it is:
tegra194-p2888-0001-p2822-0000.dtb
Preparing Files to Boot from a Flash Drive with Secure Boot Implemented
With Secure Boot implemented, both boot.img and tegra194-p2888-0001-p2822-0000.dtb must be signed and encrypted if they are to be used on a system that is booted from a flash drive (USB or SD Card) or from TFTPboot.
Enter these commands to generate signed, encrypted files:
For boot.img:
sudo ./flash.sh --no-flash -k kernel jetson-xavier mmcblk0p1
For the .dtb file:
sudo ./flash.sh --no-flash -k kernel-dtb jetson-xavier mmcblk0p1
Flashing a Specific Partition
You can flash a specific partition instead of flashing the whole device by using the comand line switch ‑k.
To flash a specific partition
Enter the command:
sudo ./flash.sh -k <partition_name> [--image <image_name>] <platform> <rootdev>
Where:
<partition_name> is the name of the partition to be flashed. Possible values depend on the target device. For details, see the section Default Partition Overview in the topic Bootloader.
<image_name> is the name of the image file. If omitted, flash.sh chooses the image file that was used to flash whole device.
<platform> is:
For Jetson Nano: jetson-nano-qspi-sd
For Jetson AGX Xavier: jetson-xavier
For Jetson TX2: jetson-tx2
<rootdev> is the device name of the root file system, for example emmcblk0p1.
Examples
To flash the kernel on Jetson AGX Xavier using the default file <L4T>/kernel/Image:
sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1
To flash mb1 bct on Jetson AGX Xavier using a predefined list of configuration files:
sudo ./flash.sh -k MB1_BCT jetson-xavier mmcblk0p1
To flash the kernel on Jetson TX2 using a user-specified image file <user_path>/Image:
sudo ./flash.sh -k kernel --image <user_path>/Image jetson-tx2 mmcblk0p1
Increasing Internal Memory Partition for Root File System
The suggested rootfs partition size for the Jetson AGX Xavier platform is 15 gigabytes (GB). It is specified by default in the <target_board>.conf file used by the flash.sh script.
Use the -S <size-in-bytes> argument to flash.sh to change the partition size.
To flash for a larger partition
Execute the following command:
$ sudo ./flash.sh -S <size> <platform> <rootdev>
Where:
<size> is the desired size for the partition, such as 8589934592 (or 8 GiB) for 8 GB, if you want to decrease the size of the partition.
<rootdev> is the rootfs partition internal memory, for example mmcblk0p1.
Determining the Success of a Driver Update
After updating drivers on a target board, verify that the update completed successfully. You can determine the success or failure of a driver update by using the following commands.
To determine the success of a driver update
Execute the following command on a booted target device:
$ sha1sum -c /etc/nv_tegra_release
If the driver update succeeded, the output displays the word OK after the file name. A typical success message looks like this:
/usr/lib/xorg/modules/drivers/nvidia_drv.so: OK
The driver update fails if the file is missing. A typical error message looks like this:
sha1sum: /usr/lib/xorg/modules/drivers/nvidia_drv.so: No such file or directory
/usr/lib/xorg/modules/drivers/nvidia_drv.so: FAILED open or read
The driver update also fails if the new file is different from the existing file, producing an error such as:
/usr/lib/xorg/modules/drivers/nvidia_drv.so: FAILED