Skip to content

Cart

Your cart is empty

How to Compile Forecr Xavier Kernel?

ENVIRONMENT

Operating System: Ubuntu 20.04 LTS

CPU: AMD Ryzen 9 3900X 12-Core Processor

RAM: 32 GB DDR4 - 3200MHz

In this blog post, we will compile the “forecr_xavier_kernel” for Jetson AGX Orin, AGX Xavier Series, Orin NX, Orin Nano, Xavier NX & TX2 NX modules. First, we will install the required packages. Then, we will download the kernel source repository and compile it. Finally, we will export the binaries.

Installing the Development Packages

First of all, install some development packages on your host PC(git, build-essential, ncurses-dev, xz-utils, bzip2, libssl-dev, bc, flex, libelf-dev, bison) with this command:


sudo apt install git build-essential ncurses-dev xz-utils bzip2 libssl-dev bc flex libelf-dev bison vim-common unzip wget


Select the right JetPack version from here. In this tutorial, we will continue to the “35.6.0” version.


Then, download the GCC archive to compile the kernel sources:


Create “l4t-gcc” folder in your $HOME directory and extract the GCC archive into it (or you can extract it in another folder as well).

Downloading & Compiling the Kernel

Our custom kernel source shared from here. You can check the latest published JetPack versions on it.


Now, download the kernel source with this command below (Its location does not require in a specific path):


git clone -b {JetPack Version} https://github.com/forecr/forecr_xavier_kernel.git

For this tutorial, we cloned the “5.1.4” version of JetPack.


git clone -b Jetpack-5.1.4 https://github.com/forecr/forecr_xavier_kernel.git


Then, let’s check the “environment_nvidia” file.

Be careful about “CROSS_COMPILE” environment’s definition. If you located the GCC compiler in another path, you should update this environment (In our setup, we do not need to change it).


Open a new terminal on this folder and type these commands to set the environment: 


cd ./kernel/kernel-5.10/
source ../../environment_nvidia


Now, it’s time to compiling the kernel for different device types. 


    • For DSBOARD_XV2 with AGX Xavier SoM, type these commands below:


make ARCH=arm64 O=$HOME/kernel_out_dsboard_xv2 dsboard_xv2_defconfig
make ARCH=arm64 O=$HOME/kernel_out_dsboard_xv2 -j$(($(nproc)-1))


    • For DSBOARD_AGX & DSBOARD_AGXMAX with AGX Orin SoM, type these commands below:


make ARCH=arm64 O=$HOME/kernel_out_dsboard_agx dsboard_agx_defconfig
make ARCH=arm64 O=$HOME/kernel_out_dsboard_agx -j$(($(nproc)-1))


    • For RAIBOARD_AGX with AGX Orin SoM, type these commands below:


make ARCH=arm64 O=$HOME/kernel_out_raiboard_agx raiboard_agx_defconfig
make ARCH=arm64 O=$HOME/kernel_out_raiboard_agx -j$(($(nproc)-1))


    • For RAIBOARD_ORNX with Orin NX SoM, type these commands below:


make ARCH=arm64 O=$HOME/kernel_out_raiboard_ornx raiboard_ornx_defconfig
make ARCH=arm64 O=$HOME/kernel_out_raiboard_ornx -j$(($(nproc)-1))


    • For DSBOARD_ORNX, DSBOARD_ORNXLAN & DSBOARD_ORNXS with Orin NX or Orin Nano SoM, type these commands below:


make ARCH=arm64 O=$HOME/kernel_out_dsboard_ornx dsboard_ornx_defconfig
make ARCH=arm64 O=$HOME/kernel_out_dsboard_ornx -j$(($(nproc)-1))


    • For DSBOARD_NX2 with Xavier NX SoM, type these commands below:


make ARCH=arm64 O=$HOME/kernel_out_dsboard_nx2 dsboard_nx2_defconfig
make ARCH=arm64 O=$HOME/kernel_out_dsboard_nx2 -j$(($(nproc)-1))


    • For MILBOARD_AGX with AGX Xavier & AGX Orin SoM, type these commands below:


make ARCH=arm64 O=$HOME/kernel_out_milboard_agx milboard_agx_defconfig
make ARCH=arm64 O=$HOME/kernel_out_milboard_agx -j$(($(nproc)-1))


    • For MILBOARD_XV with AGX Xavier & AGX Orin SoM, type these commands below:


make ARCH=arm64 O=$HOME/kernel_out_milboard_xv milboard_xv_defconfig
make ARCH=arm64 O=$HOME/kernel_out_milboard_xv -j$(($(nproc)-1))


At this point, we compiled the kernel source for DSBOARD-ORNX with Orin NX SoM.


A few minutes later …

Exporting the Binaries

After the kernel compiling progress ended, we can move on to export the BSP files (Image and DTB file). 


    • For DSBOARD_ORNX with Orin NX SoM, type these commands below:


mkdir $HOME/kernel_out_dsboard_ornx_orin_nx
cp $HOME/kernel_out_dsboard_ornx/arch/arm64/boot/Image $HOME/kernel_out_dsboard_ornx_orin_nx/Image
cp $HOME/kernel_out_dsboard_ornx/arch/arm64/boot/dts/nvidia/tegra234-p3767-0000-p3768-0000-a0-dsboard-ornx.dtb $HOME/kernel_out_dsboard_ornx_orin_nx/tegra234-p3767-0000-p3768-0000-a0.dtb
cp $HOME/kernel_out_dsboard_ornx/arch/arm64/boot/dts/nvidia/tegra234-p3767-0001-p3768-0000-a0-dsboard-ornx.dtb $HOME/kernel_out_dsboard_ornx_orin_nx/tegra234-p3767-0001-p3768-0000-a0.dtb
mkdir $HOME/kernel_out_dsboard_ornx_orin_nx/extra_dtbs
mkdir $HOME/kernel_out_dsboard_ornx_orin_nx/extra_dtbs/imx477
cp $HOME/kernel_out_dsboard_ornx/arch/arm64/boot/dts/nvidia/tegra234-p3767-0000-p3768-0000-a0-dsboard-ornx-imx477.dtb $HOME/kernel_out_dsboard_ornx_orin_nx/extra_dtbs/imx477/tegra234-p3767-0000-p3768-0000-a0.dtb
cp $HOME/kernel_out_dsboard_ornx/arch/arm64/boot/dts/nvidia/tegra234-p3767-0001-p3768-0000-a0-dsboard-ornx-imx477.dtb $HOME/kernel_out_dsboard_ornx_orin_nx/extra_dtbs/imx477/tegra234-p3767-0001-p3768-0000-a0.dtb
make ARCH=arm64 O=$HOME/kernel_out_dsboard_ornx modules_install INSTALL_MOD_PATH=$INSTALL_MOD_PATH INSTALL_MOD_STRIP=1
cp $INSTALL_MOD_PATH/lib/modules/5.10.216-tegra/kernel/drivers/gpu/nvgpu/nvgpu.ko $HOME/kernel_out_dsboard_ornx_orin_nx/
rm -rf $INSTALL_MOD_PATH


Other boards commands steps will be in forecr_xavier_kernel/EXPORTING_BINS file.


At this point, we proceeded to export the kernel source for DSBOARD-ORNX with Orin NX SoM.

Thank you for reading our blog post.