2,599
edits
Efernandez (talk | contribs) No edit summary |
|||
Line 3: | Line 3: | ||
= Introduction = | = Introduction = | ||
In this wiki page you are going to find the instructions to download the source code to rebuild the Jetson TX1/TX2 images using jetpack, several parts of this wiki were based in the document called Start_L4T_Docs.html given by Nvidia in L4T. This page should be considered a work in progress. These steps were run on Jetson TX1 and TX2 and Jetpack 3. | In this wiki page you are going to find the instructions to download the source code to rebuild the Jetson TX1/TX2 images using jetpack, several parts of this wiki were based in the document called Start_L4T_Docs.html given by Nvidia in L4T. This page should be considered a work in progress. These steps were run on Jetson TX1 and TX2 and Jetpack 3.2 was used.<br> | ||
You can get the documentation from [https://developer.nvidia.com/embedded/dlc/l4t-documentation-28- | You can get the documentation from [https://developer.nvidia.com/embedded/dlc/l4t-documentation-28-2 nvl4t_docs]. | ||
Line 20: | Line 20: | ||
= Downloading the code = | = Downloading the code = | ||
In order to be able to download the source code you should have Jetpack installed, if you already have it, skip the next section and go to [[ | In order to be able to download the source code you should have Jetpack installed, if you already have it, skip the next section and go to [[Compiling_Jetpack_3.2_source_code#Getting_bootloader_and_kernel|Getting bootloader and kernel]]. | ||
== Getting JetPack == | == Getting JetPack == | ||
Line 26: | Line 26: | ||
Check which is [https://developer.nvidia.com/embedded/jetpack the most recent JetPack release]. | Check which is [https://developer.nvidia.com/embedded/jetpack the most recent JetPack release]. | ||
'''1.''' Download Jetpack 3. | '''1.''' Download Jetpack 3.2 from: https://developer.nvidia.com/embedded/dlc/jetpack-l4t-3_2-ga | ||
'''2.''' Move binary into installation directory, we recommend '''/home/$USER/JetPack-L4T-3. | '''2.''' Move binary into installation directory, we recommend '''/home/$USER/JetPack-L4T-3.2''' | ||
<pre> | <pre> | ||
mkdir -p /home/$USER/JetPack-L4T-3. | mkdir -p /home/$USER/JetPack-L4T-3.2 | ||
mv JetPack-L4T-3. | mv JetPack-L4T-3.2-linux-x64_b196.run /home/$USER/JetPack-L4T-3.2/ | ||
</pre> | </pre> | ||
Line 38: | Line 38: | ||
<pre> | <pre> | ||
cd /home/$USER/JetPack-L4T-3. | cd /home/$USER/JetPack-L4T-3.2 | ||
chmod +x JetPack-L4T-3. | chmod +x JetPack-L4T-3.2-linux-x64_b196.run | ||
</pre> | </pre> | ||
Line 45: | Line 45: | ||
<pre> | <pre> | ||
./JetPack-L4T-3. | ./JetPack-L4T-3.2-linux-x64_b196.run | ||
</pre> | </pre> | ||
'''5.''' Follow the instructions. You'll be prompted for a devkit to build for (TX1, TX2, | '''5.''' Follow the instructions. You'll be prompted for a devkit to build for (TX1, TX2, TX2i) just select the one you want. | ||
== Getting bootloader and kernel == | == Getting bootloader and kernel == | ||
Line 57: | Line 57: | ||
* '''For TX1''' | * '''For TX1''' | ||
<pre> | <pre> | ||
export DEVDIR=$HOME/JetPack-L4T-3. | export DEVDIR=$HOME/JetPack-L4T-3.2/64_TX1/Linux_for_Tegra | ||
</pre> | </pre> | ||
Line 63: | Line 63: | ||
* '''For TX2''' | * '''For TX2''' | ||
<pre> | <pre> | ||
export DEVDIR=$HOME/JetPack-L4T-3. | export DEVDIR=$HOME/JetPack-L4T-3.2/64_TX2/Linux_for_Tegra | ||
</pre> | </pre> | ||
Line 80: | Line 80: | ||
This will download the bootloader and kernel. | This will download the bootloader and kernel. | ||
When syncing, you'll be asked for a tag, lets use '''tegra-l4t-r28. | When syncing, you'll be asked for a tag, lets use '''tegra-l4t-r28.2''' for both Kernel and uboot. | ||
= Toolchain = | = Toolchain = | ||
Line 127: | Line 127: | ||
</pre> | </pre> | ||
3 | 3) Clean your kernel and configuration | ||
<pre> | <pre> | ||
cd $DEVDIR/sources/kernel/kernel-4.4 | cd $DEVDIR/sources/kernel/kernel-4.4 | ||
Line 259: | Line 133: | ||
</pre> | </pre> | ||
4) Configure your kernel: | |||
This commands will set the default configuration and open a menu so you can change any of the setting if needed. If not, you can just hit '''exit''' after the menu opens. | This commands will set the default configuration and open a menu so you can change any of the setting if needed. If not, you can just hit '''exit''' after the menu opens. | ||
Line 281: | Line 155: | ||
</pre> | </pre> | ||
5) Compile kernel, device tree and modules | |||
<pre> | <pre> | ||
make O=$TEGRA_KERNEL_OUT zImage | make O=$TEGRA_KERNEL_OUT zImage | ||
Line 302: | Line 176: | ||
6) Create kernel_supplements.tbz2 with kernel modules, this package is needed by Jetpack | |||
<pre> | <pre> | ||
Line 328: | Line 202: | ||
</pre> | </pre> | ||
7) Besides creating the modules and the kernel image you need to create again your kernel_headers.tbz2 file (needed by Jetpack). By default when you patch the kernel code and you don't check your changes in the kernel will add a -dirty suffix to the release version (check ls $DEVDIR/images/modules/lib/modules/ for example). For this specific reason you need to generate your headers tarball again changing it the release version. | |||
<pre> | <pre> | ||
Line 356: | Line 230: | ||
8) Create a backup of the images and packages included in Jetpack | |||
<pre> | <pre> | ||
mkdir -p $DEVDIR/images/packages-backup | mkdir -p $DEVDIR/images/packages-backup | ||
Line 363: | Line 237: | ||
9) Copy your dtb | |||
*'''TX1''' | *'''TX1''' | ||
Line 377: | Line 251: | ||
</pre> | </pre> | ||
10) Finally overwrite the default images with your own images to install and boot them using jetpack | |||
<pre> | <pre> | ||
Line 385: | Line 259: | ||
</pre> | </pre> | ||
11) Run the applybinaries script to generate the image to flash | |||
<pre> | <pre> | ||
Line 406: | Line 280: | ||
<pre> | <pre> | ||
cd $DEVDIR/../../ | cd $DEVDIR/../../ | ||
JetPack-L4T-3.2-linux-x64_b196.run | |||
</pre> | </pre> | ||
Line 492: | Line 366: | ||
<pre> | <pre> | ||
cd $DEVDIR | cd $DEVDIR/sources | ||
git clone git://git.kernel.org/pub/scm/utils/dtc/dtc.git | git clone git://git.kernel.org/pub/scm/utils/dtc/dtc.git | ||
cd dtc | cd dtc | ||
Line 501: | Line 375: | ||
== Build u-boot == | == Build u-boot == | ||
1. Backup original uboot files. You see which platform you are using checking the file in $DEVDIR | 1. Backup original uboot files. You see which platform you are using checking the file in $DEVDIR/jetson-tx1.conf, it says: | ||
<pre> | <pre> | ||
Line 511: | Line 385: | ||
<pre> | <pre> | ||
mkdir $DEVDIR/images/packages-backup/bootloader/ | mkdir $DEVDIR/images/packages-backup/bootloader/ | ||
cp -rf $DEVDIR | cp -rf $DEVDIR/bootloader/t210ref/p2371-2180-devkit $DEVDIR/images/packages-backup/bootloader/ | ||
cd $DEVDIR | cd $DEVDIR/bootloader/ | ||
cp nvtboot.bin nvtboot_cpu.bin u-boot-dtb.bin bpmp.bin warmboot.bin tos.img tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb $DEVDIR/images/packages-backup/bootloader/ | cp nvtboot.bin nvtboot_cpu.bin u-boot-dtb.bin bpmp.bin warmboot.bin tos.img tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb $DEVDIR/images/packages-backup/bootloader/ | ||
cp $DEVDIR | cp $DEVDIR/bootloader/t210ref/p2371-2180 $DEVDIR/images/packages-backup/bootloader/ | ||
</pre> | </pre> | ||
Line 522: | Line 396: | ||
<pre> | <pre> | ||
cd $DEVDIR | cd $DEVDIR/sources/u-boot/ | ||
PATH=$DEVDIR/images:$PATH | PATH=$DEVDIR/images:$PATH | ||
export CROSS_COMPILE=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- | export CROSS_COMPILE=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- | ||
Line 539: | Line 413: | ||
<pre> | <pre> | ||
mkdir $DEVDIR/images/bootloader | mkdir $DEVDIR/images/bootloader | ||
cp $DEVDIR | cp $DEVDIR/sources/u-boot/u-boot{,.bin,.dtb,-dtb.bin} $DEVDIR/images/bootloader | ||
</pre> | </pre> | ||
Line 554: | Line 428: | ||
<pre> | <pre> | ||
cp $DEVDIR/images/bootloader/u-boot{,.bin,.dtb,-dtb.bin} $DEVDIR | cp $DEVDIR/images/bootloader/u-boot{,.bin,.dtb,-dtb.bin} $DEVDIR/bootloader/t210ref/p2371-2180/ | ||
</pre> | </pre> | ||