How to change the default boot sequence of TX2?

The default boot sequence of tx2 is as follows,
•External SD card
•Internal eMMC (Jetson TX2 and Jetson TX2i only)
•USB device (Jetson TX2 and Jetson TX2i only)
•NFS device
We want to force put eMMC at the first place, So we change the cbo.dts file under l4t/bootloader directory to below,

/ {
    compatible = "nvidia,cboot-options-v1";
    boot-configuration {
        boot-order = "emmc", "sd", "usb", "net";
        tftp-server-ip = /bits/ 8 <192 168 0 1>;
        dhcp-enabled;
        /* remove dhcp-enabled if uncommenting static-ip configuration */
        /* static-ip = /bits/ 8 <0 0 0 0>;
        ¦* ip-netmask = /bits/ 8 <255 255 255 0>;
        ¦* ip-gateway = /bits/ 8 <0 0 0 0>;
        ¦*/
    };  
};

Next compile cbo.dts to bootloader/t186rf/cbo.dtb.
Then reflash tx2 by

sudo ./flash.sh jetson-tx2 mmcblk0p1

after rebooting, but it still boot from external sd card.
The boot sequence surely can be changed, but how? Please do give us some hints and tips.

That’s a wrong way to update boot sequence. Please follow below steps:

  1. Connect the TX2 to a host system using serial console and start a minicom session.
  2. Reboot the TX2 and hit any key when you see below U-boot messages:
U-Boot 2016.07-gd917e08cec (Jul 16 2019 - 16:56:43 -0700)                       
                                                                                
TEGRA186                                                                        
Model: NVIDIA P2771-0000-500                                                    
DRAM:  7.8 GiB                                                                  
MC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1                                          
*** Warning - bad CRC, using default environment                                
                                                                                
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   eth0: ethernet@2490000                                                   
Hit any key to stop autoboot:

NOTE: you have only a couple of secs to stop it.
3. Run below commands on the U-boot prompt that you just entered into.

Tegra186 (P2771-0000-500) # printenv boot_targets
Tegra186 (P2771-0000-500) # setenv boot_targets="mmc0 mmc1 usb0 pxe dhcp"
Tegra186 (P2771-0000-500) # saveenv
Tegra186 (P2771-0000-500) # reset

This should fix the booting sequence. Ordering of “mmcX” will depend on your rootfs placement.

Give it a try and hopefully, I have given correct information AFAIR.

1 Like

Hi garretzou,

The CBO is implemented for Xavier (t194) platform only.
For TX2, the boot-order sequence is using uboot.

Thanks, I see this way can change the boot order. But our product will have no console interface.

So my question is “By what method can we change the boot sequence of TX2 under normal boot?”

Appreciated for your information.

But I see cbo.dtb in the flash log when I flash tx2.

You mention “For TX2, the boot-order sequence is using uboot”. So I have to change U-boot source code and reflash U-boot binary file?

FYI, please refer the attachment.

flash_cbo_dtb_no_reuse.log (737 KB)

I think I can do it. Just adjust the mmc functions sequence in BOOT_TARGET_DEVICES in tegra-common-post.h file of u-boot source code.

Hi garretzou,

From your logs, the cbo.dtb is created by yourself. (In #1, compile cbo.dts to bootloader/t186rf/cbo.dtb)
The default image doesn’t have this file, only cbo.dts in bootloader folder.
Please download pure image and confirm again. Thanks!

Yes, I created it.

Thanks, I rebuilt a u-boot.bin to make internal emmc boot first, and it works.

Yes, I was gonna suggest the same when you mentioned that you don’t have access to the board’s serial console.

Hi, I just had to do this as well. The commands you suggested did not work for me. To edit the variable, I instead used the ‘editenv’ command.

Cheers

Hello,

May be something has changed in newer L4T versions. But good to know that editenv worked for you.