NVIDIA Jetson Xavier - Flashing Board using JetPack 5.0.2

From RidgeRun Developer Wiki



Previous: JetPack 5.0.2‎/Compiling_Code Index Next: JetPack_5.0.2/Performance_Tuning








This section provides a guide to flashing the Jetson Xavier OS components from the host computer command line. Flashing is the process of copying the files required into the selected storage from which the Xavier is going to boot. In the flashing process, we use the host computer and the Xavier.


This section assumes that you already have followed through our Getting Started and Installing Jetpack sections.


Assumptions

  1. You have Jetpack 5.0.2 installed on your host computer in the default path ($HOME/nvidia/nvidia_sdk/JetPack_5.0.2_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra). If your Jetpack installation used a different path, make sure to modify accordingly the JETPACK environment variable in Step 1.
  1. The OS components to be installed in the Xavier are stored in the default locations expected by the Jetpack flash script. If you haven't modified your Jetpack directory or if you followed our Compiling Code Section, then the files should be in the default locations. If you have the files stored in a custom location, make sure to use the appropriate flags to indicate to the flash script the paths to the kernel, dtb, and bootloader.

Step 1: Define the Environment Variables

Make sure to run the following commands in the terminal that you will use to flash the Xavier.


export JETPACK=$HOME/nvidia/nvidia_sdk/JetPack_5.0.2_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra

Step 2: Set Board in Recovery Mode

In order to flash the Xavier, we must set it in recovery mode so that it can accept the files. The procedure to put the Xavier in recovery mode can be found on the SDK manager, just ignore step 1.

Start Installation
Start Installation
Figure 1. Put Device in Recovery Mode


At this point, Xavier should be in recovery mode. To verify, you can run the following command on your host computer:

lsusb

If the Xavier is in recovery mode, you should see a line similar to the following among the command output:

Bus 003 Device 015: ID 0955:7e19 NVIDIA Corp.


Step 3 (Optional): Create a Default User

The default user/password can be configured after flashing if you can connect a display, keyboard, and mouse to the Xavier to complete the OEM configuration during the first boot. If you wish to save time and create a default user/password for your Xavier before flashing, you can execute the commands below, make sure to replace <user_name> and <password> for a username and password of your choice.


 cd $JETPACK/tools
 sudo ./l4t_create_default_user.sh -u <user_name> -p <password>

Step 4: Execute the Flash Script

NVIDIA provides a script for flashing the Xavier in the Jetpack directory. This script takes two arguments, the target board, and the root device:


cd $JETPACK
sudo ./flash.sh <target board> <rootdev>


To see the possible options of the target board go to the Linux_for_Tegra folder and check the *.conf names, some examples are:

  • jetson-xavier-nx-devkit
  • jetson-xavier-nx-devkit-emmc
  • jetson-xavier-nx-devkit-qspi

In the following subsections, we are going to use the jetson-xavier-nx-devkit configuration to flash the Xavier.


The root device indicates the storage that will be used to boot the Xavier, some available options are:

  • internal
  • external
  • mmcblk0p1
  • mmcblk1p1

You can read the description for each of these in the flash.sh code.


The following subsections show the command to flash each of the storage options available.

Option #1: eMMC

This option is the most simple, just execute the following commands:

cd $JETPACK
sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1


The flashing process will take a while, and should print a success message if the flash is finished successfully. After the flash script finishes successfully, the Xavier will boot automatically.




Previous: JetPack 5.0.2‎/Compiling_Code Index Next: JetPack_5.0.2/Performance_Tuning