Xavier/JetPack 5.0.2/Flashing Board: Difference between revisions

From RidgeRun Developer Wiki
(Created page with "<noinclude> {{Xavier/Head}} </noinclude> Nvidia provides several scripts to help to generate the images and to flash the resulting images. Including if you are going to insta...")
 
No edit summary
Line 4: Line 4:


Nvidia provides several scripts to help to generate the images and to flash the resulting images. Including if you are going to install uboot or fastboot. The main script to flash it is $JETPACK_DIR/Xavier/Linux_for_Tegra/flash.sh. What this script will do is to install or flash the image in the desired destination. It is important that the script is controlled by variables defined in the DTB file.
Nvidia provides several scripts to help to generate the images and to flash the resulting images. Including if you are going to install uboot or fastboot. The main script to flash it is $JETPACK_DIR/Xavier/Linux_for_Tegra/flash.sh. What this script will do is to install or flash the image in the desired destination. It is important that the script is controlled by variables defined in the DTB file.
= Boot Sequence =
According to the U-boot guide provided by Nvidia uboot scans booteable devices as follows:
*External SD Card
*USB Device
*Internal eMMC
*NFS Device


=Setting Board in Recovery Mode=
=Setting Board in Recovery Mode=
Line 59: Line 67:
# WB0BOOT ---------------- Warmboot code such as nvtbootwb0.bin
# WB0BOOT ---------------- Warmboot code such as nvtbootwb0.bin
</pre>
</pre>
=Flash Filesystem=
==EMMC==
<syntaxhighlight lang=bash>
JETPACK_DIR=/home/$USER/JetPack/
cd $JETPACK_DIR/Xavier/Linux_for_Tegra/
sudo ./flash.sh jetson-xavier mmcblk0p1
</syntaxhighlight>
==USB==
'''Important:''' Only for USB tegra needs a firmware that is loaded from the filesystem so the USB port is not enabled on uboot and then it causes problems to mount the fs from there, you can read about it [https://devtalk.nvidia.com/default/topic/933850/jetson-tx1/tx1-boot-from-usb/?offset=2#4871443 here].
To flash the filesystem to USB you need to put the filesystem on the USB first
1) Insert your USB flash/drive in your PC and check where it was mounted:
<syntaxhighlight lang=bash>
$ 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)
</syntaxhighlight>
2) Format the USB drive in your PCB
<syntaxhighlight lang=bash>
umount /dev/sdb1
sudo mkfs.ext4 /dev/sdb1
</syntaxhighlight>
3) Copy the filesystem to the USB drive. It takes a while, its size is around 2.4GB
<syntaxhighlight lang=bash>
JETPACK_DIR=/home/$USER/JetPack/
DEVDIR=/home/$USER/devdirs/
mkdir $DEVDIR/images/fs
sudo mount /dev/sdb1 $DEVDIR/images/fs
cd $JETPACK_DIR/Xavier/Linux_for_Tegra/rootfs/
sudo cp -a * $DEVDIR/images/fs  && sync
</syntaxhighlight>
4) Unmount the USB drive and remove it
<syntaxhighlight lang=bash>
sudo umount $DEVDIR/images/fs
</syntaxhighlight>
5) Finally connect the USB drive to the Jetson board put the Jetson on recovery mode, flash the board to look for the filesystem on the USB port:
<syntaxhighlight lang=bash>
cd $JETPACK_DIR/Xavier/Linux_for_Tegra/
sudo ./flash.sh jetson-xavier sdb1 #it can be other mount point
</syntaxhighlight>
== SD Card ==
Similar to USB but you need to replace the extlinux.conf so before copying the filesystem into the SD card run:
<syntaxhighlight lang=bash>
JETPACK_DIR=/home/$USER/JetPack/
sudo cp $JETPACK_DIR/Xavier/Linux_for_Tegra/bootloader/t186ref/p2771-0000/extlinux.conf.sdcard $JETPACK_DIR/Xavier/Linux_for_Tegra/rootfs/boot/extlinux/extlinux.conf
</syntaxhighlight>
then flash it
<syntaxhighlight lang=bash>
cd $JETPACK_DIR/Xavier/Linux_for_Tegra/
sudo ./flash.sh jetson-xavier mmcblk1p1
</syntaxhighlight>
== NFS ==
1) First you need to set up your NFS server using [https://developer.ridgerun.com/wiki/index.php/Getting_Started_Guide_for_DM8168_EVM#Setting_up_an_NFS_server these instructions].
2) Open file in $JETPACK_DIR/Xavier/Linux_for_Tegra/rootfs/etc/network/interfaces and add
<syntaxhighlight lang=bash>
auto eth0
iface eth0 inet manual
</syntaxhighlight>
3) Then flash the board to generate and install the initrd image to use nfs, you need to do this everytime that you recompile the kernel
<syntaxhighlight lang=bash>
JETPACK_DIR=/home/$USER/JetPack/
cd $JETPACK_DIR/Xavier/Linux_for_Tegra/
sudo ./flash.sh -N $MY_IPADDRESS:$JETPACK_DIR/Xavier/Linux_for_Tegra/rootfs jetson-xavier eth0
</syntaxhighlight>
=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 NOT longer used
<syntaxhighlight lang=bash>
JETPACK_DIR=/home/$USER/JetPack/
sudo cp $DEVDIR/images/zImage $DEVDIR/images/Image $JETPACK_DIR/Xavier/Linux_for_Tegra/rootfs/boot/
</syntaxhighlight>
if you are not booting from NFS then you need to reflash your filesysm in order to update the kernel. However, likely you did some changes in the kernel modules so it is recommended to run the apply_binaries.sh script instead of only copying the kernel images.
<syntaxhighlight lang=bash>
cd $JETPACK_DIR/Xavier/Linux_for_Tegra/
sudo ./apply_binaries.sh
</syntaxhighlight>
then flash your filesystem again.
=Flash Bootloader=
Update the content of the EBT partition where uboot is located
<syntaxhighlight lang=bash>
JETPACK_DIR=/home/$USER/JetPack/
cd $JETPACK_DIR/Xavier/Linux_for_Tegra/
sudo ./flash.sh -k EBT jetson-xavier mmcblk1p1
</syntaxhighlight>
= Boot Sequence =
According to the U-boot guide provided by Nvidia uboot scans booteable devices as follows:
*External SD Card
*USB Device
*Internal eMMC
*NFS Device


