How to install a Real-Time Kernel for the A603 board

Introduction

Recently, I had to flash a Jetson Orin Nano 4GB module + A603 carrier board with a real-time kernel for a Uni project; This post intends to show the step-by-step process I did to do so, in order to both help other rookies like me, as well as to get feedback from more experienced users, pointing out what could be improved in this tutorial and what might be missing.

This tutorial applies to JetPack 6.2 / L4T 36.4.3


The main sources used in this were the official A603 flashing documentation and Nvidia’s tutorial for customizing the Kernel . The flashing process can be summarized in the following steps:

  1. Copy base L4T, sample rootfs and A603 files
  2. Compile the real time kernel
  3. Compile OOT modules and DTB
  4. Copy the DTB files from A603 to the image
  5. Flash the device

1. Copying the base files

In this step, we basically follow Seeed’s tutorial. Copy the files in the host PC:

wget https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.3/release/Jetson_Linux_r36.4.3_aarch64.tbz2
wget https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.3/release/Tegra_Linux_Sample-Root-Filesystem_r36.4.3_aarch64.tbz2

Download the A603 driver package from the OneDrive link provided by Seeed. Your folder structure should look like this:

L base_dir
  L Jetson_Linux
  L Tegra_Linux_Sample_Rootfs
  L 603_jp62

Unzip all the files, copy stuff into Linux_for_Tegra and apply binaries. You must do this last step BEFORE building the real time kernel.

2. Build the kernel

To build the kernel, first fetch the public sources and compilation toolbox from NVidia. Place these zip files in the same folder as the others.

2.1. Extract files

Extract the files as in the official tutorial.

tar xf public_sources.tbz2 -C <install-path>/Linux_for_Tegra/..
cd <install-path>/Linux_for_Tegra/source
tar xf kernel_src.tbz2
tar xf kernel_oot_modules_src.tbz2
tar xf nvidia_kernel_display_driver_source.tbz2

2.2. Building the kernel

With the files extracted, we can build the Kernel. Obviously, we need to activate the RT build. At this point, you should have extracted the gcc toolchain for Nvidia.

cd <install-path>/Linux_for_Tegra/source
./generic_rt_build.sh "enable"
export CROSS_COMPILE=<toolchain-path>/bin/aarch64-buildroot-linux-gnu-
make -C kernel
export INSTALL_MOD_PATH=<install-path>/Linux_for_Tegra/rootfs/
sudo -E make install -C kernel
cp kernel/kernel-jammy-src/arch/arm64/boot/Image <install-path>/Linux_for_Tegra/kernel/Image

This will take a long time (~10-20 min)

3. Build OOT modules and DT

Build OOT modules. Ensure the driver libraries are installed in Linux_for_Tegra/usr/lib and Linux_for_Tegra/bootloader.

cd <install-path>/Linux_for_Tegra/source

export IGNORE_PREEMPT_RT_PRESENCE=1
export CROSS_COMPILE=<toolchain-path>/bin/aarch64-buildroot-linux-gnu-
export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
make modules

export INSTALL_MOD_PATH=<install-path>/Linux_for_Tegra/rootfs/
sudo -E make modules_install

cd <install-path>/Linux_for_Tegra
sudo ./tools/l4t_update_initrd.sh

To build the DTBs, run the following code:

cd <install-path>/Linux_for_Tegra/source

export CROSS_COMPILE=<toolchain-path>/bin/aarch64-buildroot-linux-gnu-
export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
make dtbs

cp kernel-devicetree/generic-dts/dtbs/* <install-path>/Linux_for_Tegra/kernel/dtb/

Note: I am not sure whether the DTB recompilation is strictly necessary, since we need to reapply the DTBs for the A603 peripherals. As I said, I am not a Jetson specialist, I’m just showing what worked for me.

4. Reapply carrier board DTB

On the previous step, we have overwritten some .dtb files related to A603 peripherals. Copy the dtb files again, and be careful to not overwriting the Image.

cp -r 603_jp62/Linux_for_Tegra/kernel/dtb/* Linux_for_Tegra/kernel/dtb/ 

4. Flash the device

Flash the device with the same command as in Seeed’s tutorial:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
  -c tools/kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
  --showlogs --network usb0 jetson-orin-nano-devkit-super internal

Tip: after flashing, make an Image to avoid having to do all of this again

sudo ./tools/backup_restore/l4t_backup_restore.sh -e nvme0n1 -b jetson-orin-nano-devkit-super

Feel free to add to this tutorial

2 Likes