Difference between revisions of "NVIDIA Jetson Orin/JetPack 5.0.2/Flashing Board"

From RidgeRun Developer Connection
Jump to: navigation, search
(Step 4: Execute the Flash Script)
m
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
{{NVIDIA Jetson Orin/Head|previous=JetPack 5.0/Compiling Code/Bootloader|next=JetPack 5.0/Flashing Board/Flash Filesystem|keywords=jetpack,flashing,image,flash,flashing board}}
+
{{NVIDIA Jetson Orin/Head|previous=JetPack_5.0.2/Compiling_Code|next=JetPack_5.0.2/Performance_Tuning|metakeywords=jetpack,flashing,image,flash,flashing board}}
 
</noinclude>
 
</noinclude>
 
__TOC__
 
__TOC__
 
<br>
 
<br>
 +
 +
{{DISPLAYTITLE:NVIDIA Jetson Orin - Flashing the Board from Cmdline|noerror}}
  
 
This section provides a guide to flash the Jetson Orin OS components from the host computer command line. Flashing is the process of copying the files required into the selected storage from which the Orin is going to boot. In the flashing process, we use the host computer and the Orin.
 
This section provides a guide to flash the Jetson Orin OS components from the host computer command line. Flashing is the process of copying the files required into the selected storage from which the Orin is going to boot. In the flashing process, we use the host computer and the Orin.
 
  
 
This section assumes that you already have followed through our [[NVIDIA_Jetson_Orin/JetPack_5.0/Getting_Started|Getting Started]] and [[NVIDIA_Jetson_Orin/JetPack_5.0/Getting_Started/Installing_Jetpack|Installing Jetpack sections]].
 
This section assumes that you already have followed through our [[NVIDIA_Jetson_Orin/JetPack_5.0/Getting_Started|Getting Started]] and [[NVIDIA_Jetson_Orin/JetPack_5.0/Getting_Started/Installing_Jetpack|Installing Jetpack sections]].
  
 
+
==Assumptions==
=Assumptions=
 
 
 
  
 
# You have Jetpack 5.0.x installed on your host computer in the default path ($HOME/nvidia/nvidia_sdk/JetPack_5.0.1_DP_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra). If your Jetpack installation used a different path, make sure to modify accordingly the JETPACK environment variable in Step 1.
 
# You have Jetpack 5.0.x installed on your host computer in the default path ($HOME/nvidia/nvidia_sdk/JetPack_5.0.1_DP_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra). If your Jetpack installation used a different path, make sure to modify accordingly the JETPACK environment variable in Step 1.
  
 +
# The OS components to be installed in the Orin AGX 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 [[NVIDIA_Jetson_Orin/JetPack_5.0/Compiling_Code/Kernel|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==
=Step 1: Define the Environment Variables=
 
 
Make sure to run the following commands in the terminal that you will use to flash the Orin.
 
Make sure to run the following commands in the terminal that you will use to flash the Orin.
 
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
Line 26: Line 24:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
+
== Step 2: Set Board in Recovery Mode ==
= Step 2: Set Board in Recovery Mode =
 
  
 
In order to flash the Orin, we must set it in recovery mode so that it can accept the files. The procedure to put the Orin in recovery mode is:
 
In order to flash the Orin, we must set it in recovery mode so that it can accept the files. The procedure to put the Orin in recovery mode is:
 
  
 
# Start with the Jetson Orin AGX devkit turned off and disconnected from the power supply.
 
# Start with the Jetson Orin AGX devkit turned off and disconnected from the power supply.
Line 38: Line 34:
  
 
<br>
 
<br>
 
  
 
{| class="wikitable" style="margin: auto;"
 
{| class="wikitable" style="margin: auto;"
Line 45: Line 40:
 
| [[File:Orin agx devkit recovery mode.png|700px|thumb|center|Figure 1: Recovery Mode Buttons]] || [[File:orin_agx_devkit_flashing_port.png|650px|thumb|center|Figure 2: USB-C Port for Flashing]]
 
| [[File:Orin agx devkit recovery mode.png|700px|thumb|center|Figure 1: Recovery Mode Buttons]] || [[File:orin_agx_devkit_flashing_port.png|650px|thumb|center|Figure 2: USB-C Port for Flashing]]
 
|}
 
|}
 
  
 
<br>
 
<br>
Line 61: Line 55:
 
<br>
 
<br>
  
