Xavier/JetPack 5.0.2/Flashing Board/Flash Kernel: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{Xavier/Head}}
{{Xavier/Head|previous=JetPack 4.1‎/Flashing Board/Flash Filesystem|next=JetPack 4.1‎/Flashing Board/Flash Bootloader|keywords=jetpack,flashing,image,flash,flashing board,kernel,dtb,rebuild}}
</noinclude>
</noinclude>
<!-- If you want a custom title for the page, un-comment and edit this line:
<!-- If you want a custom title for the page, un-comment and edit this line:
Line 6: Line 6:
-->
-->


=Flash Kernel=
==Flash Kernel==
To flash your kernel you just need to copy it to /boot in your filesystem. The old method to flash it in the LNX partition (./flash.sh -k LNX <target_board> mmcblk1p1) is no longer used. If you wish to recompile the kernel you can check [[Xavier/JetPack_4.0/Compiling_Code/Kernel|this]] page.
The Jetson provides two partions for the kernel <code>kernel</code> and <code>kernel_b</code> the first one can be used to flash a new kernel while <code>kernel_b</code> is a tolerance design for error. Once primary kernel partition is broken, it will fallback to this backup.  


==eMMC==
If you wish to recompile the kernel you can check [[Xavier/JetPack_4.0/Compiling_Code/Kernel|this]] page.
1) Access the device using ssh. This is necesary since you will need root permissions to copy to the /boot directory
 
<syntaxhighlight lang=bash>
===eMMC===
ssh nvidia@$TEGRA_IP
 
</syntaxhighlight>
1) Put the board in recovery mode and connect it to the host PC


2) Use scp to copy the kernel image
2) Flash the kernel image calling the following command
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
sudo scp $MY_IPADDRESS:$TEGRA_KERNEL_OUT/arch/arm64/boot/Image /boot  #Your source image might be in another location
sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1
</syntaxhighlight>
</syntaxhighlight>


==USB Card==
===USB Card===
1) Insert your USB flash/drive in your PC and check where it was mounted:
1) Insert your USB flash/drive in your PC and check where it was mounted:
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 27: Line 27:
</syntaxhighlight>
</syntaxhighlight>


2) Mount and copy the kernel image
2) Flash the kernel image
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
DEVDIR=/home/$USER/devdirs/
sudo ./flash.sh -k kernel jetson-xavier sdb1
mkdir $DEVDIR/images/fs
sudo mount /dev/sdb1 $DEVDIR/images/fs
sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $DEVDIR/images/fs/boot/ #Your source image might be in another location
</syntaxhighlight>
</syntaxhighlight>




== SD Card ==
=== SD Card ===


This process is similar to the USB flashing
This process is similar to the USB flashing
Line 46: Line 43:
</syntaxhighlight>
</syntaxhighlight>


2) Mount and copy the kernel image
2) Copy the kernel image
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
DEVDIR=/home/$USER/devdirs/
sudo ./flash.sh -k kernel jetson-xavier mmcblk1p1
mkdir $DEVDIR/images/fs
sudo mount /dev/mmcblk1p1 $DEVDIR/images/fs
sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $DEVDIR/images/fs/boot/ #Your source image might be in another location
</syntaxhighlight>
</syntaxhighlight>




==NFS==
===NFS===
If you followed the guide [[Xavier/JetPack_4.0/Flash_Filesystem|here]], the NFS /boot directory will be located in:
 
1) Put the board in recovery mode and connect it to the host PC
 
2) Flash the kernel image to the eMMC calling the following command
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
JETPACK_DIR=/home/$USER/JetPack/
sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1
sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $JETPACK_DIR/Xavier/Linux_for_Tegra/rootfs/boot/ #Your source image might be in another location
</syntaxhighlight>
</syntaxhighlight>






=Rebuilding DTB=
==Rebuilding DTB==
To modify the DTS and rebuild the DTB
To modify the DTS and rebuild the DTB


Line 81: Line 77:
</syntaxhighlight>
</syntaxhighlight>


