NVIDIA Tegra
NVIDIA Tegra Linux Driver Package

Development Guide
28.1 Release


 
Flashing and Booting the Target Device
 
Before You Begin
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 boot loader and kernel, and optionally, flash the root file system to internal eMMC.
Before You Begin
The following directories must be present:
bootloader—boot loader 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 the boot loader 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-tx2, or jetson-tx1) for the root file system:
sudo ./flash.sh <platform> <rootdev>
Where <rootdev> depends on where the root file system is located:
If the root file system will be on the Jetson TX2 internal eMMC, execute the script as follows:
sudo ./flash.sh jetson-tx2 mmcblk0p1
If the root file system will be on a USB disk, execute the script as follows:
sudo ./flash.sh jetson-tx2 sda1
- If an mSATA device is connected, that device enumerates as sda1.
If the root file system will be on an SD card, execute the script as follows:
sudo ./flash.sh jetson-tx2 mmcblk1p1
To clone TX1/TX2 and flash
1. Read system.img from the gold board filesystem partition with the following command:
For TX2:
sudo ./flash.sh -r -k APP -G clone.img jetson-tx2 mmcblk0p1
For TX1:
sudo ./flash.sh -r -k APP -G clone.img jetson-tx1 mmcblk0p1
This creates a clone.img and clone.img.raw in the <top> directory.
2. If a new board has been flashed with default release images, use the following commands to flash the file system with the gold board image:
Copy clone.img to the <L4T>/bootloader/system.img directory with the following command:
sudo cp clone.img bootloader/system.img
Flash the clone image to the APP partition with the following command:
For TX2:
sudo ./flash.sh -r -k APP jetson-tx2 mmcblk0p1
For TX1:
sudo ./flash.sh -r -k APP jetson-tx1 mmcblk0p1
3. Opitonally, instead of Step 2, flash the new board with all default release images except the file system image from the gold board with the following commands:
Copy clone.img to the <L4T>/bootloader/system.img directory with the following command:
sudo cp clone.img bootloader/system.img
Flash the new board with the following command:
For TX2:
sudo ./flash.sh -r jetson-tx2 mmcblk0p1
For TX1:
sudo ./flash.sh -r jetson-tx1 mmcblk0p1
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 in the following table.
Parameters
Description
<platform>
Is the <platform> for your release.
<rootdev>
Is one of following:
 
mmcblk0p1
Specifies internal eMMC.
mmcblk1p1
Specifies external SDCARD.
sda1
Specifies external USB device (such as, USB memory stick or HDD).
eth0
Specifies nfsroot via external USB Ethernet interface.
Options
Description
-h
Specifies to print this usage information.
-b <bct_file>
Specifies the NvFlash Boot Configuration Table (BCT) file.
-c <cfg_file>
Specifies the NvFlash configuration file.
-d <dtb_file>
Optionally specifies a device tree file to use instead of the default.
-e <emmc_file>
Specifies the eMMC size of the target device.
-f <flashapp>
Specifies the path to flash application: nvflash or tegra-rcm.
-i
Specifies to pass the user kernel command line to the kernel as-is.
-k <partition id>
Specifies the kernel partition ID to be updated (minimum = 5).
-n <nfs args>
Specifies the static NFS network assignments:
<Client IP>:<Server IP>:<Gateway IP>:<Netmask>
-o <odmdata>
Specifies the ODM data value.
-p
Total eMMC HW boot partition size.
-r
Specifies to skip building and reuse existing system.img.
-s <ubootscript>
Specifies the boot script file for U-Boot.
-C <cmdline>
Specifies the kernel command line. Warning: Each option in this kernel command-line gets higher precedence over the same option from fastboot. In case of NFS booting, this script adds NFS booting related arguments if the -i option is omitted.
-F <flasher>
Specifies the flash server, such as fastboot.bin.
-I <initrd>
Specifies initrd file. Null initrd is the default.
-K <kernel>
Specifies the kernel image, such as zImage.
-L <bootloader>
Specifies the full path to the boot loader, such as fastboot.bin or u-boot.bin.
-P <end_of_PPT_plus_1>
Specifies the sum of the primary GPT start address, the size of PPT, plus 1.
-R <rootfs_dir>
Specifies the sample rootfs directory.
-N <nfsroot>
Specifies the nfsroot, for example:
<my IP addr>:/my/exported/nfs/rootfs
-S <size>
Specifies the rootfs size in bytes. This is valid only for internal rootdev. KiB, MiB, GiB style shorthand is allowed. For example, 1GiB signifies 1024 * 1024 * 1024 bytes.
-T <ITS_file>
ITS file name. Valid only for u-boot.
Increasing Internal Memory Partition for Root File System
The suggested rootfs partition size for the Jetson TX2/TX1 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