背景
最近在做的项目需要在TDA2X平台上面运行深度学习代码,所以需要给板子做一个linux系统。官方参考文档VisionSDK_Linux_UserGuide.pdf。
软件安装和设置
1. 下载PROCESSOR_SDK_VISION_XX_XX_XX_XX_setuplinux.bin
安装PROCESSOR SDK并导入环境变量
$> ./PROCESSOR_SDK_VISION_03_08_00_00_setuplinux.bin
$> export INSTALL_DIR=<installation_directory_absolute_path>
我的安装目录是 ~/WorkSpaces/TI/PROCESSOR_SDK_VISION_03_08_00_00/。
2. 下载linux的kernel、uboot、sgx、file systme
TDA2X的官方文档用的git的方式下载的,我首先尝试的git,发现资源的链接非常不稳定,几十k的下载速度,还经常中断,基本没有成功的可能。所以强烈建议 kernel、uboot的下载不要使用git,使用wget的持续断点续传下载;sgx不要使用wget下载,必须用git下载,sgx的网站链接的资源和git不一致,这里要特别注意,否则编译会error
2.1 下载kernel
$> wget -t 0 -c https://git.ti.com/cgit/glsdk/psdkla-kernel/snapshot/psdkla-kernel-REL_VISION_SDK_03_08_00_00.tar.gz
或
$> wget -t 0 -c https://git.ti.com/cgit/glsdk/psdkla-kernel/snapshot/psdkla-kernel-REL_VISION_SDK_03_08_00_00.tar.xz
哪个先下载完用哪个就行,不要手动干预,中断后会自己重新连接,耐心等就行。将下载的文件解压并拷贝到**$INSTALL_DIR/ti_components/os_tools/linux/kernel** 目录下,重命名为omap。
$> tar zxvf psdkla-kernel-REL_VISION_SDK_03_08_00_00.tar.gz
$> cp -r psdkla-kernel-REL_VISION_SDK_03_08_00_00 $INSTALL_DIR/ti_components/os_tools/linux/kernel
$> cd $INSTALL_DIR/ti_components/os_tools/linux/kernel
$> mv psdkla-kernel-REL_VISION_SDK_03_08_00_00 omap
2.2 下载ludev
$> cd
$> wget -t 0 -c https://git.ti.com/cgit/ipc/ludev/snapshot/ludev-4.16.00.00.tar.gz
$> tar zxvf ludev-4.16.00.00.tar.gz
$> cp -r ludev-4.16.00.00 $INSTALL_DIR/ti_components/os_tools/linux/kernel/cmem
$> cd $INSTALL_DIR/ti_components/os_tools/linux/kernel/cmem
$> mv ludev-4.16.00.00 ludev
2.3 下载u-boot
$> cd
$> wget -t 0 -c https://git.ti.com/cgit/glsdk/psdkla-u-boot/snapshot/psdkla-u-boot-REL_VISION_SDK_03_08_00_00.tar.gz
或
$> wget -t 0 -c https://git.ti.com/cgit/glsdk/psdkla-u-boot/snapshot/psdkla-u-boot-REL_VISION_SDK_03_08_00_00.tar.xz
我用的是xz文件
$> tar xf psdkla-u-boot-REL_VISION_SDK_03_08_00_00.tar.xz
$> cp -r psdkla-u-boot-REL_VISION_SDK_03_08_00_00 $INSTALL_DIR/ti_components/os_tools/linux/u-boot
$> cd $INSTALL_DIR/ti_components/os_tools/linux/u-boot
$> mv psdkla-u-boot-REL_VISION_SDK_03_08_00_00 u-boot
2.4 下载sgx
sgx的网站资源git.ti.com/graphics/omap5-sgx-ddk-linux和git clone的资源不一致,我用wget下载sgx发现编译的时候缺少文件,改用git下载后编译没问题。
根据官方文档配置git
先编辑.gitconfig
$>gedit /home/<username>/.gitconfig
[core]
gitproxy = none for ti.com
gitproxy = /home/<username>/git-proxy.sh
创建git-proxy.sh
$>gedit /home/<username>/git-proxy.sh
exec /usr/bin/corkscrew proxyle01.ext.ti.com 80 $*
检验是否配置成功
$> git config --list
core.gitproxy=none for ti.com
core.gitproxy=/home/<username>/git–proxy.sh
下载sgx
$> cd $INSTALL_DIR/ti_components/os_tools/linux/sgx
$> git clone git://git.ti.com/graphics/omap5-sgx-ddk-linux.git
$> cd omap5-sgx-ddk-linux/
$> git checkout -b sgx_dev 4519ed3
2.5 下载并解压文件系统
tisdk-rootfs-image-dra7xx-evm_vsdk_3_8.tar.xz
$> cd $INSTALL_DIR/ti_components/os_tools/linux/targetfs
$> chmod 777 ../targetfs
$> tar xf tisdk-rootfs-image-dra7xx-evm_vsdk_3_8.tar.xz
2.6 下载A15 Compiler and linker
gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
$> cd $INSTALL_DIR/ti_components/os_tools/linux/arm
$> tar –xvf gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
附一张资源目录:
3. 其他依赖
Ssh, corkscrew, gawk, uname, sed, u-boot-tools, dos2unix, dtrx, git, lib32z1
lib32ncurses5
lib32bz2-1.0
libc6:i386
libc6-i386
libstdc++6:i386
libncurses5:i386 libz1:i386 libc6-dev-i386 device-tree-compiler mono-
complete lzop
$>sudo apt-get install <package_name>
Build
1. 修改Rules.make的MAKECONFIG值
$> cd $INSTALL_DIR/vision_sdk/build
$> sudo gedit Rules.make
MAKECONFIG=tda2xx_evm_linux_all
2. 构建kernel、u-boot、sgx drivers
$> cd $INSTALL_DIR/vision_sdk/build
$> make linux
$> make linux_install
3. 构建sdk
$> cd $INSTALL_DIR/vision_sdk/build
$> make –s –j depend
$> make –s –j
4. 拷贝文件系统
$>cd $INSTALL_DIR/ti_components/os_tools/linux/targetfs
$>tar cvf tisdk-rootfs-image-dra7xx-evm.tar.xz ./*
$>mv ./tisdk-rootfs-image-dra7xx-evm.tar.xz
$INSTALL_DIR/vision_sdk/binaries/apps/tda2xx_evm_linux_all/hl
os/linux/boot
5. 重新编译的方法
$> cd $INSTALL_DIR/vision_sdk/build
$> make clean
$> cd $INSTALL_DIR/vision_sdk/binaries/
$> rm -rf *
然后重新2到3 step。
6. 其他问题
在编译过程中,碰到了缺少某几个包的问题,bison等(忘了),手动apt install就可以了。
运行
我选择的是SD卡only boot
1. 硬件设置
2. 制作SD卡启动盘
首先确保$INSTALL_DIR/vision_sdk/binaries/apps/tda2xx_evm_linux_all/hl
os/linux/boot是否如下四个文件:
没有问题的话,执行如下命令,制作SD卡启动盘。
$> cd $INSTALL_DIR/vision_sdk/build
$> sudo ./hlos/scripts/linux/mksdboot.sh --device /dev/<parent_device_name> --appname apps
--makeconfig tda2xx_evm_linux_all
3. 配置minicom
4. SD卡插入TDA2X主板插槽,上电,reset
终于打印系统信息了,输入root,进入系统,结束。
结束
附一张主板接线图