NVIDIA Tegra
NVIDIA Tegra Linux Driver Package

Development Guide
28.1 Release


 
Flashing Multiple Tegra Devices
 
Creating the flash command File
Connecting the Tegra Devices to the Host
Adding the multi_tegra_flash.sh Script
Flashing the Devices
Use these procedures to flash multiple Tegra devices concurrently with one host system.
For flashing details, such as putting the device into recovery mode, see Flashing and Booting the Target Device.
Creating the flash command File
 
TX1
TX2
TX1
The following command sequence must run under the environment setup by Jetpack:
$ cd 64_TX1/Linux_for_Tegra_64_tx1/
$ sudo ./flash.sh --no-flash jetson-tx1 mmcblk0p1
After running the above command sequence, the flash command is stored to a txt file at:
bootloader/flashcmd.txt
The content of the file is as follows:
$ cat bootloader/flashcmd.txt
./tegraflash.py --bl cboot.bin --bct P2180_A00_LP4_DSC_204Mhz.cfg --odmdata 0x84000 --bldtb tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb --applet nvtboot_recovery.bin --boardconfig board_config_p2597-devkit.xml --cmd "flash;reboot" --cfg flash.xml --chip 0x21
TX2
Before executing the following command sequence under the environment setup by Jetpack, connect a TX2 production device to the host sytem and place it in forced-recovery mode.
For information on placing the device in force recovery mode, see Quick Start Guide.
$ cd 64_TX2/Linux_for_Tegra_64_tx2/
$ sudo ./flash.sh --no-flash jetson-tx2 mmcblk0p1
After running the above command sequence, the flash command is stored as a text file at:
bootloader/flashcmd.txt
The content of the file is as follows:
$ cat bootloader/flashcmd.txt
./tegraflash.py --bl nvtboot_recovery_cpu.bin --sdram_config P3310_A00_8GB_Samsung_8GB_lpddr4_204Mhz_A02_l4t.cfg --odmdata 0x1090000 --applet mb1_recovery_prod.bin --cmd "flash;reboot" --cfg flash.xml --chip 0x18 --misc_config tegra186-mb1-bct-misc-si-l4t.cfg --pinmux_config tegra186-mb1-bct-pinmux-quill-p3310-1000-a00.cfg --pmic_config tegra186-mb1-bct-pmic-quill-p3310-1000-a00.cfg --pmc_config tegra186-mb1-bct-pad-quill-p3310-1000-a00.cfg --prod_config tegra186-mb1-bct-prod-quill-p3310-1000-a00.cfg --scr_config minimal_scr.cfg --scr_cold_boot_config mobile_scr.cfg --br_cmd_config tegra186-mb1-bct-bootrom-quill-p3310-1000-a00.cfg --dev_params emmc.cfg --bins "mb2_bootloader nvtboot_recovery.bin; mts_preboot preboot_d15_prod_cr.bin; mts_bootpack mce_mts_d15_prod_cr.bin; bpmp_fw bpmp.bin; bpmp_fw_dtb tegra186-a02-bpmp-quill-p3310-1000-a00-00-te770d-ucm2.dtb; tlk tos.img; eks eks.img; bootloader_dtb tegra186-quill-p3310-1000-a00-00-base.dtb"
Connecting the Tegra Devices to the Host
To eliminate low USB transfer performance and ensure that flashing is successful, connect the Tegra devices to the USB root ports of the host system with one device on one port as follows:
$ lsusb | grep NVidia
Bus 005 Device 012: ID 0955:7721 NVidia Corp.
Bus 003 Device 016: ID 0955:7721 NVidia Corp.
 
$ lsusb -t
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
|__ Port 1: Dev 10, If 0, Class=Vendor Specific Class, Driver=usbfs, 480M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
|__ Port 1: Dev 14, If 0, Class=Vendor Specific Class, Driver=usbfs, 480M
Adding the multi_tegra_flash.sh Script
Add the multi_tegra_flash.sh script at:
TX1:
64_TX1/Linux_for_Tegra_64_tx1/bootloader/
TX2:
64_TX2/Linux_for_Tegra_64_tx2/bootloader/
The content of the script is as follows:
$ cat multi_tegra_flash.sh
#!/bin/bash
 
NVIDIA_USB_ID=0955:
 
# create a folder for saving log
PID=$$
mkdir ${PID}
 
echo "start flash with PID=${PID}"
 
## flash all devices in background
lsusb -d ${NVIDIA_USB_ID} | while IFS= read -r line
do
BUS=`echo $line | awk '{print $2}'`
DEV=`echo $line | awk '{print $4}' | cut -d ':' -f 1`
USB_INSTANCE=`echo /dev/bus/usb/${BUS}/${DEV}`
rm -f ./flash_${BUS}_${DEV}.log
FLASHCMD=`cat flashcmd.txt`
CMD="${FLASHCMD} --instance ${USB_INSTANCE}"
(eval ${CMD} > ${PID}/flash_${BUS}_${DEV}.log) &
PROCESS_ID=$!
echo ${PROCESS_ID} >>${PID}/pid.log
echo "start flashing device: ${USB_INSTANCE}, process ID: ${PROCESS_ID}"
TIMEOUT=0
while [ ${TIMEOUT} -lt 6 ]
do
cat ${PID}/flash_${BUS}_${DEV}.log | grep "system.img" 2>&1 >/dev/null
if [ $? == 0 ]; then
sleep 4
break;
else
sleep 1
let "TIMEOUT=TIMEOUT+1"
fi
done
done
 
## exit if pid file is not generated
if [ ! -e ${PID}/pid.log ]
then
echo "no ongoing flash, exit"
exit 1
fi
 
## print process info
PROCESS_NUM=`cat $PID/pid.log | wc -l`
echo -n "${PROCESS_NUM} flash processes ongoing: "
while read process
do
echo -n " ${process}"
done < ${PID}/pid.log
echo
 
## wait all flash processes done
PROCESS_NUM=`cat $PID/pid.log | wc -l`
P_DONE=0
while [ ${P_DONE} -lt ${PROCESS_NUM} ]
do
let "P_DONE=0"
sleep 5
echo -n "onging processes:"
while read process
do
if [ -e /proc/${process} ]
then
echo -n " ${process}"
else
let "P_DONE=P_DONE+1"
fi
done < ${PID}/pid.log
echo
done
 
echo "All Flash Done, exit!"
Flashing the Devices
1. Place all the Tegra devices into forced-recovery mode.
For details, see Flashing and Booting the Target Device.
2. Run the multi_tegra_flash.sh script with the following command:
$ sudo ./multi_tegra_flash.sh