Skip to main content

Build TechNexion Camera Drivers for JetPack 7.x

Introduction

This document provides the instructions to build and port NVIDIA Jetson camera drivers using the JetPack 7.x SDK. The current validated target is JetPack 7.2 with Linux for Tegra R39.2 and kernel 6.8 on the Jetson Orin Nano Developer Kit.

warning

TechNexion has currently validated this build guide only with JetPack 7.2. If you want to port the driver to JetPack 6.x, follow the JetPack 6.x guide.

Preparation

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

  1. Download toolchain for JetPack 7.2.
wget -O x-tools-gcc-13.2.tbz2 https://developer.nvidia.com/downloads/embedded/L4T/r38_Release_v2.0/release/x-tools.tbz2
sudo mkdir -p /opt/l4t-gcc-13.2
sudo tar xf x-tools-gcc-13.2.tbz2 -C /opt/l4t-gcc-13.2/
  1. Download JetPack 7.2 BSP.
wget https://developer.nvidia.com/downloads/embedded/L4T/r39_Release_v2.0/release/Jetson_Linux_R39.2.0_aarch64.tbz2
tar xf Jetson_Linux_R39.2.0_aarch64.tbz2

Build Camera Drivers with Jetson BSP

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

We can download BSP sources by source_sync.sh:

cd Linux_for_Tegra/source/
./source_sync.sh -k -t jetson_39.2_GA

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

source/
|-- dtc-src
|-- hardware
|-- kernel
|-- kernel-devicetree
|-- nvbuild.sh
|-- nvidia-oot
|-- nvgpu
`-- source_sync.sh

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

pushd nvidia-oot
git submodule add -b tn_l4t-r39.2.ga_kernel-6.8 https://github.com/TechNexion-Vision/TEV-Jetson_Camera_driver.git drivers/media/i2c/technexion
if ! grep -qxF 'obj-m += technexion/' drivers/media/i2c/Makefile; then
echo 'obj-m += technexion/' >> drivers/media/i2c/Makefile
fi
popd

Then we need to modify device tree:

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-r39.2.ga_kernel-6.8
popd

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

compiler="$(find /opt/l4t-gcc-13.2 -maxdepth 6 \( -type f -o -type l \) -name 'aarch64*-gcc' -print -quit)"
if [ -z "${compiler}" ]; then
echo "No aarch64 gcc found under /opt/l4t-gcc-13.2" >&2
exit 1
fi

export CROSS_COMPILE="${compiler%gcc}"
export KERNEL_HEADERS="${PWD}/build/kernel/kernel-noble"
./nvbuild.sh -o build

After a successful build, the following artifacts will be generated:

TEVS Driver Module:

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

Device Tree Overlay (DTBO):

./build/build/nvidia-public/devicetree/generic-dtbs/tegra234-p3767-camera-p3768-tevs-dual.dtbo