how to create image for jetson nano SD card ready for distribution?

Hi,

can someone help me write a small straight forward guide for cloning jetson nano SD card into a ready for distribution image for many jetson-nano devices? i have read this documentation:[url]Welcome — Jetson Linux<br/>Developer Guide 34.1 documentation and read some of the forum threads, but it is still not clear for me what i need to do.

1- what is the best way to create the image? do i create image of the whole SD card or only the mmcblk0p1 partition or do i just copy the contents of the root file and put them in the L4T package fsroot file and run the flash.sh file? (i have installed the initial image through the ready jetson-nano image)

2- what is the correct way or the steps needed to make the image ready for flashing on a new SD card( taking into consideration that i want the image to be in first boot state and all defaults reset)

hello ibondokji,

you may making a image blob locally with the script files,
please also check this discussion thread for the steps, Topic 1057994.
thanks

hi @jerryChang,

how do i create this image? i saw this command :

sudo ./create-jetson-nano-sd-card-image.sh -o sd-blob.img -s 16G -r 100

do i hook my jetson nano in recovery mode and the script will automatically start cloning the sd card within my jetson nano?

also my sd card is of size 64gb of which 39gb are allocated is this the correct way to construct the command? :

sudo ./create-jetson-nano-sd-card-image.sh -o sd-blob.img -s 39G -r 100

hello ibondokji,

that’s not correct, you should customize you rootfs and you’ll need to execute those commands on your host to generate a blob.
since Nano working with sdcard, you may also check 3rdparty tools which could duplicate sdcard as quick solutions.
thanks

Hi Jerrychang,

so in other words, copying the content in the sd root directory into rootfs inside linux_for_tegra file and then excuting the above command should work? and then i can rename the image to system.img and move it inside bootloader then excute the flash script with -r option and the img will be flashed to the new sd card in first boot state( having all my software, but without old user credentials)

if this is correct what is the size of blob image i should chose ? similar to the size of the rootfs content?

thanks

hello ibondokji,

running that script actually generate an image from your local rootfs, and it also create partitions.
suggest you could use the Etcher tool to install the image blob into another new sdcard.

yes, you could modify the size configurations.

please also check Getting Started With Jetson Nano Developer Kit, and refer to [Write Image to the microSD Card] session for more details.
thanks

hi JerryChang,

i know about the Etcher tool, it is what i used first time ran my jetson nano. but i want to clone the sd card to different jetson device with flash.sh -r so i can reset the defaults.

i have copied my root to rootfs and currently executing create-jetson-nano-sd-card-image.sh, i will let you know whether it works.

thanks

Hello JerryChang,

You said:

“running that script actually generate an image from your local rootfs, and it also create partitions.
suggest you could use the Etcher tool to install the image blob into another new sdcard.”

In my case, after run “create-jetson-nano-sd-card-image.sh”, do create a blob image file in L4T folder. But when I use Etcher to load in that blob image file, Etcher remind the image file there are no partitions and could not boot up. Any idea for the problem?

Thanks,
Yong

hello yong.gao,

please refer to Topic 1057994 or Write Image to the microSD Card for detail steps.
you may also share the failure message or the screenshot of the error code for reference.
thanks

Hello JerryChang,

Attached my creating sd image log here. New created img file load into Etcher got no partition warning.

ygao@ygao-VirtualBox:~/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra$ sudo ./create-jetson-nano-sd-card-image.sh -o sd-blob.img -s 16G -r 200
[sudo] password for ygao:


 Jetson-Nano SD Image Creation Tool     

create-jetson-nano-sd-card-image.sh - creating sd-blob.img of 16G…
0+0 records in
0+0 records out
0 bytes copied, 0.000124465 s, 0.0 kB/s
create-jetson-nano-sd-card-image.sh - creating signed images
###############################################################################

L4T BSP Information:

R32 , REVISION: 2.0

