DM365 dvsdk_4_02_00_06开发环境搭建

1、简介

本文主要介绍在ubuntu10.04下安装TI的多媒体处理器TMS320DM365的开发环境,使用的新版DVSDK开发包,版本为dvsdk_4_02_00_06。

DM368的新版本DVSDK环境搭建跟DM365的很类似,直接参考即可。


2、声明

本文源自蓝海@博客站:http://kevinxie.blog.51cto.com,原创作品,转载请保留本声明,以示对作者劳动的尊重。

博客上排版、格式处理等不太方便,所以几乎每一篇博文,作者都会用Word整理出一个排版处理好的文档,在作者的51CTO博客和CSDN博客两资源下载处免费提供下载,同时与文档相应的源码和资料也提供下载,51CTO下载网址:http://down.51cto.com/2942897,CSDN下载网址:http://download.csdn.net/user/r051463438


3、安装Vmware Workstation 7.1.3

Windows下普通软件安装,参阅网上资料即可。


4、安装ubuntu 10.04

ubuntu10.04环境安装不在本文档内详细介绍,请参考另一文档《VM下安�bubuntu10.04的详细图文笔记》。安装完ubuntu后,还有一些小项需要配置,请参考另一文档《新装ubuntu10.04后的一些设置》。这两个文档参考声明部分里作者的博客或文档下载的有关内容。


5、设置共享目录

以上完成后,新建一个共享目录,用于在ubuntu与windows之间共享文件,并在VMware虚拟机上进行设置,实现共享。这里我用于共享的目录是“F:\ubuntu\share_dir”,同时在ubuntu下看到的名称设置为“share_dir”,根据自己的情况进行适当的修改,但最好在ubuntu下的名称一样,方便看笔记。


6、准备安装文件

到TI官网下载DM365最新版的软件开发包dvsdk_4_02_00_06,下载网址如下:

http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_4_00/4_02_00_06/index_FDS.html

下载文件为dvsdk_dm365-evm_4_02_00_06_setuplinux,是没有扩展名的,下载需要注册,并填写一些信息才能通过下载。

新版的DVSDK所需的交叉编译工具链和以前用的DVSDK_2_10_01_18时的不一样,也要重新下载,下载网址如下:

https://sourcery.mentor.com/sgpp/lite/arm/portal/release858

下载文件为arm-2009q1-203-arm-none-linux-gnueabi.bin

下载完后,将这两个文件拷贝到共享目录“F:\ubuntu\share_dir”下,这样LINUX端就可以在/mnt/hgfs/share_dir/下看到它们:

arm-2009q1-203-arm-none-linux-gnueabi.bin

dvsdk_dm365-evm_4_02_00_06_setuplinux


7、交叉编译工具的安装

切换当前工作目录到/mnt/hgfs/share_dir/,执行下面的命令开始安装

cd /mnt/hgfs/share_dir

sudo ./arm-2009q1-203-arm-none-linux-gnueabi.bin

安装交叉编译环境时可能会出现这样的错误:

kevin@kv-ubuntu:share_dir$sudo ./arm-2009q1-203-arm-none-linux-gnueabi.bin

Theinstaller has detected that your system uses the dash shell

as /bin/sh.  This shell is not supported by the installer.

You canwork around this problem by changing /bin/sh to be a

symboliclink to a supported shell such as bash.

Forexample, on Ubuntu systems, execute this shell command:

  % sudo dpkg-reconfigure -plow dash

  Install as /bin/sh? No

Pleaserefer to the Getting Started guide for more information,

orcontact CodeSourcery Support for assistance.

阅读返回的错误信息大概可以知道是当前的dash shell不支持安装,解决的办法也已经给出,直接按返回的信息上的解决办法,在终端输入命令:

sudo dpkg-reconfigure -plow dash

中间提示“Install dashas /bin/sh?”时选择“No”,如图所示。

该过程返回的信息如下所示:

Removing`diversion of /bin/sh to /bin/sh.distrib by dash'

Adding`diversion of /bin/sh to /bin/sh.distrib by bash'

Removing`diversion of /usr/share/man/man1/sh.1.gz to/usr/share/man/man1/sh.distrib.1.gz by dash'

Adding`diversion of /usr/share/man/man1/sh.1.gz to/usr/share/man/man1/sh.distrib.1.gz by bash'

解决问题后再重新执行一次安装交叉编译工具命令,现在就可以正常安装了,接着上面的安装过程截图如下:

直接下一步next

