To clone a Jetson device and flash
// 如何克隆英伟达Jetson系列的设备系统和烧录
1. Copy system.img from the filesystem partition you want to flash from. Enter this command:
// 短接Recovery+GND两个引脚,给Jetson device (Xavier NX)上电,通过专用烧录的usb口连 // 接到烧录开发电脑(Ubuntu~18.04)上,如果是虚拟机的话请确保设备是连接到虚拟机里的 // Ubuntu中。然后执行如下命令:
$ sudo ./flash.sh -r -k APP -G <clone> <board> mmcblk0p1
我实际操作的命令:
sudo ./flash.sh -r -k APP -G clone-xavier-nx-20240222 jetson-xavier-nx-devkit-emmc mmcblk0p1
Where:
• <clone> determines the names of the copies.
// <clone> 为 clone-xavier-nx-20240222 克隆出的文件
• <board> specifies the configuration of the target device.
//<board>和上篇博客提到一样,为jetson-xavier-nx-devkit-emmc,详细自行查阅
This step creates two copies of <clone> in the <top> directory: a sparsed image (smaller than the original) named <clone>, and an exact copy named <clone>.raw.
// 在克隆过程会耗时较长,请耐心等待,执行完克隆命令后,
// 即可在/r32.7.2_sources-sdk/Linux_for_Tegra产生两个文件,
//分别为:clone-xavier-nx-20240222 和clone-xavier-nx-20240222.raw
For example, if <clone> is original.img, flash.sh creates a sparsed image named original.img and an exact copy named original.img.raw.
3. Copy <clone>.img to the <L4T>/bootloader/system.img directory. Enter this command:
$ sudo cp <clone>.img bootloader/system.img
4. Flash the image to the target board.
//如何将镜像烧录到主板上
• If the target board has already been flashed, reflash the clone image to the APP partition. Enter this command:
// 如果主板已经烧录过,重新烧录的话可参考如下命令,
// <board>的参数即“ jetson-xavier-nx-devkit-emmc ”,参考上面,不过多陈述
$ sudo ./flash.sh -r -k APP <board> mmcblk0p1
• If the target board has never been flashed, flash all of the board’s partitions. Enter this command:
// 这烧录命令和我上个博客提到的一样:英伟达Xavier NX 开发系列之烧录环境的搭建-CSDN博客
$ sudo ./flash.sh -r <board> mmcblk0p1
总结:
个人认为注意事项在于,需要搞清把主板上的recovery+GND两个pin脚短接,进入recovery模式,烧录也好,克隆也好,也都是需要在此模式进行。另外一个要注意的时候,就是克隆出来两个文件,先把之前的那个原有的Linux_for_Tegra/bootloader/system.img 先备份起来 ,mv system.img system-bak.img,
再把新克隆出来的Linux_for_Tegra/clone-xavier-nx-20240222,
mv到Linux_for_Tegra/bootloader下面, 重命名为system.img
mv Linux_for_Tegra/clone-xavier-nx-20240222 Linux_for_Tegra/bootloader/system.img