How to put customized cboot into SD image

Hi,
I am working on a NX develop kit for the booting process. I want to modify the cboot to reduce the boot up time. My first test is to remove the shell interrupt from user by commenting out the “enter_shell_upon_user_request()” function. Following the instruction in the package I built the source and copied the “lk.bin” to Linux_for_Tegra/bootloader/ and renmaed it to “cboot_t194.bin”.
Then in Linux_for_Tegra/tools directory, I use “jetson-disk-image-creator.sh” to generate a SD image as I did before. But the modification is not in the image since I still see the wait prompt “4 3 2 1” displayed on the serial console.
What do I miss ? Please help.
Thanks,

–Stuart

Hi,

You cannot put the cboot into sdcard image because the partition for cboot is not in sdcard image at all.

Please read the partition layout of NX and you will find there are two devices (QSPI and sdcard) that are needed for boot up.

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

WayneWWW, thank you for your help. Since I am totally new in the BSP world, I need some more detailed advice. I went through the “Partition Configuration” and learned that the " Jetson Xavier NX Development Module (P3668-0000) SD Card Partition" does not contains partition for CBoot. Even though NX does not use UBoot it has a partition for UBoot (Kernal and Kernal_b). why?
Secondly and more important to me, the " Jetson Xavier NX Production Module (P3668-0001) QSPI_NOR Partition" contains CBoot. How can I put my customized cboot there? I guess use the USB-C port and run the flash script. Could you provide the details for me?
Thanks,

–Stuart

I bootup the NX developer kit in recovery mode. Then run the following in command prompt:
sudo ./flash.sh -k cpu-bootloader --image ./bootloader/cboot_t194.bin jetson-xavier-nx-devkit mmcblk0p1
The cboot_t194.bin was compiled with “enter_shell_upon_user_request()” commented out in platform.c.
But the 2 seconds waiting (displayed “4 3 2 1” on the serial console) is still there.
Can anyone tell me what I missed?
Thanks,
–Stuart

Even though NX does not use UBoot it has a partition for UBoot (Kernal and Kernal_b). why?

We put the kernel image and initrd in this partition. There should be no uboot.
This is a document error. We will correct it soon.

sudo ./flash.sh -k cpu-bootloader --image ./bootloader/cboot_t194.bin jetson-xavier-nx-devkit mmcblk0p1

I think you could try

sudo ./flash.sh -r -k cpu-bootloader jetson-xavier-nx-devkit mmcblk0p1

and just put the cboot binary to Linux_for_Tegra/bootloader/cboot_t194.bin.

The cboot_t194.bin was compiled with “enter_shell_upon_user_request()” commented out in platform.c.
But the 2 seconds waiting (displayed “4 3 2 1” on the serial console) is still there.

I think you could firstly put some pr_info to print some string to prove the cboot binary is really updated by you.

WayneWWW, thank you for the response. I tried
sudo ./flash.sh -r -k cpu-bootloader jetson-xavier-nx-devkit mmcblk0p1
and
sudo ./flash.sh -r -k cpu-bootloader -k cpu-bootloader_b jetson-xavier-nx-devkit mmcblk0p1
Both of the flash result in a infinite loop in cboot. But the following worked:
sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1
I see the right cboot running after the whole devices flash.

Thanks,

–Stuart

1 Like