Difference between revisions of "Compiling Jetson TX2 source code L4T 32.1"

From RidgeRun Developer Connection
Jump to: navigation, search
(3. Compile kernel and dtb)
m
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Introduction =
+
<seo title="Compiling Tegra Source Code | Compiling Jetson TX2 source code L4T 32.1 | Tegra X1 and X2 | RidgeRun" titlemode="replace" keywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, NVIDIA, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework,Jetson TX2 source code,L4T 32.1,Tegra Source Code"  description="Learn about compiling Tegra source code L4T 32.1 for Jetson TX1 and TX2. Read related articles and instructions for Jetpack online now at RidgeRun Developer."></seo>
  
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: [https://docs.nvidia.com/jetson/l4t/index.html NVIDIA Tegra Linux Driver Package Development Guide 32.1].
+
<table>
 +
<tr>
 +
<td><div class="clear; float:right">__TOC__</div></td>
 +
<td>
 +
{{NVIDIA Preferred Partner logo}}
 +
<td>
 +
<center>
 +
{{ContactUs Button}}
 +
</center>
 +
</tr>
 +
</table>
 +
 
 +
== 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: [https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-321/index.html NVIDIA Tegra Linux Driver Package Development Guide 32.1].
  
 
L4T 32.1 is used by [https://developer.nvidia.com/embedded/jetpack-4-1-1 JetPack 4.1.1] and [https://developer.nvidia.com/embedded/jetpack JetPack 4.2] (You can get more information from [https://developer.nvidia.com/embedded/jetpack-archive jetpack-archive]).
 
L4T 32.1 is used by [https://developer.nvidia.com/embedded/jetpack-4-1-1 JetPack 4.1.1] and [https://developer.nvidia.com/embedded/jetpack JetPack 4.2] (You can get more information from [https://developer.nvidia.com/embedded/jetpack-archive jetpack-archive]).
  
=Build Kernel=
+
==Build Kernel==
  
 
Follow these instructions to build and install the kernel Image and device tree.
 
Follow these instructions to build and install the kernel Image and device tree.
  
====1. Download and install the Toolchain====
+
===1. Download and install the Toolchain===
 
NVIDIA recommends using the Linaro 7.3.1 2018.05 toolchain for L4T 32.1
 
NVIDIA recommends using the Linaro 7.3.1 2018.05 toolchain for L4T 32.1
  
Line 25: Line 39:
 
</source>
 
</source>
  
Set ''CROSS_COMPILE'' Environment Variable
+
===2. Download the kernel sources===
<source lang="bash">
 
export CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
 
</source>
 
 
 
====2. Download the kernel sources====
 
 
You can download the kernel source files and then manually extract them. it is recommended to instead sync with git.
 
You can download the kernel source files and then manually extract them. it is recommended to instead sync with git.
  
Line 38: Line 47:
 
wget https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/jax-tx2/BSP/JAX-TX2-public_sources.tbz2
 
wget https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/jax-tx2/BSP/JAX-TX2-public_sources.tbz2
 
</source>
 
</source>
Execute the following commands to extract the toolchain:
+
Execute the following commands to extract the kernel:
 
<source lang="bash">
 
<source lang="bash">
 
tar -xvf JAX-TX2-public_sources.tbz2
 
tar -xvf JAX-TX2-public_sources.tbz2
Line 46: Line 55:
 
</source>
 
</source>
  
====3. Compile kernel and dtb====
+
===3. Compile kernel and dtb===
 
Follow the steps:
 
Follow the steps:
 
<source lang="bash">
 
<source lang="bash">
Line 61: Line 70:
 
</source>
 
</source>
  
=Flash Jetson TX2=
+
==Flash Jetson TX2==
 
This guide assumes that the user already have JetPack 4.2 installed. This link contains details about how to install JetPack 4.2: https://docs.nvidia.com/sdk-manager/download-run-sdkm/index.html
 
This guide assumes that the user already have JetPack 4.2 installed. This link contains details about how to install JetPack 4.2: https://docs.nvidia.com/sdk-manager/download-run-sdkm/index.html
  
Line 80: Line 89:
 
sudo ./flash.sh jetson-tx2 mmcblk0p1
 
sudo ./flash.sh jetson-tx2 mmcblk0p1
 
</source>
 
</source>
 +
 +
===Flash device tree only===
 +
<source lang="bash">
 +
# Flash device tree only
 +
sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1
 +
</source>
 +
 +
{{ContactUs}}
  
 
[[Category:Jetson]]
 
[[Category:Jetson]]

Latest revision as of 03:13, 22 August 2022

Nvidia-preferred-partner-badge-rgb-for-screen.png

RR Contact Us.png

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.1.

L4T 32.1 is used by JetPack 4.1.1 and JetPack 4.2 (You can get more information from jetpack-archive).

Build Kernel

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

You can download the kernel source files and then manually extract them. it is recommended to instead sync with git.

In a browser, navigate to: https://developer.nvidia.com/embedded/downloads. Locate and download the L4T Sources for your release. (L4T Sources 32.1 2019/03/18) or run the command below:

wget https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/jax-tx2/BSP/JAX-TX2-public_sources.tbz2

Execute the following commands to extract the kernel:

tar -xvf JAX-TX2-public_sources.tbz2
cd public_sources/
JETSON_TX2_KERNEL_SOURCE=$(pwd)
tar -xvf kernel_src.tbz2

3. Compile kernel and dtb

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
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT menuconfig # if is required to change the default configuration
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 have JetPack 4.2 installed. This link contains details about how to install JetPack 4.2: https://docs.nvidia.com/sdk-manager/download-run-sdkm/index.html

JETPACK_4_2 contains the directory where JetPack 4.2 was installed. For example.

export JETPACK_4_2=$HOME/JetPack-L4T-4.2

Make sure the Jetson TX2 is in recovery mode

cd ${JETPACK_4_2}/JetPack_4.2_Linux_P3310/Linux_for_Tegra
# Copy kernel generated
cp $JETSON_TX2_KERNEL_SOURCE/build/arch/arm64/boot/Image kernel/
# Copy device tree generated
cp $JETSON_TX2_KERNEL_SOURCE/build/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb kernel/dtb/
# Copy new modules
sudo cp -a $JETSON_TX2_KERNEL_SOURCE/modules/lib rootfs/
# Flash memory 
sudo ./flash.sh jetson-tx2 mmcblk0p1

Flash device tree only

# Flash device tree only
sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us

OOjs UI icon message-progressive.svg Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page. Ridgerun-logo.svg
RR Contact Us.png