选择接收license条款,下一步next

直接下一步

选择典型安装Typical,然后下一步

这一步是选择交叉编译工具的安装路径,不用默认的,点Choose选择按钮

选择安装路径为/opt/arm-2009q1,如果目录不存在,先新建目录,创建按钮在图右上角圈出

路径好了,下一步

选择Modefy PATH for current user,下一步

选择Link链接安装目录,点击Choose按钮

路径选择为/opt/arm-2009q1/CodeSourcery,目录不存在则先创建

安装信息预览,确定无误后,点击install按钮开始安装

等待安装完成。。。。。。

点下一步

安装完成,点Done按钮退出安装界面。


8、交叉编译工具的配置

vim ~/.bashrc

在最后加入下面内容:

export  PATH="/opt/arm-2009q1/bin:$PATH"

运行:

source ~/.bashrc

使环境变量生效,现在打印一下PATH变量,其中应该要包括刚刚加入的“/opt/arm-2009q1/bin”

echo $PATH

我的回显如下所示:

kevin@kv-ubuntu:share_dir$echo $PATH

/opt/arm-2009q1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

现在,在终端输入“arm-”再按tab键就会出现交叉编译工具。

kevin@kv-ubuntu:share_dir-2$arm-none-linux-gnueabi-

arm-none-linux-gnueabi-addr2line  arm-none-linux-gnueabi-gprof

arm-none-linux-gnueabi-ar         arm-none-linux-gnueabi-ld

arm-none-linux-gnueabi-as         arm-none-linux-gnueabi-nm

arm-none-linux-gnueabi-c++        arm-none-linux-gnueabi-objcopy

arm-none-linux-gnueabi-c++filt    arm-none-linux-gnueabi-objdump

arm-none-linux-gnueabi-cpp        arm-none-linux-gnueabi-ranlib

arm-none-linux-gnueabi-g++        arm-none-linux-gnueabi-readelf

arm-none-linux-gnueabi-gcc        arm-none-linux-gnueabi-size

arm-none-linux-gnueabi-gcc-4.3.3  arm-none-linux-gnueabi-sprite

arm-none-linux-gnueabi-gcov       arm-none-linux-gnueabi-strings

arm-none-linux-gnueabi-gdb        arm-none-linux-gnueabi-strip

arm-none-linux-gnueabi-gdbtui    


9、安装DVSDK_4_02_00_06

在/mnt/hgfs/share_dir/目录下执行安装dvsdk开发包,以普通用户安装就行。

./dvsdk_dm365-evm_4_02_00_06_setuplinux

安装开始,过程截图如下:

直接Yes

直接下一步

到了这步就出现错误了,从错误提示信息可以看到,是fakeroot没找到,要安装一下,安装命令错误信息里也给出了,在终端输入命令安装:

sudo apt-get install fakeroot

整个安装回显如下:

kevin@kv-ubuntu:share_dir$ sudo apt-get installfakeroot

Reading package lists... Done

Building dependency tree      

Reading state information... Done

The following NEW packages will be installed:

 fakeroot

0 upgraded, 1 newly installed, 0 to remove and 316 notupgraded.

Need to get 118kB of archives.

After this operation, 451kB of additional disk spacewill be used.

WARNING: The following packages cannot beauthenticated!

 fakeroot

Install these packages without verification[y/N]? y

Get:1 http://cn.archive.ubuntu.com/ubuntu/ lucid/mainfakeroot 1.14.4-1ubuntu1 [118kB]

Fetched 118kB in 1s (107kB/s)  

Selecting previously deselected package fakeroot.

(Readingdatabase ... 129286 files and directories currently installed.)

Unpacking fakeroot (from .../fakeroot_1.14.4-1ubuntu1_i386.deb)...

Processing triggers for man-db ...

Setting up fakeroot (1.14.4-1ubuntu1)...

update-alternatives: using /usr/bin/fakeroot-sysv toprovide /usr/bin/fakeroot (fakeroot) in auto mode.

安装结束后,再重新执行dvsdk的安装命令,这回就不会再出现错误了,接着上面的安装过程,截图如下所示:

直接Next

选择交叉编译工具链路径,按上面的安装,这里应该选择“/opt/arm-2009q1/bin”,选择好后OK继续

提示在指定路径下找到了可用的交叉编译工具链

选择DVSDK安装路径

安装路径设置为“/home/kevin/dvsdk_4_02_00_06-dm365”,这里我直接输入然后点OK