4. Flash the partition CPUBL-CFG.This asumes that a filesystem already exists in the desired location, if not follow the instructions [[Xavier/JetPack_4.0/Flashing_Board/Flash_Filesystem|here]]
4. Flash the partition CPUBL-CFG. This assumes that a filesystem already exists in the desired location, if not follow the instructions [[Xavier/JetPack_4.0/Flashing_Board/Flash_Filesystem|here]]


==eMMC==
===eMMC===
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
cd ..
cd ..
Line 89: Line 85:
</syntaxhighlight>
</syntaxhighlight>


==USB==
===USB===
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
cd ..
cd ..
Line 95: Line 91:
</syntaxhighlight>
</syntaxhighlight>


==SD Card==
===SD Card===
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
cd ..
cd ..
Line 101: Line 97:
</syntaxhighlight>
</syntaxhighlight>


==NFC==
===NFC===
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
cd ..
cd ..
Line 110: Line 106:


<noinclude>
<noinclude>
{{Xavier/Foot|<Replace with "previous" page>|<Replace with "next" page>}}
{{Xavier/Foot|JetPack 4.1‎/Flashing Board/Flash Filesystem|JetPack 4.1‎/Flashing Board/Flash Bootloader}}
</noinclude>
</noinclude>

Latest revision as of 15:26, 17 August 2022




Previous: JetPack 4.1‎/Flashing Board/Flash Filesystem Index Next: JetPack 4.1‎/Flashing Board/Flash Bootloader





Flash Kernel

The Jetson provides two partions for the kernel kernel and kernel_b the first one can be used to flash a new kernel while kernel_b is a tolerance design for error. Once primary kernel partition is broken, it will fallback to this backup.

If you wish to recompile the kernel you can check this page.

eMMC

1) Put the board in recovery mode and connect it to the host PC

2) Flash the kernel image calling the following command

sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1

USB Card

1) Insert your USB flash/drive in your PC and check where it was mounted:

$ mount
/dev/sdb1 on /media/$USER/EF02-5626 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)

2) Flash the kernel image

sudo ./flash.sh -k kernel jetson-xavier sdb1


SD Card

This process is similar to the USB flashing

1) Insert your USB flash/drive in your PC and check where it was mounted:

$ mount
/dev/mmcblk1p1 on /media/$USER/EF02-5626 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)

2) Copy the kernel image

sudo ./flash.sh -k kernel jetson-xavier mmcblk1p1


NFS

1) Put the board in recovery mode and connect it to the host PC

2) Flash the kernel image to the eMMC calling the following command

sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1


Rebuilding DTB

To modify the DTS and rebuild the DTB

1. Locate the cbo.dts file in this directory:

JETPACK_DIR=/home/$USER/JetPack/
cd $JETPACK_DIR/Xavier/Linux_for_Tegra/bootloader/


2. Modify the file as necessary

3. Enter this command to convert the DTS to a DTB:

$JETPACK_DIR/Xavier/Linux_for_Tegra/kernel/dtc -I dts -O dtb -o cbo.dtb cbo.dts

4. Flash the partition CPUBL-CFG. This assumes that a filesystem already exists in the desired location, if not follow the instructions here

eMMC

cd ..
sudo ./flash.sh -k CPUBL-CFG jetson-xavier mmcblk0p1

USB

cd ..
sudo ./flash.sh -k CPUBL-CFG jetson-xavier sdb1 #it can be other mount point

SD Card

cd ..
sudo ./flash.sh -k CPUBL-CFG jetson-xavier mmcblk1p1 #it can be other mount point

NFC

cd ..
sudo ./flash.sh -N $MY_IPADDRESS:$JETPACK_DIR/Xavier/Linux_for_Tegra/rootfs --rcm-boot -k CPUBL-CFG jetson-xavier eth0 #it can be other mount point




Previous: JetPack 4.1‎/Flashing Board/Flash Filesystem Index Next: JetPack 4.1‎/Flashing Board/Flash Bootloader