Difference between revisions of "Xavier/JetPack 5.0.2/Flashing Board"

From RidgeRun Developer Connection
Jump to: navigation, search
(Step 2: Set Board in Recovery Mode)
(Step 2: Set Board in Recovery Mode)
Line 39: Line 39:
 
If the Xavier is in recovery mode, you should see a line similar to the following among the command output:
 
If the Xavier is in recovery mode, you should see a line similar to the following among the command output:
 
<pre>
 
<pre>
Bus 001 Device 011: ID 0955:7023 NVidia Corp
+
Bus 003 Device 015: ID 0955:7e19 NVIDIA Corp.
 
</pre>
 
</pre>
  

Revision as of 11:54, 23 August 2022



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



Nvidia-preferred-partner-badge-rgb-for-screen.png


This section provides a guide to flash 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 sdkmanager:

Start Installation
Figure 1. Put Device in Recovery Mode


At this point, the 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 Orin to complete the OEM configuration during the first boot. If you wish to save time and create a default user/password for your Orin 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 Orin in the Jetpack directory. This script takes two arguments, the target board, and the root device:


sudo ./flash.sh <target board> <rootdev>


There are four possible options of target board for the Orin AGX:

  • jetson-agx-orin-devkit: Recommended, this configuration is used for a Jetson AGX Orin SOM connected to the NVIDIA AGX Orin devkit.
  • jetson-agx-orin-devkit-as-jao-40w: This configuration is used to emulate a Jetson Orin NX 32GB module on a Jetson AGX Orin SOM connected to the NVIDIA AGX Orin devkit.
  • jetson-agx-orin-devkit-as-nx-16gb: This configuration is used to emulate a Jetson Orin NX 16GB module on a Jetson AGX Orin SOM connected to the NVIDIA AGX Orin devkit.
  • jetson-agx-orin-devkit-as-nx-8gb: This configuration is used to emulate a Jetson Orin NX 8GB module on a Jetson AGX Orin SOM connected to the NVIDIA AGX Orin devkit


In the following subsections, we are going to use the jetson-agx-orin-devkit configuration to flash the Orin.


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

  1. eMMC
  2. USB Drive
  3. NVMe



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-agx-orin-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 Orin will boot automatically.


Option #2: USB Drive

This option requires copying the OS components to the USB.


Prepare the USB Drive

First, you will need to identify the mount point of the USB Drive. To do so, you can run the following command before and after connecting the USB Drive to your host computer and identify the new line that appears:

mount

The mount command will print a list of block devices and the mountpoint. For example, in our case, the following line wasn't printed by mount before connecting the USB Drive but was printed by mount after the USB Drive was connected:

/dev/sdd1 on /media/$USER/bde7a526-1b2d-4ad3-925f-4650b2563ab7 type ext4 (rw,nosuid,nodev,relatime,uhelper=udisks2)

This indicates that the block device for the USB Drive is /dev/sdd1.

Now that the block device of the USB Drive has been identified, you can format the USB drive in your host computer using the commands below. Make sure to replace </dev/sdX> with your actual device.

umount </dev/sdX>
sudo mkfs.ext4 </dev/sdX>

At this point, you can proceed to copy the files to the USB drive. This can take a while because around 6GB need to be copied:

 cd $JETPACK
 sudo mkdir tmp_system
 sudo mount </dev/sddX> $JETPACK/tmp_system
 cd rootfs/
 sudo cp -a * $JETPACK/tmp_system && sync

When the copy finishes, you can proceed to umount the USB Drive with the following command:

sudo umount $JETPACK_DIR/tmp_system

At this point, you can disconnect the USB Drive.


Flash

Connect the USB Drive where you copied the files to the Jetson AGX Orin. Then, flash the board with the following commands:

 cd $JETPACK
 sudo ./flash.sh jetson-agx-orin-devkit sda1 #it can be another mount point


After the flash script finishes successfully, the Orin will boot automatically.


Known Issues

Display Port Graphical Interface

The board does not boot correctly or provide a graphical interface when a monitor is powered on and connected to the Display Port output during boot. It only shows the NVIDIA Logo before booting, and the BIOS interface if the Escape key is pressed. Running dmesg in the Orin AGX terminal and disconnecting/connecting the cable shows the following messages:

 [  299.546829] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call result 0xffff:
 [  309.799053] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call result 0x25:

To avoid this issue, make sure that the monitor is turned off when booting the Orin AGX. After it has booted, the monitor can be turned on and it should show a graphical interface.

USB Drive preparation for flashing

NVIDIA provides a guide for Flashing to a USB Drive in the following link:

Flashing to a USB Drive

However, after following the next commands:

 sudo mount bootloader/system.img.raw ./tmp_system
 sudo rsync -axHAWX --numeric-ids --info=progress2 --exclude=/proc ./tmp_system/ /mnt

The USB drive only has a directory name boot and does not have the filesystem. To avoid this issue, make sure to use the commands in our previous Prepare the USB Drive section to copy the required files to the USB drive.



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