Issues Building Custom Kernel 36.4 for Jetson Orin Nano Dev Kit
Issue Overview
Users are experiencing difficulties when attempting to build a custom kernel for the Nvidia Jetson Orin Nano Developer Kit 8GB using JetPack 6.1 (Linux for Tegra 36.4). The main symptoms include:
- The output kernel image is smaller than expected (29MB) even when enabling additional modules
- Compilation errors occur for the "nvidia-oot" module, specifically:
- "clk/tegra/clk-bpmp.c:673:5: error: redefinition of ‘tegra_bpmp_init_clocks’"
- "/reset/tegra/reset-bpmp.c:67:5: error: redefinition of ‘tegra_bpmp_init_resets’"
- These issues persist when using different build methods, including native compilation on the device, cross-compilation with SDK Manager, and using various build scripts
Possible Causes
- Incorrect build process or environment setup
- Incompatibility between custom kernel configurations and Nvidia’s proprietary drivers
- Conflicts in header files or function definitions related to the Tegra bootloader power management processor (BPMP)
- Issues with the toolchain or build dependencies
Troubleshooting Steps, Solutions & Fixes
-
Ensure proper setup of the build environment:
-
Download the correct JetPack kernel sources:
wget https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.0/sources/public_sources.tbz2
-
Install necessary dependencies:
sudo apt install wget lbzip2 build-essential bc zip libgmp-dev libmpfr-dev libmpc-dev vim-common libncurses-dev bison flex libssl-dev libelf-dev
-
-
Set up the build directory and extract sources:
cd ~/nvidia/nvidia_sdk/JetPack_6.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra tar -xjf public_sources.tbz2 Linux_for_Tegra/source/kernel_src.tbz2 --strip-components 2 tar -xjf public_sources.tbz2 Linux_for_Tegra/source/kernel_oot_modules_src.tbz2 --strip-components 2 tar -xjf public_sources.tbz2 Linux_for_Tegra/source/nvidia_kernel_display_driver_source.tbz2 --strip-components 2
-
Set environment variables:
export DEVDIR=~/nvidia/nvidia_sdk/JetPack_6.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra export CROSS_COMPILE=$HOME/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu- export INSTALL_MOD_PATH=$DEVDIR/rootfs/ export KERNEL_HEADERS=$DEVDIR/sources/kernel/kernel-jammy-src
-
Create and populate the sources directory:
cd $DEVDIR mkdir sources tar -xjf kernel_src.tbz2 -C sources tar -xjf kernel_oot_modules_src.tbz2 -C sources tar -xjf nvidia_kernel_display_driver_source.tbz2 -C sources
-
Configure and build the kernel:
cd $DEVDIR/sources/kernel/kernel-jammy-src make menuconfig cd $DEVDIR/sources make -C kernel sudo -E make install -C kernel
-
Build and install device tree and modules:
make dtbs cp nvidia-oot/device-tree/platform/generic-dts/dtbs/* $DEVDIR/kernel/dtb/ make modules sudo -E make modules_install
-
If custom kernel configurations are causing issues, try building with the default configuration first, then gradually add your custom changes while testing for errors after each modification.
-
Pay attention to warnings during the build process, especially those related to symbol definitions and module dependencies. Address these warnings if possible, as they may lead to runtime issues.
-
If errors persist, carefully review your custom kernel configurations to ensure they don’t conflict with Nvidia’s proprietary drivers or BPMP-related functions.
-
Consider using a clean build environment for each attempt, as residual files from previous builds may cause conflicts.
-
If the issue persists after following these steps, consider reaching out to Nvidia’s developer support or community forums with detailed logs and information about your specific custom kernel requirements.