I have built a Ubuntu 14.04 machine just to flash TX2. After using the host to flash JetPack 3.1 to TX2, I took on the next task to figure out the procedure to update device tree blob (DTB).
Step 1. Download and copy the GCC toolchain from Jetson Download Center | NVIDIA Developer Go down to section “GCC Tool Chain for 64-bit BSP” and click to download the tar ball.
I copied the “install” directory and placed it under ~/toolchian/install
Step 2. Download and unpack L4T. Get the Latest L4T source “Linux For Tegra R28.1” from
go to the section “Source Packages”, click on “Sources”
which points to https://developer.nvidia.com/embedded/dlc/l4t-sources-28-1
Step 3. Make a work directory and unpack the L4T into the folder. In my case, it’s under ~/work/tx2
Step 4. Create a list of environment. My list is definitely more than needed for updating DTB, hope it does no harm either.
$ export HOME_TOP=/home/myuserid
$ export BUILD_TOP=$HOME_TOP/work/tx2
$ export CROSS_COMPILE=$HOME_TOP/toolchain/install/bin/aarch64-unknown-linux-gnu-
$ export KERNEL_DIR=$BUILD_TOP/kernel/kernel-4.4
$ export KERNEL_SUB=kernel/kernel-4.4/
$ export TEGRA_KERNEL_OUT=$BUILD_TOP/linux_for_tegra/out
$ export TEGRA_MODULES_OUT=$BUILD_TOP/linux_for_tegra/modules
Now we seem are ready to run the “make” tasks.
Step 5. Update the DTB
$ sudo make -C $KERNEL_SUB O=$KERNEL_DIR ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE tegra18_defconfig
$ sudo make -C $KERNEL_SUB O=$TEGRA_KERNEL_OUT ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE TEGRA_KERNEL_OUT=$TEGRA_KERNEL_OUT dtbs
But it failed.
scripts/kconfig/conf --silentoldconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[3]: *** [silentoldconfig] Error 1
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target `include/config/auto.conf', needed by `scripts'. Stop.
make[1]: Leaving directory `/home/myuserid/work/tx2/linux_for_tegra/out'
make: *** [sub-make] Error 2
make: Leaving directory `/home/myuserid/work/tx2/kernel/kernel-4.4'
Step 6. Add a make menuconfig before make dtbs. Also add a make clean prior to it.
$ sudo make -C $KERNEL_SUB mrproper
$ sudo make -C $KERNEL_SUB O=$KERNEL_DIR ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE tegra18_defconfig
$ sudo make -C $KERNEL_SUB O=$TEGRA_KERNEL_OUT ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE menuconfig
But it still failed, though for a different reason:
make: Entering directory `/home/myuserid/work/tx2/kernel/kernel-4.4'
make[1]: Entering directory `/home/myuserid/work/tx2/linux_for_tegra/out'
GEN ./Makefile
HOSTCC scripts/kconfig/mconf.o
In file included from /home/myuserid/work/tx2/kernel/kernel-4.4/scripts/kconfig/mconf.c:23:0:
/home/myuserid/work/tx2/kernel/kernel-4.4/scripts/kconfig/lxdialog/dialog.h:38:20: fatal error: curses.h: No such file or directory
#include CURSES_LOC
^
compilation terminated.
make[2]: *** [scripts/kconfig/mconf.o] Error 1
make[1]: *** [menuconfig] Error 2
make[1]: Leaving directory `/home/myuserid/work/tx2/linux_for_tegra/out'
make: *** [sub-make] Error 2
make: Leaving directory `/home/myuserid/work/tx2/kernel/kernel-4.4'
Searched online for solutions, saw the mentioning of running “source_sync.sh”. I found the file and copy it from jetpack/64_TX2/Linux_for_Tegra_tx2/source_sync.sh to “~/work/tx2”.
The execution of the script shows “Cloning into ‘/home/myuserid/work/tx2/sources/kernel/kernel-4.4’…” (it takes a while to finish)
Duplicate another file structure for the kernel? I don’t think I ran the source_sync.sh script correctly. More importantly, the make tasks still failed.
Please help. . .
Edit: please notice an error in Step 6, line 2. See the comments in the thread below for further info.