Build Kernel from Scratch (JetPack 4.6 on NRU-50)

A. Prepare Kernel Building Environment

In a nutshell, you will build the kernel image on your host machine, an x86 computer with Ubuntu, NVIDIA SDKManager, x86 to aarch64 cross-compiler installed. You can download the kernel source from NVIDIA, modify, compile it, then flash the compiled result to NRU.

1. Download NVIDIA SDKManager

https://developer.nvidia.com/nvidia-sdk-managerarrow-up-right

2. Install JetPack 4.6 for Xavier NX NVIDIA SDKManager

After installation, you will see a L4T folder.

# The default L4T folder path for JetPack 4.6 of Xavier NX is 
$HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra

3. Download Device Tree and Kernel Source from NVIDIA

export L4T=$HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra

cd $L4T

# "tegra-l4t-r32.6.1" menas JetPack 4.6, more JetPack and L4T mapping can be found on <https://developer.nvidia.com/embedded/jetpack-archive>
./source_sync.sh -k tegra-l4t-r32.6.1

Then you will find sources under L4T . The sourecs folder includes the kernel and device tree source code from NVIDIA.

4. Download Toolchain to Compile aarch64 on x86 Computers

5. Create a Default Makefile Config

B. Modify Default Kernel Config

The default config file is under the following files.

Each configuration can be set as

  • =y -> Put a specific feature in the built-in kernel image, which can't be removed or inserted dynamically

  • =m -> Build a specific feature as a kernel module, which can be removed or inserted dynamically

  • =n -> Not include a specific feature in the kernel image

For example, to enable GPS PPS service, we will put the following config as builtin

C. Compile Kernel

D. Replace the Kernel Image

Based on personal experience, the kernel image might be damaged once I uploaded on to the cloud. So I would suggest a USB driver copy might be the safest way to move the compiled kernel image to NRU-50.

The location to put the compiled kernel image is:

Last updated