1- How to include the kernel files
2- How to get backup image from Jetson module
3- How to flash the backup image
In this blog post, we will clone a Jetson AGX Orin module and restore another module with “flash.sh” script file. First, we apply the BSP files. Then, we will put it in Recovery Mode and clone the file system. Finally, we will put the target device into Recovery Mode and flash the file system with the backup image.
Attention: In this tutorial, we get the Jetson backup image from fresh installed AGX Orin module.
Open the NVIDIA SDK Manager. Select “JetPack 5.0.2” for Target Operating System and “Jetson AGX Orin modules” for Target Hardware (The “Host Machine” components are not required). Then, continue to Step 2.
Choose only “Jetson OS”, accept the terms & conditions and continue to Step 3.
The SDK Manager will ask the username’s password. Fill it and continue.
A few seconds later...
After the Jetson OS has created, the SDK Manager asks the Jetson module’s flashing style. Just skip it and exit from the SDK Manager.
Open the target HW image folder. (~/nvidia/nvidia_sdk/JetPack_5.0.2_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/)
Download the BSP files from GitHub link and extract it:
Copy the “Image” file from the extracted folder to the “kernel” folder.
Then, copy the DTB files into the “kernel/dtb” folder.
Copy the GPIO pinmux file into the “bootloader” folder.
Then, copy the two pinmux files into the “bootloader/t186ref/BCT” folder.
Return to the “JetPack_5.0.2_Linux_JETSON_AGX_ORIN_TARGETS” folder and copy the NVGPU kernel driver with patch files.
Open a Terminal in the “Linux_for_Tegra” folder.
Create the system binaries with this command below:
Apply the interface configurations with the following commands below:
sudo mv ../nvgpu.ko rootfs/usr/lib/modules/5.10.104-tegra/kernel/drivers/gpu/nvgpu/nvgpu.ko
sudo patch rootfs/usr/lib/nvidia/resizefs/nvresizefs.sh < ../orin_backup_restore.patch
sed -i "s/cvb_eeprom_read_size = <0x100>;/cvb_eeprom_read_size = <0x0>;/g" bootloader/tegra234-mb2-bct-common.dtsi
sed -i "s/ODMDATA=\"gbe-uphy-config-22,hsstp-lane-map-3,nvhs-uphy-config-0,hsio-uphy-config-0,gbe0-enable-10g\";/ODMDATA=\"gbe-uphy-config-0,hsstp-lane-map-3,hsio-uphy-config-0,nvhs-uphy-config-0\";/g" p3701.conf.common
Connect the recovery USB (between installer PC & DSBOARD-AGX's recovery USB) and power connection of your DSBOARD-AGX.
While the DSBOARD-AGX's power connector plugged in,
• wait for boot led lights up
• press reset & recovery buttons together
• release reset button
• release the recovery button after 3 seconds later. This will set it to Recovery mode.
Then, type “lsusb” and check the device connected in Recovery mode. ("0955:7223 NVidia Corp." for AGX Orin)
Create the backup image with this command below:
sudo ./flash.sh -r -k APP -G backup.img jetson-agx-orin-devkit mmcblk0p1
A few seconds later ...
This process took about 30 minutes in our system.
At the end of the clone command, the “backup.img.raw” file was saved and the “backup.img” file was created.
Set the AGX Orin module in recovery mode and type “lsusb”.
Now, apply the 2nd patch file, remove the default system image (if created before), move the RAW image as “system.img” to the “bootloader” folder and burn the backup image with these commands below:
patch -b bootloader/t186ref/cfg/flash_t234_qspi_sdmmc.xml < ../orin_backup_restore2.patch
sudo rm bootloader/system.img*
sudo mv backup.img.raw bootloader/system.img
sudo ./flash.sh -r jetson-agx-orin-devkit mmcblk0p1
At the end of the image burning process, the target device will reboot.
Attention: If you will use the Linux_for_Tegra for another flashing use-cases etc., please revert the applied patch with the following command below:
mv bootloader/t186ref/cfg/flash_t234_qspi_sdmmc.xml.orig bootloader/t186ref/cfg/flash_t234_qspi_sdmmc.xml
Thank you for reading our blog post.