Compiling Jetson TX2 source code L4T 32.3.1

From RidgeRun Developer Wiki
Revision as of 21:57, 16 March 2020 by Rjimenez (talk | contribs) (Created page with "= Introduction = This wiki page contains instructions to download and build kernel source code for Jetson TX2, several parts of this wiki were based in the document: NVIDIA Te...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

This wiki page contains instructions to download and build kernel source code for Jetson TX2, several parts of this wiki were based in the document: NVIDIA Tegra Linux Driver Package Development Guide 32.3.

L4T 32.3.1 is used by JetPack 4.3 (You can get more information from jetpack-archive).

Build kernel

1. Download and install the Toolchain

NVIDIA recommends using the Linaro 7.3.1 2018.05 toolchain for L4T 32.3 (toolchain)

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


2. Download the kernel sources for L4T 32.3.1

wget https://developer.download.nvidia.com/embedded/L4T/r32-3-1_Release_v1.0/Sources/T210/public_sources.tbz2

Execute the following commands to extract the kernel sources:

tar -xvf public_sources.tbz2
cd Linux_for_Tegra/source/public
JETSON_TX2_SOURCES=$(pwd)
tar -xf kernel_src.tbz2


3. Compile kernel and dtb

cd $JETSON_TX2_SOURCES/Linux_for_Tegra/source/public/
CROSS_COMPILE=${HOME}/toolchain_bin_${VERSION}/${TOOLCHAIN_DIR}/bin/$CC_PREFIX
KERNEL_OUT=$JETSON_TX2_SOURCES/Linux_for_Tegra/source/public/build
KERNEL_MODULES_OUT=$JETSON_TX2_SOURCES/Linux_for_Tegra/source/public/modules
cd $JETSON_TX2_SOURCES/Linux_for_Tegra/source/public/
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT tegra_defconfig
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT menuconfig

Download and extract

Set up helper environment variables