Flash step
  • 20 Apr 2023
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Flash step

  • Dark
    Light
  • PDF

Article summary

Enter Recovery mode

When it comes to using 'flash.sh', make sure you enter the Recovery mode first.

  1. Connect to computer via M-USB1.
  2. Press 'Recovery' button and 'Reset' button at the same time.
  3. Release 'Reset' button.
  4. Relesee 'Recovery' button.
  5. Check wether the device is connected.
$ lsusb
Bus 001 Device 012: ID 0955:7e19 NVIDIA Corp. APX

Flash command

Please flash using Nvidia script 'flash.sh'

$ cd <nvidia_folder>/Linux_for_Tegra/
$ ls flash.sh
flash.sh

<board> name for flash

Base on your modules, change the <board> name for script.
Xavier NX(emmc) for TEK3-NVJETSON, TEK8-NX210V

jetson-xavier-nx-devkit-emmc

Nano(emmc) for TEK3-NVJETSON

jetson-nano-devkit-emmc

Nano(sd) for EVK

jetson-nano-devkit


Flash demo image

  1. Download TechNexion TEK products demo image from HERE
    Or download Jetson EVK demo image from HERE
  2. Copy demo image to "Linux_for_Tegra/bootloader/"
    And rename it into "system.img"
# backup origin system.img, 
$ sudo cp -rv <nvidia_folder>/Linux_for_Tegra/bootloader/system.img <nvidia_folder>/Linux_for_Tegra/bootloader/system.img.backup
# copy demo image
$ sudo cp -rv <demo_image> <nvidia_folder>/Linux_for_Tegra/bootloader/system.img
  1. Enter recovery mode and run:
# <-r> skip building and reuse existing system.img. 
$ sudo ./flash.sh -r <board> mmcblk0p1 


DO NOT create new system.img, flash only

# # <-r> skip building and reuse existing system.img. 
$ sudo ./flash.sh -r <board> mmcblk0p1


Create new system.img, and flash

$ sudo ./flash.sh <board> mmcblk0p1 


Create new system.img, DO NOT flash

# <--no-flash> perform all steps except physically flashing the board.
$ sudo ./flash.sh --no-flash <board> mmcblk0p1


Backup currect image

$ sudo ./flash.sh -r -k APP -G <backup_img> <board> mmcblk0p1
Flash <backup_img>

The same step as Flash demo image
Just swap <demo_img> to backup.img

.img v.s. .img.raw

.img.raw is the same result when using 'dd' command.
.img is the sparse image of .img.raw, flash.sh use this file.
you can use below command to change between this two file

$ simg2img backup.img backup.img.raw
$ img2simg backup.img.raw backup.img


Flash new pinmux image (For Xavier-NX)

0) Edit the xlsm pinmux file via windows environment.

