Getting started guide for Auvidea J106 board (Jetpack 4.2.2)

From RidgeRun Developer Wiki



Problems running the pipelines shown on this page? Please see our GStreamer Debugging guide for help.


Compiling source code

This wiki assumes that the $JETPACK_4_2_2 environment variable has been set as follows:

export JETPACK_4_2_2=$HOME/JetPack-L4T-4.2


Follow these instructions to build and install the kernel Image and device tree.

1. Download and install the Toolchain

NVIDIA recommends using the Linaro 7.3.1 2018.05 toolchain for L4T 32.1

Download the pre-built toolchain binaries from: http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

wget http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

Execute the following commands to extract the toolchain:

mkdir $HOME/l4t-gcc
cd $HOME/l4t-gcc
tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

2. Download the kernel sources

Download the kernel source files (for Jetpack 4.2.2) and then manually extract them.

wget https://developer.nvidia.com/embedded/dlc/r32-2-1_Release_v1.0/TX2-AGX/sources/public_sources.tbz2

Execute the following commands to extract the toolchain:

tar -xvf public_sources.tbz2
cd public_sources/
mkdir build_sources
mv kernel_src.tbz2 build_sources/
cd build_sources/
tar -xvf kernel_src.tbz2
JETSON_TX2_KERNEL_SOURCE=$(pwd)

3. Apply driver patches

Before start building the kernel and dtb sources, apply the patch with imx219 camera sources: Download and copy the patches tarball into sources directory, decompress the tarball and apply the patch with the commands:

Define the TARBALL_FILE by specifying the path of the tarball.

$ TARBALL_FILE=<path_to_file>

Then,

$ mv $TARBALL_FILE $JETSON_TX2_KERNEL_SOURCE/
$ cd $JETSON_TX2_KERNEL_SOURCE/
$ tar -xvf $TARBALL_FILE
$ quilt push

4. Compile kernel, modules and device tree

Follow the steps:

cd $JETSON_TX2_KERNEL_SOURCE
CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
KERNEL_OUT=$JETSON_TX2_KERNEL_SOURCE/build
KERNEL_MODULES_OUT=$JETSON_TX2_KERNEL_SOURCE/modules
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT tegra_defconfig

Run menuconfig to add support for imx219

make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT menuconfig #To change the default configuration

In the menu access select the following options:

-> Kernel Configuration
 -> Device Drivers                                                 
  -> Multimedia support                                                                                           
    -> NVIDIA Encoders, decoders, sensors and other helper chips
       -> <*> IMX219 camera sensor support

Continue with the kernel building process:

make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j6 Image
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j6 dtbs
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j6 modules
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT modules_install INSTALL_MOD_PATH=$KERNEL_MODULES_OUT

Flash Jetson TX2

This guide assumes that the user already has JetPack 4.2.2 installed.

Move to the Linux for Tegra directory

cd nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/

Copy the generated kernel, modules and device tree:

cp $JETSON_TX2_KERNEL_SOURCE/build/arch/arm64/boot/Image kernel/ # Copy kernel
cp $JETSON_TX2_KERNEL_SOURCE/build/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb kernel/dtb/ # Copy device tree
sudo cp -a $JETSON_TX2_KERNEL_SOURCE/modules/lib rootfs/ # Copy new modules

Please notice the device tree being copied is the default, if custom hardware modifications have been made, custom device tree must be created and used.

Make sure Jetson TX2 is in recovery mode and start flashing process. It may take some time.

sudo ./flash.sh jetson-tx2 mmcblk0p1

Continue with default operating system setup with on-screen instructions.

Camera Capture

Sony IMX219 image sensor

The Sony IMX219 is a CMOS image sensor with the following features:

  • CSI2 serial data output (selection of 4 or 2 lanes)
  • Max. 30 frame/s in all-pixel scan mode
  • 180 frame/s 720p with 2x2 analog (special) binning, 60 frame/s @ 1080p with V-crop
  • Data rate: Max. 722 Mbps/lane(@4lane), 912 Mbps/Lane(@2lane)
  • Max resolution of 3280 (H) x 2464 (V) approx. 8.08 M pixels

Warning: Please be aware that using J106 require an adapter from 15pins to 22pins.

Test GStreamer Pipelines

  • Single capture from camera 0 - 1280x720 Resolution
gst-launch-1.0  nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv ! xvimagesink
  • 6 Cameras - 1280x720 Resolution into individual windows
export CAPS="video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)30/1"

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! $CAPS ! nvvidconv ! xvimagesink nvarguscamerasrc sensor-id=1 ! $CAPS ! nvvidconv ! xvimagesink nvarguscamerasrc sensor-id=2 ! $CAPS ! nvvidconv ! xvimagesink nvarguscamerasrc sensor-id=3 ! $CAPS ! nvvidconv ! xvimagesink nvarguscamerasrc sensor-id=4 ! $CAPS ! nvvidconv ! xvimagesink nvarguscamerasrc sensor-id=5 ! $CAPS ! nvvidconv ! xvimagesink

See Also



For direct inquiries, please refer to the contact information available on our Contact page. Alternatively, you may complete and submit the form provided at the same link. We will respond to your request at our earliest opportunity.


Links to RidgeRun Resources and RidgeRun Artificial Intelligence Solutions can be found in the footer below.