Jetson Xavier nx production kit boot from sd card issue(reboot.. continue)

we use the xavier nx production kit with our carried board with sd card and emmc.
the emmc space is not enough for my application. so we want to move the rootfs to sd card.
flowing the step:
Boot_From_External_Device
it can find the rootfs in sd card. but show Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00. reboot…
the attached file is the loglog.txt (110.4 KB)

Hello @haihui.pang,

Please try the following:

  1. Flash your eMMC device with the base image (prior to loading your application) and boot the Jetson
  2. Insert the SD Card, format it and create an ext4 partition
  3. Mount your SD card and copy the rootfs into it (for example, like in this post linked here)
  4. Change the extlinux.conf file under /boot/extlinux. In the APPEND entry, replace root=/dev/mmcblk0p1 by your SD card partition.
  5. Reboot

By then, the bootloader should be able to boot from the SD Card so you can the load your application.

@mike_nv
thanks for reply.
in the link https://forums.developer.nvidia.com/t/how-to-boot-from-nvme-ssd/65147/15

sudo rsync -aAXv / --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/mnt/","/media/*","/lost+found"} /mnt

only copy /dev/","/proc/","/sys/","/tmp/","/run/","/mnt/","/media/*
can i copy all the rootfs file?
because i want to copy all the rootfs files to sd card. then, delete the rootfs in emmc, the emmc have enough space to use.

it has the same issue.
1,I flash emmc device with base image. ./flash.sh jetson-xavier-nx-devkit mmcblk0p1
nx device enter ubuntu, change the /boot/extlinux/extlinux.conf root=/dev/mmcblk1p1

2, in host PC. I format my sd card and create an ext4 partiton.
cpoy Linux_for_Tegra\rootfs to sd card
cd rootfs sudo tar -cpf - * | ( cd /mnt/ ; sudo tar -xpf - )

3, insert the sd card into NX device.
4. poweron the NX device
the attached file is log.log1.txt (100.6 KB)
it has the same issue:
[ 9.591689] Extcon HDMI: HPD enabled
[ 9.591828] tegradc 15200000.nvdisplay: hdmi: plugged
[ 9.634279] Root device found: mmcblk1p1
[ 9.637058] Found dev node: /dev/mmcblk1p1
[ 9.737467] EXT4-fs (mmcblk1p1): recovery complete
[ 9.738907] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null)
[ 9.741176] Rootfs mounted over mmcblk1p1
[ 9.790233] Switching from initrd to actual rootfs
[ 9.822909] usb 2-3: new SuperSpeed USB device number 2 using tegra-xusb
[ 9.845667] usb 2-3: New USB device found, idVendor=05e3, idProduct=0626
[ 9.847154] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 9.848561] usb 2-3: Product: USB3.1 Hub
[ 9.849931] usb 2-3: Manufacturer: GenesysLogic
[ 9.854661] hub 2-3:1.0: USB hub found
[ 9.856776] hub 2-3:1.0: 4 ports detected
[ 9.891757] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007e00
[ 9.891757]
[ 9.894497] CPU: 3 PID: 1 Comm: chroot Tainted: G W 4.9.140-tegra #165
[ 9.895916] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 9.897312] Call trace:
[ 9.898606] [] dump_backtrace+0x0/0x198
[ 9.899957] [] show_stack+0x24/0x30
[ 9.901307] [] dump_stack+0x98/0xc0
[ 9.902635] [] panic+0x11c/0x298
[ 9.903953] [] do_exit+0xa04/0xa08
[ 9.905265] [] do_group_exit+0x40/0xa8
[ 9.906588] [] __wake_up_parent+0x0/0x40
[ 9.907915] [] el0_svc_naked+0x34/0x38
[ 9.909240] SMP: stopping secondary CPUs
[ 9.910519] Kernel Offset: disabled
[ 9.911786] Memory Limit: none
[ 9.913021] trusty-log panic notifier - trusty version Built: 21:16:17 Jun 25 2020 [ 9.921054] Rebooting in 5 seconds…

Hi @haihui.pang,

I did a quick test and could boot from the SD card partition.

Please take a look at the kernel boot sequence for Cboot here:

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fbootflow_jetson_xavier.html%23wwpID0E0FB0HA

Cboot will search for a bootable partition in an external SD card prior to looking into the eMMC. The extlinux.conf file that has to be updated in the one sitting on your new SD card partition, which will be the first to be checked by the bootloarder. Please make sure the SD partition you are point to is the one where you have a valid filesytem. You can check it by issuing the command lsblk.

Your eMMC install would operate as a “recovery partition”, in case Cboot does not find a bootable partition in the first 2 options, as described in the documentation.

Please make sure that you SDIO controller is properly configured. Have you been using a custom carrier board?

@mike_nv
can you show me the step which you test?
Maybe I was wrong in some step.

I use the carrier board.
my SDIO controller of my sd card configure modify is below:
sdhci_sd1: sdhci@3440000 {
mmc-ocr-mask = <0x0>;
cd-inverted;
// panghh-- cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 7) 0>;
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 2) 0>;
nvidia,cd-wakeup-capable;
mmc-ocr-mask = <0>;
cd-inverted;
vmmc-supply = <&p3668_vdd_sdmmc1_sw>;
status = “okay”;
};

            p3668_vdd_sdmmc1_sw: regulator@106 {
                    compatible = "regulator-fixed";
                    reg = <106>;
                    regulator-name = "vdd-sdmmc1-sw";
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
            //panghh--      gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 2) 0>;
                    gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 5) 0>;
                    enable-active-high;
            };

I can do it success. thankyou