Custom linux kernel flashing on orin-nx nvme

Hi all,

I’m here to understand the custom kernel flashing on orn-nx nvme.

Based on my experience working with nano and xavier, I can specify the Linux kernel Image file with the switch -K when using flash.sh. something like below:

flash.sh -k <path_to_the_kernel>/boot/Image jetson-xavier-emmc mmcblk0p1

Now I’m taking similar approach in flashing my own kernel based on the below command:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml -p "-K source/kernel_r36.3/arch/arm64/boot/Image  -c bootloader/generic/cfg/flash_t234_qspi.xml" --network usb0 --showlogs  jetson-orin-nano-devkit external

It seems that it has no effect !

Note that, the kernel is compiled nice and without any problem.
Can you please help me with this matter ?

thanks

Hello,

I hope someone can provide a better solution, but meanwhile you can replace the default kernel image with your custom Image and remove -k option from the commands.

mv Linux_for_Tegra/kernel/Image Linux_for_Tegra/kernel/Image.bkp
mv my_Image Linux_for_Tegra/kernel/Image

Manuel Leiva
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com

Hi @ManuelLeiva

Thank you very much for your kind answer.

I actually did this but, no success.
Below is the last part of the output:

Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 

 Entering RCM boot

[   0.0082 ] mb1_t234_prod_aligned_sigheader.bin.encrypt filename is from --mb1_bin
[   0.0082 ] psc_bl1_t234_prod_aligned_sigheader.bin.encrypt filename is from --psc_bl1_bin
[   0.0082 ] rcm boot with presigned binaries
[   0.0084 ] Generating blob for T23x
[   0.0089 ] tegrahost_v2 --chip 0x23 0 --generateblob blob.xml blob.bin
[   0.0090 ] The number of images in blob is 19
[   0.0091 ] blobsize is 77655636
[   0.0092 ] Added binary blob_uefi_jetson_with_dtb_sigheader.bin.encrypt of size 3563584
[   0.0272 ] Added binary blob_pscfw_t234_prod_sigheader.bin.encrypt of size 310768
[   0.0275 ] Added binary blob_mce_flash_o10_cr_prod_sigheader.bin.encrypt of size 187120
[   0.0276 ] Added binary blob_tsec_t234_sigheader.bin.encrypt of size 176128
[   0.0277 ] Added binary blob_applet_t234_sigheader.bin.encrypt of size 279616
[   0.0277 ] Not supported type: mb2_applet
[   0.0278 ] Added binary blob_mb2_t234_with_mb2_cold_boot_bct_MB2_sigheader.bin.encrypt of size 439968
[   0.0279 ] Added binary blob_xusb_t234_prod_sigheader.bin.encrypt of size 164864
[   0.0280 ] Added binary blob_nvpva_020_sigheader.fw.encrypt of size 2164640
[   0.0285 ] Added binary blob_display-t234-dce_sigheader.bin.encrypt of size 12065152
[   0.0324 ] Added binary blob_nvdec_t234_prod_sigheader.fw.encrypt of size 294912
[   0.0335 ] Added binary blob_bpmp_t234-TE980M-A1_prod_sigheader.bin.encrypt of size 1027008
[   0.0338 ] Added binary blob_tegra234-bpmp-3767-0000-a02-3509-a02_with_odm_sigheader.dtb.encrypt of size 383232
[   0.0340 ] Added binary blob_camera-rtcpu-t234-rce_sigheader.img.encrypt of size 458096
[   0.0341 ] Added binary blob_adsp-fw_sigheader.bin.encrypt of size 414960
[   0.0342 ] Added binary blob_spe_t234_sigheader.bin.encrypt of size 270336
[   0.0343 ] Added binary blob_tos-optee_t234_sigheader.img.encrypt of size 1633344
[   0.0347 ] Added binary blob_eks_t234_sigheader.img.encrypt of size 9232
[   0.0348 ] Added binary blob_boot.img of size 53567488
[   0.0520 ] Added binary blob_tegra234-p3768-0000+p3767-0000-nv.dtb of size 244084
[   0.1066 ] All RCM required files are saved in rcm_blob folder
done.

*** no-flash flag enabled. Exiting now... *** 

User can run above saved command in factory environment without 
providing pkc and sbk keys to flash a device

Example:

    $ cd bootloader 
    $ sudo bash ./flashcmd.txt

Save initrd flashing command parameters to /home/ben/Desktop/test/Linux_for_Tegra/tools/kernel_flash/initrdflashparam.txt
/tmp/tmp.0UNpwIPFQf /home/ben/Desktop/test/Linux_for_Tegra
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
/tmp/tmp.0UNpwIPFQf/initrd /tmp/tmp.0UNpwIPFQf /home/ben/Desktop/test/Linux_for_Tegra
84190 blocks
cp: cannot stat '/home/ben/Desktop/test/Linux_for_Tegra/rootfs/usr/lib/modules/5.15.136-rt-tegra/updates/drivers/spi': No such file or directory
Cleaning up...

I am not sure what did you do there. Did you enable rt kernel in your new kernel image?

Hi @WayneWWW

No. I did not do that. Here is my building script

DEVKIT=${BASE_DIR}/${JETSON}/Linux_for_Tegra
export TEGRA_KERNEL_OUT=${BASE_DIR}/${JETSON}/kernel_${KERNEL}
export LOCALVERSION=-tegra
mkdir -p $TEGRA_KERNEL_OUT


make ARCH=arm64 mrproper
make ARCH=arm64 O=${TEGRA_KERNEL_OUT} LOCALVERSION=${LOCALVERSION} CROSS_COMPILE=${CROSS_COMPILE} ${DEF_CONFIG}
make ARCH=arm64 O=${TEGRA_KERNEL_OUT} LOCALVERSION=${LOCALVERSION} CROSS_COMPILE=${CROSS_COMPILE} -j32
sudo make ARCH=arm64 O=${TEGRA_KERNEL_OUT} INSTALL_MOD_PATH="${DEVKIT}/rootfs/" modules_install

Is your rootfs/kernel a clean one?

From what I saw, the flash process tries to access below path.

cp: cannot stat ‘/home/ben/Desktop/test/Linux_for_Tegra/rootfs/usr/lib/modules/5.15.136-rt-tegra/updates/drivers/spi’:

Generally, it should try to find “5.15.136-tegra” but not “5.15.136-rt-tegra”. This one with rt means it is from a RT patched kernel.

@WayneWWW

What you mentioned is exactly correct. I re-prepared rootfs and re-built the kernel.
it works very fine now with my build script.

The only thing is that, I have to copy/paste Image and Image.gz to the kernel/ directory of BSP, which is not a thing I want. I’ll try to flash with -K switch and if I get any success, I’ll share it here

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