= Step 3 (Optional): Create a Default User =
+
== Step 3 (Optional): Create a Default User ==
  
  
Line 72: Line 66:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
+
== Step 4: Execute the Flash Script ==
= 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''':
 
NVIDIA provides a script for flashing the Orin in the Jetpack directory. This script takes two arguments, the '''target board''', and the '''root device''':
 
<br>
 
<br>
 
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
sudo ./flash.sh <target board> <rootdev>
 
sudo ./flash.sh <target board> <rootdev>
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
 
There are four possible options of target board for the Orin AGX:
 
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''': 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-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-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
+
*'''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.
 
In the following subsections, we are going to use the jetson-agx-orin-devkit configuration to flash the Orin.
 
<br>
 
<br>
  
 +
The root device indicates the storage that will be used to boot the Orin, the following options are available:
  
The root device indicates the storage that will be used to boot the Orin, the following options are available:
+
# eMMC
 +
# USB Drive
 +
# NVMe
  
* eMMC
 
* USB Drive
 
* NVMe
 
  
 
<!--
 
<!--
 
* NFS
 
* NFS
 
-->
 
-->
 +
{{Ambox
 +
|type=notice
 +
|small=left
 +
|issue='''Note''': SD Card is not supported yet in the Jetpack 5.0.1 DP release.
 +
|style=width:unset;
 +
}}
  
'''Note''': SD Card is not supported yet in the Jetpack 5.0.1 DP release.
+
The following subsections show the command to flash each of the storage options available.
  
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:
  
==eMMC==
 
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
cd $JETPACK
+
cd $JETPACK
sudo ./flash.sh jetson-agx-orin-devkit mmcblk0p1
+
sudo ./flash.sh jetson-agx-orin-devkit mmcblk0p1
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
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
  
== USB Drive ==
+
=== Option #2: USB Drive ===
  
To flash the filesystem to USB you need to put the filesystem on the USB first.
+
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:
 +
 
 +
<syntaxhighlight lang=bash>
 +
mount
 +
</syntaxhighlight>
  
Insert your USB flash/drive into your PC and check where it was mounted:
+
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:
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
Line 127: Line 131:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Format the USB drive in your PC:
+
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.
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
umount /dev/sdd1
+
umount </dev/sdX>
sudo mkfs.ext4 /dev/sdd1
+
sudo mkfs.ext4 </dev/sdX>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Copy the filesystem to the USB drive. It takes a while, its size is around 6GB  
+
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:
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
JETPACK_DIR=/home/$USER/nvidia/nvidia_sdk/JetPack_5.0_DP_Linux_DP_JETSON_AGX_ORIN_TARGETS
+
  cd $JETPACK
  cd $JETPACK_DIR/Linux_for_Tegra
 
 
  sudo mkdir tmp_system
 
  sudo mkdir tmp_system
  sudo mount /dev/sdd1 $JETPACK_DIR/Linux_for_Tegra/tmp_system
+
  sudo mount </dev/sddX> $JETPACK/tmp_system
 
  cd rootfs/
 
  cd rootfs/
  sudo cp -a * $JETPACK_DIR/Linux_for_Tegra/tmp_system && sync
+
  sudo cp -a * $JETPACK/tmp_system && sync
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Umount the USB drive and remove it from your PC
+
When the copy finishes, you can proceed to umount the USB Drive with the following command:
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
sudo umount $JETPACK_DIR/Linux_for_Tegra/tmp_system
+
sudo umount $JETPACK_DIR/tmp_system
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Finally, connect the USB drive to the Jetson AGX Orin board and put it in recovery mode. Then, flash the board to look for the filesystem on the USB port:
+
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:
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
  cd $JETPACK_DIR/Linux_for_Tegra
+
  cd $JETPACK
 
  sudo ./flash.sh jetson-agx-orin-devkit sda1 #it can be another mount point
 
  sudo ./flash.sh jetson-agx-orin-devkit sda1 #it can be another mount point
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
After the flash script finishes successfully, the Orin will boot automatically.
  
 
<!--
 
<!--
Line 166: Line 175:
 
  sudo ./flash.sh jetson-agx-orin-devkit  nvme0n1p1
 
  sudo ./flash.sh jetson-agx-orin-devkit  nvme0n1p1
 
</syntaxhighlight>
 
</syntaxhighlight>
 
 
 
  
 
To flash the Jetson Orin you need to set the board in Recovery Mode. This Mode can be set by connecting the USB Type-C to the board and the USB port on the host PC. The USB Type-C port is shown in the figure below. Before setting the board in Recovery Mode is important to know that when the power supply is connected, the Jetson Orin board will power on automatically.
 
To flash the Jetson Orin you need to set the board in Recovery Mode. This Mode can be set by connecting the USB Type-C to the board and the USB port on the host PC. The USB Type-C port is shown in the figure below. Before setting the board in Recovery Mode is important to know that when the power supply is connected, the Jetson Orin board will power on automatically.
 
  
 
[[File:Orin-usb-typeC-.jpg|800px|thumb|center|Port USB-Type C.]]
 
[[File:Orin-usb-typeC-.jpg|800px|thumb|center|Port USB-Type C.]]
Line 250: Line 255:
 
# WB0BOOT ---------------- Warmboot code such as nvtbootwb0.bin
 
# WB0BOOT ---------------- Warmboot code such as nvtbootwb0.bin
 
</syntaxhighlight>
 
</syntaxhighlight>
 
 
  
 
=== eMMc ===
 
=== eMMc ===
  
 
+
{{review|why did we move to cmdline scripts? Does the sdkmanager not support flashing the MMC? if so, please specify that.|mgruner}}
{{review|why did we moved to cmdline scripts? Does the sdkmanager not support flashing the MMC? if so, please specify that.|mgruner}}
 
  
 
Before flashing the eMMC for the first time a new user must be set. You can do so by running:
 
Before flashing the eMMC for the first time a new user must be set. You can do so by running:
Line 280: Line 282:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=== USB Driver ===
+
=== USB Drive ===
  
 
To flash the filesystem to USB you need to put the filesystem on the USB first.
 
To flash the filesystem to USB you need to put the filesystem on the USB first.
Line 314: Line 316:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Finally, connect the USB drive to the Jetson AGX Orin board and put it in recovery mode. Then, flash the board  to look for the filesystem on the USB port:
+
Finally, connect the USB d
 
 
<syntaxhighlight lang=bash>
 
cd $JETPACK_DIR/Linux_for_Tegra
 
sudo ./flash.sh jetson-agx-orin-devkit sda1 #it can be another mount point
 
</syntaxhighlight>
 
 
 
-->
 
== Known Issues ==
 
 
 
The board does not provide a display interface DisplayPort output. Only shows the NVIDIA Logo before booting, and also shows the BIOS interface if the Escape key is pressed.
 
 
 
If the following command is running:
 
 
 
<syntaxhighlight lang=bash>
 
dmesg -w
 
</syntaxhighlight>
 
 
 
When the DisplayPort to HDMI cable is disconnected and connected, the log shows the following messages:
 
 
 
<syntaxhighlight lang=bash>
 
[  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:
 
</syntaxhighlight>
 
 
 
=== USB Driver ===
 
 
 
NVIDIA provides a guide for Flashing to a USB Drive in the following link:
 
 
 
[https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/FlashingSupport.html#to-set-up-a-flash-drive-manually-for-using-as-root-file-system Flashing to a USB Drive]
 
 
 
However, after following the next commands:
 
 
<syntaxhighlight lang=bash>
 
sudo mount bootloader/system.img.raw ./tmp_system
 
sudo rsync -axHAWX --numeric-ids --info=progress2 --exclude=/proc ./tmp_system/ /mnt
 
</syntaxhighlight>
 
 
 
The USB drive only has a directory name ''boot'' and does not have the filesystem.
 
 
 
 
 
 
 
<noinclude>
 
{{NVIDIA Jetson Orin/Foot|JetPack 5.0‎/Compiling Code/Bootloader|JetPack 5.0/Flashing Board/Flash Filesystem}}
 
</noinclude>
 

Latest revision as of 14:02, 17 August 2023



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 Orin OS components from the host computer command line. Flashing is the process of copying the files required into the selected storage from which the Orin is going to boot. In the flashing process, we use the host computer and the Orin.

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

Assumptions

  1. You have Jetpack 5.0.x installed on your host computer in the default path ($HOME/nvidia/nvidia_sdk/JetPack_5.0.1_DP_Linux_JETSON_AGX_ORIN_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 Orin AGX 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 Orin.

export JETPACK=$HOME/nvidia/nvidia_sdk/JetPack_5.0.1_DP_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra

Step 2: Set Board in Recovery Mode

In order to flash the Orin, we must set it in recovery mode so that it can accept the files. The procedure to put the Orin in recovery mode is:

  1. Start with the Jetson Orin AGX devkit turned off and disconnected from the power supply.
  2. Get the USB-A to USB-C cable and connect the USB-A end to your host computer (the computer where you installed Jetpack) and the USB-C end to the Orin type C port L, shown in Figure 2.
  3. Press and hold the FORCE RECOVERY button (B in Figure 1).
  4. While pressing the FORCE RECOVERY button, press and release the RESET button (C in Figure 1).


Figure 1: Recovery Mode Buttons
Figure 2: USB-C Port for Flashing


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

lsusb

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

Bus 001 Device 011: ID 0955:7023 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.