Skip to main content

Build TechNexion Camera Drivers for JetPack6.x

Introduction

This document provides the instructions to build and port NVIDIA Jetson camera drivers using the JetPack 6.x SDK. You will learn how to compile new drivers and adapt existing ones for this environment.

warning

If you want to port to driver to other JetPack version such as JP 5.x, you can follow the guides.

Preparasion

First, you need to setup the environments on your host PC.

  1. Download toolchain for JetPack 6.x.
wget -O aarch64--glibc--stable-2022.08-1.tar.bz2 https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v3.0/toolchain/aarch64--glibc--stable-2022.08-1.tar.bz2
mkdir /opt/aarch64--glibc--stable-2022.08-1 && tar xf aarch64--glibc--stable-2022.08-1.tar.bz2 -C /opt/aarch64--glibc--stable-2022.08-1/
  1. Download JetPack BSP for your interested version.

JetPack 6.1:

wget https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.0/release/Jetson_Linux_R36.4.0_aarch64.tbz2
tar xf Jetson_Linux_R36.4.0_aarch64.tbz2

JetPack 6.2:

wget https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.3/release/Jetson_Linux_r36.4.3_aarch64.tbz2
tar xf Jetson_Linux_r36.4.3_aarch64.tbz2

Build Camera Drivers with Jetson BSP

There is an example for building TechNexion TEVS camera driver for JetPack 6.x on Jetson Orin Nano DevKit.

We can download BSP sources by source_sync.sh:

JetPack 6.1:

cd Linux_for_Tegra/source/
./source_sync.sh -k -t jetson_36.4

JetPack 6.2:

cd Linux_for_Tegra/source/
./source_sync.sh -k -t jetson_36.4.3

After download the kernel source codes by source_sync.sh, you will see that:

source/
├── dtc-src
├── generic_rt_build.sh
├── hardware
├── hwpm
├── kernel
├── kernel_src_build_env.sh
├── Makefile
├── nvbuild.sh
├── nvdisplay
├── nvethernetrm
├── nvgpu
├── nvidia-oot
├── nv_src_build.sh
└── source_sync.sh

Then we need to clone TechNexion camera driver, follow the steps:

pushd nvidia-oot
git submodule add -b tn_l4t-r36.4.ga_kernel-5.15 https://github.com/TechNexion-Vision/TEV-Jetson_Camera_driver.git drivers/media/i2c/technexion
echo 'obj-m += technexion/' >> drivers/media/i2c/Makefile
popd

Then we need to modify device tree:

JetPack 6.1:

pushd hardware/nvidia/t23x/nv-public/
git remote add technexion https://github.com/TechNexion-Vision/TEV-JetsonOrin-Nano_device-tree.git
git fetch technexion
git checkout tn_l4t-r36.4.ga_kernel-5.15
popd

JetPack 6.2:

pushd hardware/nvidia/t23x/nv-public/
git remote add technexion https://github.com/TechNexion-Vision/TEV-JetsonOrin-Nano_device-tree.git
git fetch technexion
git checkout tn_l4t-r36.4.3.ga_kernel-5.15
popd

Finally, we can run nv_build.sh to build the BSP.

export CROSS_COMPILE=/opt/aarch64--glibc--stable-2022.08-1/aarch64--glibc--stable-2022.08-1/bin/aarch64-linux-
./nvbuild.sh -o build

After building, you can find the tevs driver module:

./build/nvidia-oot/drivers/media/i2c/technexion/tevs/tevs.ko