<nvidia_folder>/Linux_for_Tegra/<target>*_pinmux/*.xlsm

pinmux1.png

If done, click the above Macro(Generate DT file) to generate pinmux file.

xavier_gen1.png

1) Type the <name> twice.

xavier_gen2.png

You will see this result.
pinmux_xavier.png

2) Convert into cfg files using Jetpack script.

# Copy files to script location
$ cp -rv tegra19x-<name>-pinmux.dtsi <nvidia_folder>/Linux_for_Tegra/kernel/pinmux/t19x/
$ cp -rv tegra19x-<name>-gpio-default.dtsi <nvidia_folder>/Linux_for_Tegra/kernel/pinmux/t19x/
$ cp -rv tegra19x-<name>-padvoltage-default.dtsi <nvidia_folder>/Linux_for_Tegra/kernel/pinmux/t19x/

# Generation cfg file
$ cd <nvidia_folder>/Linux_for_Tegra/kernel/pinmux/t19x/
$ python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt    \
                tegra19x-<name>-pinmux.dtsi tegra19x-<name>-gpio-default.dtsi \
                1.0 > TEST_tegra19x-mb1-pinmux-p3668-a01.cfg

3) Copy cfg files to flash location

$ sudo cp -rp TEST_tegra19x-mb1-pinmux-p3668-a01.cfg <nvidia_folder>/Linux_for_Tegra/bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p3668-a01.cfg

4) Flash 'MB1_BCT' partition(pinmux partition).

$ sudo ./flash.sh -k MB1_BCT jetson-xavier-nx-devkit-emmc mmcblk0p1


Flash new pinmux image (For Nano)

0) Edit the xlsm pinmux file via windows environment.

<nvidia_folder>/Linux_for_Tegra/<target>*_pinmux/*.xlsm

pinmux1.png

If done, click the above Macro(Generate DT file) to generate pinmux file.

nano_gen1.png

1) Type the <name>.

nano_gen2.png

You will see this result.
pinmux_nano.png

2) Copy files to device-tree location(For example: TEK3-NVJETSON)

$ sudo cp -rp tegra210-tek3-gpio-default.dtsi <nvidia_folder>/Linux_for_Tegra/sources/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-tek3-nvjetson-a1-gpio-default.dtsi
$ sudo cp -rp tegra210-tek3-pinmux.dtsi <nvidia_folder>/Linux_for_Tegra/sources/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-tek3-nvjetson-a1-pinmux.dtsi

4) Re-compile and flash new device-tree.


Flash new u-boot (Nano only)

$ sudo ./flash.sh -r -k LNX <board> mmcblk0p1
copy u-boot.bin

From:

<nvidia_folder>/Linux_for_Tegra/sources/u-boot/u-boot.bin

to

<nvidia_folder>/Linux_for_Tegra/bootloader/t210ref/p3450-0000/u-boot.bin

Flash new cboot (Xavier-NX only)

$ sudo ./flash.sh -k cpu-bootloader --image cboot/out/build-t194/lk.bin <board> mmcblk0p1
copy cboot.bin

From:

<nvidia_folder>/Linux_for_Tegra/sources/cboot/out/build-t194/lk.bin

to

 <nvidia_folder>/Linux_for_Tegra/bootloader/cboot_t194.bin


Those only update by file system

Protect the boot flow for saving your time.

You may want to see this article before you changing files.

Those part below can't be changed by flash.sh.
Need to change the file by:

  1. baseboard sd card
  2. ssh (scp)
  3. USB stick

Update new kernel Image

Copy from:

<nvidia_folder>/Linux_for_Tegra/sources/kernel/kernel-4.9/arch/arm64/boot/Image

to device:

/boot/


Update new kernel modules

Copy from

<nvidia_folder>/Linux_for_Tegra/sources/kernel/modules/lib/

to device:

/lib/


Update device tree

From:

<nvidia_folder>/Linux_for_Tegra/sources/kernel/kernel-4.9/arch/arm64/boot/dts/<target>.dtb

to device:

/boot/<target>.dtb

Change default device-tree

On device:

$ vi /boot/extlinux/extlinux.conf
LABEL primary
      MENU LABEL primary kernel
+     FDT /boot/<target>.dtb
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0


Update Update device tree overlay (Nano only)

From:

<nvidia_folder>/Linux_for_Tegra/sources/kernel/kernel-4.9/arch/arm64/boot/dts/<target>.dtbo

to device:

/boot/<target>.dtb*

on device:

$ vi /boot/extlinux/extlinux.conf
LABEL primary
      MENU LABEL primary kernel
+     FDTOVERLAYS /boot/<target_overlay>.dtbo
      FDT /boot/<target>.dtb
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

Support Overlay Table (WIP)

board
baseboard
overlay function
Xavier-NX
TEK3-NVJETSON
VIZIONLINK-1 with TEVI-AR-series
*4
Nano
TEK3-NVJETSON
VIZIONLINK-1 with TEVI-AR-series
*4
Xavier-NX
TEK8-NVJETSON
VIZIONLINK-4 with TEVI-AR0144
*24
Nano
EVK
TEVI-AR-series *2



Was this article helpful?