【TDA2x学习】5、编译第一个SDK程序

以下笔记为老版,有冗余步骤和部分问题,可能会出现无法复现的情况,建议直接看最新版(2020年8月20日):
以下笔记为老版,有冗余步骤和部分问题,可能会出现无法复现的情况,建议直接看最新版(2020年8月20日):
以下笔记为老版,有冗余步骤和部分问题,可能会出现无法复现的情况,建议直接看最新版(2020年8月20日):

【TDA2x学习】V、编译第一个SDK程序(最新版)【包含RTOS和HLOS】
【TDA2x学习】V、编译第一个SDK程序(最新版)【包含RTOS和HLOS】
【TDA2x学习】V、编译第一个SDK程序(最新版)【包含RTOS和HLOS】


一、下载SDK

/home/clay/linux目录下新建TI文件夹,下载SDK压缩包到该文件夹,如下图所示

【SDK压缩包里包含ti_componentsvision_sdk两个文件夹,务必将这两个文件夹压缩后再通过可移动设备传输。】

在这里插入图片描述

自己在这里踩的一个坑是,通过FileZilla软件传输。由于之前SDK已经拷贝到了windows中,想着可以使用这个FTP软件直接传输,不曾料想会出现一些系统文件无法传输的现象,当时也没在意,后来就一直出现“gmake 命令找不到”的错误!!!

接着在该路径下打开终端,输入unzip vision_sdk_baoge.zip进行解压,解压完毕后的SDK如下图所示
在这里插入图片描述

二、安装依赖库

安装依赖前,最好执行一下

sudo apt-get update

注意下面的所有依赖是一行,要全部复制!

sudo apt-get install ssh corkscrew gawk sed u-boot-tools dos2unix dtrx git lib32z1 lib32ncurses5 libbz2-1.0:i386 libc6:i386 libc6-i386 libstdc++6:i386 libncurses5:i386 libz1:i386 libc6-dev-i386 device-tree-compiler mono-complete lzop

三、配置文件创建

1、.gitconfig创建

终端输入以下命令创建.gitconfig。注意其中的clay要替换成自己的用户名!!!

vi /home/clay/.gitconfig

然后在文档中输入以下内容,而后保存退出。

[core]
	gitproxy = none for ti.com
	gitproxy = /home/clay/git-proxy.sh

2、git-proxy.sh创建

终端输入以下命令创建git-proxy.sh。同样需要注意其中的clay要替换成自己的用户名!!!

vi /home/clay/git-proxy.sh

然后在其中输入以下内容,而后保存退出。

exec /usr/bin/corkscrew proxyle01.ext.ti.com 80 $*

3、检验git是否配置成功

在终端输入git config --list命令,若出现下图所示内容与之前设置一样,则表示配置成功

在这里插入图片描述

四、添加环境变量

在终端输入

sudo vim ~/.bashrc

而后在最后一行加入gmake的路径,比如的的gmake是在/home/clay/linux/TI/ti_components/os_tools/linux/xdctools_3_32_01_22_core
在这里插入图片描述
那么就在.bashrc最后一行,加入如下环境变量:

值得一提的是,在vim的命令模式下,按下G可以直接跳到最后一行!

export PATH=$PATH:/home/clay/linux/TI/ti_components/os_tools/linux/xdctools_3_32_01_22_core

在这里插入图片描述

最后保存退出,重启ubuntu。

五、编译

正式开始编译之前,还要确定下是基于RTOS的编译,查看方法如下图:

在这里插入图片描述

1、进入编译路径../vision_sdk/build【注意要选择自己对应的】

cd /home/clay/linux/TI/vision_sdk/build

2、终端依次输入如下指令

gmake clean
gmake -s -j depend
gmake -s -j
gmake -s appimage

当然了哈,重复的工作谁愿意去做呢?也可以像上面一样,直接做好一个脚本,嘻嘻嘻~~~

#!/bin/bash

gmake clean
gmake -s -j depend
gmake -s -j
gmake -s appimage

①、gmake clean问题记录及解决方法

若执行gmake clean时,出现下图所示权限问题,

在这里插入图片描述

可以输入以下命令赋予gmake可执行权限,结果如下图所示

chmod 777 /home/clay/linux/TI/ti_components/os_tools/linux/xdctools_3_32_01_22_core/gmake