<noinclude>
<noinclude>
{{Xavier/Foot|<Replace with "previous" page>|In_Board}}
{{Xavier/Foot|<Replace with "previous" page>|In_Board}}
</noinclude>
</noinclude>

Revision as of 15:05, 20 September 2018




  Index  





Nvidia provides several scripts to help to generate the images and to flash the resulting images. Including if you are going to install uboot or fastboot. The main script to flash it is $JETPACK_DIR/Xavier/Linux_for_Tegra/flash.sh. What this script will do is to install or flash the image in the desired destination. It is important that the script is controlled by variables defined in the DTB file.


Boot Sequence

According to the U-boot guide provided by Nvidia uboot scans booteable devices as follows:

  • External SD Card
  • USB Device
  • Internal eMMC
  • NFS Device

Setting Board in Recovery Mode

To put the board into force USB Recovery Mode follow these instructions:

1. Power down the device. If connected, remove the AC adapter from the device. The device must be powered OFF, and not in a suspend or sleep state.
2. Connect the Type-C plug on the USB cable to the Recovery (USB Type-C) Port on the device and the other end to an available USB port on the host PC.
3. Connect the power adapter to the device.
4. Press and release the POWER button to power on device.
5. Press and hold the FORCE RECOVERY button: while pressing the FORCE RECOVERY button, press and release the RESET button; wait two seconds and release the FORCE RECOVERY button.
6. When the device is in recovery mode, lsusb command on host will list a line of "NVidia Corp"

All examples assume that the board is in recovery mode.

Flash Script Options

# Examples:
# ./flash.sh <target_board> mmcblk0p1                   - boot <target_board> from eMMC
# ./flash.sh <target_board> mmcblk1p1                   - boot <target_board> from SDCARD
# ./flash.sh <target_board> sda1                        - boot <target_board> from USB device
# ./flash.sh -N <IPaddr>:/nfsroot <target_board> eth0   - boot <target_board> from NFS
# ./flash.sh -k LNX <target_board> mmcblk1p1            - update <target_board> kernel
# ./flash.sh -k EBT <target_board> mmcblk1p1            - update <target_board> bootloader
#
# Optional Environment Variables:
# BCTFILE ---------------- Boot control table configuration file to be used.
# BOARDID ---------------- Pass boardid to override EEPROM value
# BOOTLOADER ------------- Bootloader binary to be flashed
# BOOTPARTLIMIT ---------- GPT data limit. (== Max BCT size + PPT size)
# BOOTPARTSIZE ----------- Total eMMC HW boot partition size.
# CFGFILE ---------------- Partition table configuration file to be used.
# CMDLINE ---------------- Target cmdline. See help for more information.
# DEVSECTSIZE ------------ Device Sector size. (default = 512Byte).
# DTBFILE ---------------- Device Tree file to be used.
# EMMCSIZE --------------- Size of target device eMMC (boot0+boot1+user).
# FLASHAPP --------------- Flash application running in host machine.
# FLASHER ---------------- Flash server running in target machine.
# IGNOREFASTBOOTCMDLINE -- Block fastboot from filling unspecified kernel
#                          cmdline parameters with its defaults.
# INITRD ----------------- Initrd image file to be flashed.
# KERNEL_IMAGE ----------- Linux kernel zImage file to be flashed.
# MTS -------------------- MTS file name such as mts_si.
# MTSPREBOOT ------------- MTS preboot file name such as mts_preboot_si.
# NFSARGS ---------------- Static Network assignments.
#			   <C-ipa>:<S-ipa>:<G-ipa>:<netmask>
# NFSROOT ---------------- NFSROOT i.e. <my IP addr>:/exported/rootfs_dir.
# ODMDATA ---------------- Odmdata to be used.
# ROOTFSSIZE ------------- Linux RootFS size (internal emmc/nand only).
# ROOTFS_DIR ------------- Linux RootFS directory name.
# SCEFILE ---------------- SCE firmware file such as camera-rtcpu-sce.bin.
# SPEFILE ---------------- SPE firmware file path such as bootloader/spe.bin.
# FAB -------------------- Target board's FAB ID.
# TEGRABOOT -------------- lowerlayer bootloader such as nvtboot.bin.
# WB0BOOT ---------------- Warmboot code such as nvtbootwb0.bin



[[Xavier/<Replace with "previous" page>|Previous: <Replace with "previous" page>]] Index Next: In_Board