Data: 2017.09.14
Author: cjh
Theme: Jetson TX1uboot编译与烧写
/64_TX1/Linux_for_Tegra_64_tx1/
PS:uboot源码下载,参见Jetson TX1内核kernel编译与烧写
1. 备份原始uboot文件。你看到你正在使用哪个平台检查$DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/jetson-tx1.conf中的文件
将文件复制到packages-backup目录
mkdir$DEVDIR/images/packages-backup/bootloader/
cp -rf $DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/bootloader/t210ref/p2371-2180-devkit$DEVDIR/images/packages-backup/bootloader/
cd $DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/bootloader/
cp nvtboot.bin nvtboot_cpu.binu-boot-dtb.bin bpmp.bin warmboot.bin tos.imgtegra210-jetson-tx1-p2597-2180-a01-devkit.dtb$DEVDIR/images/packages-backup/bootloader/
cp $DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/bootloader/t210ref/p2371-2180$DEVDIR/images/packages-backup/bootloader/
2. 转到uboot并设置环境变量。您需要导出图像目录路径,以便允许u-boot找到DTC
cd $DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/sources/u-boot_source/
PATH=$DEVDIR/images:$PATH
exportCROSS_COMPILE=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export ARCH=arm64
3. 清洁并编译
make distclean
make p2371-2180_defconfig
make
PS:错误解决
*** Your dtc is too old,please upgrade to dtc 1.4 or newer
$DEVDIR/images/dtc -v
Version: DTC1.2.0-g37c0b6a0
方法:
cd $DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/sources
git clonegit://git.kernel.org/pub/scm/utils/dtc/dtc.git
cd dtc
make
cp dtc $DEVDIR/images/
PS:错误解决
GEN config-host.h
LEX convert-dtsv0-lexer.lex.c
make[1]: flex:命令未找到
BISON dtc-parser.tab.c
make[1]: bison:命令未找到
LEX dtc-lexer.lex.c
make[1]: flex:命令未找到
CHK version_gen.h
方法:sudo apt-get install flex
sudo apt-get install bison
4. 保存新的二进制文件
mkdir $DEVDIR/images/bootloader
cp $DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/sources/u-boot_source/u-boot{,.bin,.dtb,-dtb.bin}$DEVDIR/images/bootloader
5. 现在,将您的u-boot二进制文件复制到Jetpack用于查找它们的目录。正如您在DTB中可以看到的那样,它会在其中寻找
target_board="t210ref";
BOOTLOADER="bootloader/${target_board}/p2371-2180/u-boot-dtb.bin";
复制文件运行
cp $DEVDIR/images/bootloader/u-boot{,.bin,.dtb,-dtb.bin}$DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/bootloader/t210ref/p2371-2180/
6. 更新烧写uboot
最后将tx1进入recover模式:
关闭设备,移除电源适配器
用自带的Micro USB 转 USB 数据线连接主机与TX1
连接电源适配器
按下POWER按钮
按住FORCE RECOVERY 按钮不放开,同时按一下RESET按钮,等待两秒钟,松开FORCE RECOVERY 按钮
$ sudo ./flash.sh -k EBT jetson-tx1mmcblk0p1
通过串口助手查看
U-Boot 2015.07-rc2 (Sep 13 2017 - 15:55:18+0800)