Issues Flashing Custom Kernel on Jetson Board (Working Natively)


Hello, we have successfully customized our kernel for JetPack 6 and Jetson Linux 36.3 (with GadgetFS enabled and ConfigFS disabled). According to the documentation, the custom kernel should be flashed to the board. However, we are unable to flash our custom kernel successfully, though we can install it natively and it works fine.

We followed the instructions in this link to generate the following DTSI files:

  • pinmux.dtsi
  • gpio.dtsi
  • padvoltage.dtsi

The issue we are facing is that, even though we are able to install the kernel natively, we are not able to flash it. The documentation suggests the kernel should be flashed, but we’re unsure how to proceed. We would appreciate any suggestions on how to install or flash the kernel correctly to our custom board. For more context on this issue, you can refer to this forum post.

Hello @kondruabhay,

What do you mean by “Install the kernel natively”?

regards,
Andrew
Embedded Software Engineer at ProventusNova

Hello proventusnova,

Thank you for your response. To clarify, “installing the kernel natively” refers to flashing the default kernel image following this guide from NVIDIA. Here’s an overview of the process we used:

  1. After flashing and booting up the Jetson Developer Kit, we downloaded the BSP sources from this NVIDIA link.

  2. Installed build essentials with:

    sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev
    
  3. Extracted the BSP sources:

    tar xf public_sources.tbz2
    
  4. Under /LinuxForTegra/Source, we extracted the kernel, out-of-tree modules, and NVIDIA display modules sources. Then, under /kernel/kernel_jammy_src, we configured the kernel:

    make ARCH=arm64 LOCALVERSION=mod-tegra defconfig
    make ARCH=arm64 LOCALVERSION=mod-tegra menuconfig
    

    Here, we enabled gadgetfs by navigating to:

    device drivers --> USB support --> USB gadget support --> Disable ConfigFS --> gadget
    
  5. Compiled the Linux kernel image with:

    make ARCH=arm64 LOCALVERSION=-mod-tegra -j6 Image
    
  6. Compiled the loadable kernel modules:

    make ARCH=arm64 LOCALVERSION=-mod-tegra -j6 modules
    
  7. Installed the compiled kernel modules:

    sudo make modules_install
    
  8. Copied the built image from arch/arm64/boot/ to /boot/Image:

    cp arch/arm64/boot/Image /boot/Image
    
  9. Under Linux_for_Tegra/source/, we set the KERNEL_HEADERS environment variable:

    export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
    
  10. Compiled and installed additional modules:

make modules
sudo -E make modules_install
  1. Updated the initrd:
sudo nv-update-initrd
  1. Finally, rebooted the device to complete the installation of the customized kernel.

This process enabled us to successfully install our customized kernel.

Best regards,
Kondru Abhay

Hello @kondruabhay,

Thanks for the clarification.

Now, quick question.
If you are able to follow that process successfully, what is the flashing procedure that is failing for you?

regards,
Andrew
Embedded Software Engineer at ProventusNova

Hello proventusnova,

The procedure encountering issues is detailed below:

  1. Navigate to Linux_for_Tegra/source/kernel/kernel-jammy-src/ and execute the following commands:

    make ARCH=arm64 LOCALVERSION=-davey-tegra defconfig
    make ARCH=arm64 LOCALVERSION=-davey-tegra menuconfig
    make ARCH=arm64 LOCALVERSION=-davey-tegra -j8 Image
    make ARCH=arm64 LOCALVERSION=-davey-tegra -j8 modules
    sudo make modules_install INSTALL_MOD_PATH=/Linux_for_Tegra/rootfs
    

    Then, manually copy the Image file into:

    • Linux_for_Tegra/kernel/Image
    • Linux_for_Tegra/rootfs/boot/Image
  2. In Linux_for_Tegra/source/, run the following:

    export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
    make modules
    export INSTALL_MOD_PATH=Linux_for_Tegra/rootfs
    sudo -E make modules_install
    
  3. In Linux_for_Tegra/, execute:

    sudo ./tools/l4t_update_initrd.sh
    
  4. Finally, flash the device.

I based this method on a discussion from this thread.

Best regards,
Kondru Abhay

Hey @kondruabhay,

Thanks for the explanation, that makes it very clear.

Have you tried running the apply_binaries.sh script before flashing?

regards,
Andrew
Embedded Software Engineer at ProventusNova

Hello @proventusnova,

I haven’t tried that yet because, according to the discussion in this link, it is suggested not to use this command, as it overwrites the updated initrd image with the one provided by the current BSP package.

Best regards,
Kondru Abhay

@kondruabhay,

I believe the issues is that the custom kernel is just not being added as part of the rootfs image. Which the apply_binaries script should help with.

Would you be opposed to making a copy of the directory and trying out with running the script?

regards,
Andrew
Embedded Software Engineer at ProventusNova

Hello @proventusnova,

Sure, we will try this approach once I have access to the board. I will get back to you soon.

Best regards,
Kondru Abhay

@kondruabhay,

Sounds like a plan!

Please keep me posted.
If that doesn’t work, we will try to look for other options.

regards,
Andrew
Embedded Software Engineer at ProventusNova

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