最后可以看到DVSDK安装路径,下一步

选择组件,全部选择,下一步

安装开始前信息浏览,正确无误可以下一步了

等待安装完成。。。。。。。。。。

安装项目全部完成后,“Next”按钮会使能,点击到下一步

点击Finish按钮退出安装界面,安装结束后会打开一个PDF版本的软件开发指南文档。


10、编译DVSDK_4_02_00_06

从DVSDK4开始,TI的达芬奇软件开发包一改以往的软件多、散、乱(特别是DVSDK2),把所有的包全部集合到了一起,一个包就全部安装完了,方便了很多,相比以前的软件包确实人性化了一点。

现在到dvsdk安装目录下一睹它的“芳容”吧。

cd ~/dvsdk_4_02_00_06-dm365

ls

du -sh


整个软件包安装完只有1.9GB,当然,这是还没有编译之前的,编译后就不止这个数了。现在就编译一下,也可以检验一下前面安装的交叉编译工具是否正确,编译的目标是什么呢,说实话这新的DVSDK也是第一次用,编译的目标真不知道叫什么,先看看DVSDK根目录下的Makefile文件吧,看完就知道怎么用了。

先来个全部清除,在终端输入如下命令:

make clean

更多的用法通过help目标来查看:

make help


清除u-boot使用命令:

make u-boot_clean

编译u-boot使用命令:

make u-boot

清除kernel使用命令:

make linux_clean

配置kernel使用命令:

make linux_config

编译kernel使用命令:

make linux

这一版的DVSDK编译的时候我发现有一个很隐蔽的问题,是在编译内核的过程中打印了出来的,但是编译过程不会停止,所以不注意观察的话较难发现,该问题打印信息如下:

"mkimage" command not found -U-Boot images will not be built

mkimage命令没找到,这个问题比较普遍,也容易解决。mkimage是u-boot的tools目录下的一文件,要编译u-boot后才会生成的,生成之后,要将这个文件拷贝到交叉编译工具的bin目录下,这样才能在编译内核时正确生成可以被u-boot引导起来的uImage镜像文件。知道了原因解决办法就好办了,下面列出两种解决办法,任选其一即可。

第一种办法是单独编译u-boot,编译完后将tools目录下的mkimage文件拷贝到前面安装的交叉编译工具目录下的bin目录里:

make u-boot

sudo cp psp/u-boot-2010.12-rc2-psp03.01.01.39/tools/mkimage /opt/arm-2009q1/bin/

另一办法就是直接在线安装一个,在终端输入命令:

sudo apt-getinstall mkimage

然后就可以开始编译所有的软件了

make

这个过程要花点时间,打杯水休息一下,等着它编译。在差不多编译完成时,到了倒数第二个目标gstreamer-ti的时候,会出现下面的错误:

make[1]: Entering directory`/home/kevin/dvsdk_4_02_00_06-dm365/gstreamer-ti_svnr919'

./autogen.sh --noconfigure

+ configure run disabled

+ check for build tools

 checking for autoconf >= 2.52 ... notfound.

 checking for autoconf259 >= 2.52 ... notfound.

 checking for autoconf257 >= 2.52 ... notfound.

 checking for autoconf-2.54 >= 2.52 ... notfound.

 checking for autoconf-2.53 >= 2.52 ... notfound.

 checking for autoconf-2.52 >= 2.52 ... notfound.

not found !

You must have autoconfinstalled to compile gstticodecplugin.

Download the appropriatepackage for your distribution,

or get the source tarball atftp://ftp.gnu.org/pub/gnu/autoconf/

 checking for automake >= 1.7 ... notfound.

 checking for automake-1.9 >= 1.7 ... notfound.

 checking for automake19 >= 1.7 ... notfound.

 checking for automake-1.7 >= 1.7 ... notfound.

 checking for automake-1.6 >= 1.7 ... notfound.

 checking for automake-1.5 >= 1.7 ... notfound.

not found !

You must have automakeinstalled to compile gstticodecplugin.

Download the appropriatepackage for your distribution,

or get the source tarball atftp://ftp.gnu.org/pub/gnu/automake/

 checking for libtoolize >= 1.5.0... found 2.2.6b, ok.

 checking for pkg-config >= 0.8.0... found 0.23, ok.


- Please get the right toolsbefore proceeding.

- Alternatively, if you'resure we're wrong, run with --nocheck.

make[1]: *** [configure]Error 1

make[1]: Leaving directory`/home/kevin/dvsdk_4_02_00_06-dm365/gstreamer-ti_svnr919'