在这里插入图片描述
gmake clean正确执行的部分截图如下:

在这里插入图片描述

②、gmake -s -j depend问题记录及解决方法

出现如下所示问题

mkdir: 无法创建目录"/home/clay/linux/TI/vision_sdk/links_fw/include/config": 文件已存在
mkdir: 无法创建目录"/home/clay/linux/TI/vision_sdk/links_fw/include/config/apps": 文件已存在
mkdir: 无法创建目录"/home/clay/linux/TI/vision_sdk/links_fw/include/config/apps/tda2xx_evm_bios_all": 文件已存在
# makeconfig: Config is [ tda2xx_evm_bios_all ]
# makeconfig: Output file is @ /home/clay/linux/TI/vision_sdk/links_fw/include/config/apps/tda2xx_evm_bios_all/system_cfg.h
# makeconfig: Input  file is @ /home/clay/linux/TI/vision_sdk/apps/configs/tda2xx_evm_bios_all/cfg.mk
# makeconfig: Generating header ...
# makeconfig: Generating alg plugin config ...
# makeconfig: Generating usecase config ...
# makeconfig: Generating footer ...
# makeconfig: Done !!!
#
# CPUs that are NOT required but included in config [ tda2xx_evm_bios_all ],
#
# WARNING: IPU2 can be excluded from application
#
# CPUs that are required but not included in config [ tda2xx_evm_bios_all ],
#
#
# Edit /home/clay/linux/TI/vision_sdk/apps/configs/tda2xx_evm_bios_all/cfg.mk to include or exclude CPUs in an application
#
# Compiling tda2xx-evm:a15_0:release:edma3lld_drv: src/edma3_drv_init.c
# Compiling tda2xx-evm:a15_0:release:edma3lld_drv: src/edma3_drv_basic.c
make[4]: execvp: /home/clay/linux/TI/ti_components/cg_tools/linux/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc: 权限不够
# Compiling tda2xx-evm:a15_0:release:edma3lld_drv: src/edma3_drv_adv.c
make[4]: execvp: /home/clay/linux/TI/ti_components/cg_tools/linux/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc: 权限不够
/home/clay/linux/TI/vision_sdk/build/rtos/makerules/rules_a15.mk:123: recipe for target '/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_init.oa15fg' failed
make[4]: *** [/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_init.oa15fg] Error 127
make[4]: *** 正在等待未完成的任务....
/home/clay/linux/TI/vision_sdk/build/rtos/makerules/rules_a15.mk:123: recipe for target '/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_basic.oa15fg' failed
make[4]: *** [/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_basic.oa15fg] Error 127
make[4]: execvp: /home/clay/linux/TI/ti_components/cg_tools/linux/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc: 权限不够
/home/clay/linux/TI/vision_sdk/build/rtos/makerules/rules_a15.mk:123: recipe for target '/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_adv.oa15fg' failed
make[4]: *** [/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_adv.oa15fg] Error 127
/home/clay/linux/TI/vision_sdk/build/rtos/makerules/common.mk:235: recipe for target 'a15_0' failed
make[3]: *** [a15_0] Error 2
build_edma3lld.mk:12: recipe for target 'edma3lld' failed
make[2]: *** [edma3lld] Error 2
Makefile:357: recipe for target 'edma3lld' failed
make[1]: *** [edma3lld] Error 2
gmake: *** [depend] Error 2

根据提示可初步判断是/home/clay/linux/TI/ti_components/cg_tools/linux/gcc-arm-none-eabi-4_9-2015q3/bin目录下的arm-none-eabi-gcc权限不够。

可以输入以下命令赋予其可执行权限,结果如下图所示

chmod 777 /home/clay/linux/TI/ti_components/cg_tools/linux/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc

在这里插入图片描述

但是接着输入gmake -s -j depend又会出现如下所示问题…

