NX Cloning for Cross Compile Fails

Hi,

I’m trying to follow the instructions for setting up cross compiling. Setting Up Cross-Platform Support

Follow the instructions “To clone a Jetson device and flash” under Basic Flashing Procedures in the Jetson Linux Driver Package Developer Guide to clone the target rootfs.

I’ve tried several times now but, the clone command always fails.

Am I doing something wrong? Or, is making a clone via USB a process that is so time consuming and difficult that it often fails?

Could I make the clone a different way given that this is a dev kit and the file system is on an SD card?

My host is Ubuntu 18.04. I’m installing JetPack 4.5.1.

I used SDK Manager to flash the NX dev kit. After that I updated the NX and installed various packages that we use.

I’ve seen Xavier Cloning but it is a very long and complicated topic, so perhaps I’ve missed something. (I thought I might try snarky’s suggestion for cloning not in recovery mode next.)

To make the clone I’m doing:

sudo ./flash.sh -r -k APP -G clone.img jetson-xavier-nx-devkit mmcblk0p1 |tee clone-log.txt

./flash.sh runs for sometime. When it finishes it leaves clone.img and clone.img.raw but I don’t think they are correct clones because there is an error message and clone.img.raw is not mountable.

Each time I’ve tried clone.img.raw has a slightly different size.

Does Error: Return value 14 means anything to anyone?

Summary of transcript:

v4@ubuntu-18v4-sdkmgr:~/nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra$ sudo ./flash.sh -r -k APP -G clone.img jetson-xavier-nx-devkit mmcblk0p1 |tee clone-log.txt
[sudo] password for v4:
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 5.1
###############################################################################
# Target Board Information:
# Name: jetson-xavier-nx-devkit, Board Family: t186ref, SoC: Tegra 194,
# OpMode: production, Boot Authentication: NS,
# Disk encryption: disabled ,
###############################################################################
copying soft_fuses(/home/v4/nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/bootloader/t186ref/BCT/tegra194-mb1-soft-fuses-l4t.cfg)... done.
./tegraflash.py --chip 0x19 --applet "/home/v4/nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/bootloader/mb1_t194_prod.bin" --skipuid --soft_fuses tegra194-mb1-soft-fuses-l4t.cfg --bins "mb2_applet nvtboot_applet_t194.bin" --cmd "dump eeprom boardinfo cvm.bin;reboot recovery"
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands

[   0.0032 ] Generating RCM messages
[   0.0042 ] tegrahost_v2 --chip 0x19 0 --magicid MB1B --appendsigheader /home/v4/nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/bootloader/mb1_t194_prod.bin zerosbk

...

   9.3420 ] tegradevflash_v2 --read APP /home/v4/nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/clone2.img
[   9.3444 ] Bootloader version 01.00.0000
[   9.3902 ] 000000000d0f010e: t read %lu bytes from partition %s.4%
[ 4281.7290 ]
[ 4281.7290 ]
Error: Return value 14
Command tegradevflash_v2 --read APP /home/v4/nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/clone2.img
*** The [APP] has been read successfully. ***
        Converting RAW image to Sparse image... v4@ubuntu-18v4-sdkmgr:~/nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra$  ls -l clone.img clone.img.raw
-rwxr-xr-x 1 root root 18042134652 Dec 14 18:54 clone.img
-rw-r--r-- 1 root root 36069965824 Dec 14 18:52 clone.img.raw
v4@ubuntu-18v4-sdkmgr:~/nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra$

I tried 2 of the other suggestions for making a clone but didn’t get either to work. :-(

The first suggestion, i.e., (ssh xavier sudo find / -xdev -depth -print | sudo cpio -o -H crc | gzip) > xavier-root-file-system.cpio.gz, didn’t work for me because I got in a mess with users, groups, access permissions and passwords. It kept asking for passwords for sudo but whichever password I used didn’t work. As it happens, the users and their passwords are different between the host and target; I wondered if this makes things more difficult.

The netcat suggestion didn’t work because it kept running until I filled the SSD on the host. Something like netcat -l -p 16998 > netcat-clone.img on the host and then echo u > /proc/sysrq-trigger; dd if=/dev/mmcblk0p1 | netcat ubuntu-18v4-sdkmgr.local 16998 on the target. Obviously I don’t understand and must be doing something wrong!

hello MattBr,

the flash commands -r -k APP -G clone.img it doesn’t works for cloning rootfs image on SD card.
may I know what’s the actual use-case? for example, are you going to deploy your image to multiple Xavier NX devices?

Hi Jerry,

Ok, good to know.

We wanted to see if we could cross-compile our application. It’s quite large and a full build on the NX takes quite a long time.

I was just following the instructions for setting up cross compiling. Setting Up Cross-Platform Support

I don’t necessarily need to make a full clone of the rootfs. I only need to do what is necessary to set up the cross environment. Or, happy to take other approaches to create the cross environment.

One option might be to use a production NX, we have some around. It’s just that we usually use the dev kits for development and I had one to hand so it is what I used when following the instructions.

Thanks,
Matt

Clearly I was being silly!

Because it is a dev kit and I’m using an SD card I can just switch off the dev kit and use the SD card in the host system. I needed an SD card to USB converter, luckily I had one at home!

When I connected the SD card Ubuntu 18.04 auto mounted it, easy!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.