make: *** [gstreamer_ti]Error 2

意思已经说的很明显了,没有检测到autoconf和automake,在终端输入命令安装:

sudo apt-getinstall autoconf automake

安装过程要求输入确认信息,输入Y

kevin@kv-ubuntu:dvsdk_4_02_00_06-dm365$sudo apt-get install autoconf automake

Reading package lists...Done

Building dependency tree      

Reading state information...Done

The following extra packageswill be installed:

 autotools-dev m4

Suggested packages:

 autoconf2.13 autoconf-archive gnu-standardsautoconf-doc libtool gettext

The following NEW packageswill be installed:

 autoconf automake autotools-dev m4

0 upgraded, 4 newly installed,0 to remove and 347 not upgraded.

Need to get 1,685kB ofarchives.

After this operation, 4,915kBof additional disk space will be used.

Do you want tocontinue [Y/n]? y

WARNING: The followingpackages cannot be authenticated!

 m4 autoconf autotools-dev automake

Install thesepackages without verification [y/N]? y

Get:1http://cn.archive.ubuntu.com/ubuntu/ lucid/main m4 1.4.13-3[241kB]

Get:2http://cn.archive.ubuntu.com/ubuntu/ lucid/main autoconf 2.65-3ubuntu1[772kB]                            

Get:3http://cn.archive.ubuntu.com/ubuntu/ lucid/main autotools-dev 20090611.1[64.1kB]                          

Get:4http://cn.archive.ubuntu.com/ubuntu/ lucid/main automake 1:1.11.1-1[608kB]                                

Fetched 1,685kB in 1min 42s(16.4kB/s)                                                                          

Selecting previouslydeselected package m4.

(Reading database ... 130369 files anddirectories currently installed.)

Unpacking m4 (from.../archives/m4_1.4.13-3_i386.deb) ...

Selecting previouslydeselected package autoconf.

Unpacking autoconf (from.../autoconf_2.65-3ubuntu1_all.deb) ...

Selecting previouslydeselected package autotools-dev.

Unpacking autotools-dev (from.../autotools-dev_20090611.1_all.deb) ...

Selecting previouslydeselected package automake.

Unpacking automake (from.../automake_1%3a1.11.1-1_all.deb)...

Processing triggers forinstall-info ...

Processing triggers forman-db ...

Processing triggers fordoc-base ...

Processing 26 changed 1 addeddoc-base file(s)...

Registering documents withscrollkeeper...

Setting up m4 (1.4.13-3)...

Setting up autoconf(2.65-3ubuntu1) ...

Setting up autotools-dev(20090611.1) ...

Setting up automake (1:1.11.1-1)...

update-alternatives: using/usr/bin/automake-1.11 to provide /usr/bin/automake (automake) in auto mode.

安装完成后,再重新输入命令编译所有软件

make

这回所有的错误都解决了,几分钟就可以把剩下的编译完,到此,基本上大功告成。


11、安装NFS文件系统

在DVSDK根目录下可以看到一个名为filesystem的目录,在该目录下,TI提供了两个文件系统压缩包:


其中dvsdk-dm365-evm-rootfs.tar.gz比较大,有265M,但东西全,也是该版本DVSDK默认使用的NFS调试文件系统。另一个arago-base-tisdk-image-dm365-evm.tar.gz小些,才11M,适合烧写。解压其中大的到/home/kevin/targetfs/目录下,作为NFS调试挂载的文件系统

mkdir ~/targetfs

cd ~/dvsdk_4_02_00_06-dm365/filesystem

sudo tar -zxvf dvsdk-dm365-evm-rootfs.tar.gz -C ~/targetfs

修改文件系统的用户和组为普通用户,我这里是kevin

sudo chown kevin:kevin ~/targetfs -R

修改Rules.make中安装指向的地址为新的文件系统地址

cd ~/dvsdk_4_02_00_06-dm365

vim Rules.make

将最后一行的EXEC_DIR改成新的文件系统路径,最终如下

EXEC_DIR=$(HOME)/targetfs

最后安装上面我们编译好的文件,新文件系统就完工了。

make install


12、参考资料

1、http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_4_00/4_02_00_06/index_FDS.html

2、http://zjbintsystem.blog.51cto.com/964211/621435



蓝海 <[email protected]>

2012年01月05日于北京海淀


你可能感兴趣的:(开发环境,环境搭建,DVSDK,DM365,DM368,4_02_00_06)