###############################################################################
Board ID(3448) version(200)
copying bctfile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg)… done.
copying bootloader(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/cboot.bin)… done.
copying initrd(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/l4t_initrd.img)… done.
populating kernel to rootfs… done.
populating initrd to rootfs… done.
populating /home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb to rootfs… done.
Making Boot image… done.
Existing sosfile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/nvtboot.bin)… done.
copying cpu_bootloader(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/cboot.bin)… done.
copying bpffile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/sc7entry-firmware.bin)… done.
Existing badpagefile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/badpage.bin) reused.
copying wb0boot(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/warmboot.bin)… done.
Existing tosfile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb)… done.
Copying nv_boot_control.conf to rootfs
Skip generating system.img
Existing tbcfile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb)… done.
copying cfgfile(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/cfg/flash_l4t_t210_spi_sd_p3448.xml) to flash.xml… done.
copying flasher(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/cboot.bin)… done.
Existing flashapp(/home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/tegraflash.py) reused.
./tegraflash.py --bl cboot.bin --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --odmdata 0x94000 --bldtb tegra210-p3448-0000-p3449-0000-a02.dtb --applet nvtboot_recovery.bin --cmd “flash; reboot” --cfg flash.xml --chip 0x21 --bins “EBT cboot.bin; DTB tegra210-p3448-0000-p3449-0000-a02.dtb”
saving flash command in /home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/flashcmd.txt
saving Windows flash command to /home/ygao/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra/bootloader/flash_win.bat
*** no-flash flag enabled. Exiting now… ***
/usr/bin/env: ‘python’: No such file or directory
ygao@ygao-VirtualBox:~/nvidia/nvidia_sdk/JetPack_4.2.1_Linux_GA_P3448/Linux_for_Tegra$

Hello JerryChang,

When I load created “sd-blob.img” file into Etcher, got bellow warning message:

“It looks like this is not a bootable image.
The image does not appear to contain a partition table, and might not be recognized or bootable by your device”

hello yong.gao,

did you setup a virtual machine environment for flashing the board?

the script file, create-jetson-nano-sd-card-image.sh, will also execute flash.sh to generate singed files, and also create partitions.
you should read below messages after complete the whole process.
for example,

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   
********************************************
   Jetson-Nano SD Image Creation Complete   
********************************************

Hello JerryChang,

After connected Nano board to host computer and flashed, I can successfully create SD image file. But got a new problem. That Nano board had been flashed cannot boot any more. Any idea about it? (It was working before flash) Is it possible HW issue or some on board Flash memory content had been changed? (I have two Nano boards, new created SD image is tested in another Nano board to prove it is working)

Thanks,
Yong

you board could be stuck in force recovery mode.
check this post : Nano Stuck in Recovery Mode - Jetson Nano - NVIDIA Developer Forums

Hello JerryChang,

I am following the link suggested method to reflash the nano board. Have tried sdkmanager and flash.sh script, also tried different sdk reversions, but got similar results. The flashing processing will stuck on some steps and never finish (waited more than 24 hours). How to fix the cannot flashing issue?

Thanks,
Yong
failed_flashing_log.txt (17.3 KB)

hello yong.gao,

it seems you’re indeed working with a virtual machine environment for flashing the board.

ygao@ygao-VirtualBox:~/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra$ sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 2.1
###############################################################################
# Target Board Information:
# Name: jetson-nano-qspi-sd, Board Family: t210ref, SoC: Tegra 210, 
# OpMode: production, Boot Authentication: , 
###############################################################################
....
[   1.6786 ] 
[   1.6787 ] Retrieving storage infomation
[   1.6802 ] tegrarcm --oem platformdetails storage storage_info.bin
[   1.6819 ] Applet is not running on device. Continue with Bootloader
[   2.4533 ]

there might be communication issue between your Nano and virtual machine, suggest you may tried to working with ubuntu environment.
Or, you might refer to Topic 1002081, and this getting started web page for installing necessary packages.
thanks

Thanks JerryChang,

The nano board stuck on recovery mode issue have been resolved. The VertualBox is not working in my side. After changing to VMware, I can successfully flash the nano board.

I confirmd this “-r” option has 3 IDs. a01, a02, b00… What is it means?
Would I need to switch this option by hardware revision?

can you please share the documentation for creating custom image for jetson nano …

2 Likes

Please provide steps to take image with installed package and files from jetson nano board. As of now we used dd cmd and took backup, for 15GB size it took around 24 GB image file. Any other option to take image ?
Any help appreciated!! Thanks