mkdir: 无法创建目录"/home/clay/linux/TI/vision_sdk/links_fw/include/config": 文件已存在
mkdir: 无法创建目录"/home/clay/linux/TI/vision_sdk/links_fw/include/config/apps": 文件已存在
mkdir: 无法创建目录"/home/clay/linux/TI/vision_sdk/links_fw/include/config/apps/tda2xx_evm_bios_all": 文件已存在
# makeconfig: Config is [ tda2xx_evm_bios_all ]
# makeconfig: Output file is @ /home/clay/linux/TI/vision_sdk/links_fw/include/config/apps/tda2xx_evm_bios_all/system_cfg.h
# makeconfig: Input  file is @ /home/clay/linux/TI/vision_sdk/apps/configs/tda2xx_evm_bios_all/cfg.mk
# makeconfig: Generating header ...
# makeconfig: Generating alg plugin config ...
# makeconfig: Generating usecase config ...
# makeconfig: Generating footer ...
# makeconfig: Done !!!
#
# CPUs that are NOT required but included in config [ tda2xx_evm_bios_all ],
#
# WARNING: IPU2 can be excluded from application
#
# CPUs that are required but not included in config [ tda2xx_evm_bios_all ],
#
#
# Edit /home/clay/linux/TI/vision_sdk/apps/configs/tda2xx_evm_bios_all/cfg.mk to include or exclude CPUs in an application
#
# Compiling tda2xx-evm:a15_0:release:edma3lld_drv: src/edma3_drv_init.c
# Compiling tda2xx-evm:a15_0:release:edma3lld_drv: src/edma3_drv_basic.c
# Compiling tda2xx-evm:a15_0:release:edma3lld_drv: src/edma3_drv_adv.c
arm-none-eabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
/home/clay/linux/TI/vision_sdk/build/rtos/makerules/rules_a15.mk:123: recipe for target '/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_init.oa15fg' failed
make[4]: *** [/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_init.oa15fg] Error 1
make[4]: *** 正在等待未完成的任务....
arm-none-eabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
/home/clay/linux/TI/vision_sdk/build/rtos/makerules/rules_a15.mk:123: recipe for target '/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_basic.oa15fg' failed
make[4]: *** [/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_basic.oa15fg] Error 1
arm-none-eabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
/home/clay/linux/TI/vision_sdk/build/rtos/makerules/rules_a15.mk:123: recipe for target '/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_adv.oa15fg' failed
make[4]: *** [/home/clay/linux/TI/vision_sdk/binaries/apps/tda2xx_evm_bios_all/obj/edma3lld_drv/tda2xx-evm/a15/release/edma3_drv_adv.oa15fg] Error 1
/home/clay/linux/TI/vision_sdk/build/rtos/makerules/common.mk:235: recipe for target 'a15_0' failed
make[3]: *** [a15_0] Error 2
build_edma3lld.mk:12: recipe for target 'edma3lld' failed
make[2]: *** [edma3lld] Error 2
Makefile:357: recipe for target 'edma3lld' failed
make[1]: *** [edma3lld] Error 2
gmake: *** [depend] Error 2

最后忍无可忍,将TI文件夹及其包含的文件和文件夹权限全部开启…

命令如下:

chmod 777 -R /home/clay/linux/TI

gmake -s -j depend正确执行的部分截图如下:

在这里插入图片描述

③、输入gmake -s -j

无问题…

正确执行部分截图如下
在这里插入图片描述

④、输入gmake -s appimage

无问题…

正确执行部分截图如下
在这里插入图片描述

3、输出AppImage,即最终板子运行的文件。

在这里插入图片描述


  • 编写(参考)程序路径为:
./vision_sdk/apps/src/rtos/usecases
  • 参考手册路径
./vision_sdk/docs
  • VisionSDK_DevelopmentGuide.pdf参考手册路径
./vision_sdk/docs/FeatureSpecificUserGuides
  • 判断是否是新的vision_sdk可以看这个路径
./vision_sdk/apps/src/rtos/usecases/hhsq_adas_system
ReCclay CSDN认证博客专家 视觉/OpenCV 图像处理 深度学习
大家好,我是CSDN博主ReCclay,目前处于研究生阶段,就读于电子科技大学,主攻方向为汽车辅助驾驶算法研究。入站以来,凭借坚持与热爱,以博文的方式分享所学,截止目前累计博文数量达800余篇,受益人次达135万余次,涉及领域包括但不限于物联网开发、单片机开发、Linux驱动开发、FPGA开发、前/后端软件开发等。在未来我将继续专注于嵌入式相关领域,学习更多的科技知识,输出更高质量的博文。希望在”2020博客之星年度总评选“中,可以大家的关注和投票,投票地址:https://bss.csdn.net/m/topic/blog_star2020/detail?username=recclay
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页