【嵌入式开发】DM6467T环境搭建

来源:互联网 发布:淘宝网产品销量排名 编辑:程序博客网 时间:2024/06/04 00:26

本文借鉴了师兄的报告得到。感谢师兄的大力帮助。

基本环境和参数:

1.主机HOST:

WINDOWS XP SP3
IP:192.168.1.100 netmask:255.255.255.0 GateWay: 192.168.1.1

2.虚拟机 :

VMware-workstation-6.5
Fedora-10-i386-DVD
IP:192.168.1.101 netmask:255.255.255.0 GateWay: 192.168.1.1

3.TI下载包:

E:\xp_linux_share\dm6467t\DVSDK 3_10_00.mht

4.UBOOT启动参数设置:

setenv baudrate 115200
setenv “bootcmd=nboot 0x80700000 0 0x160000;bootm”
//setenv ipaddr 192.168.1.102 //路由器通过DHCP动态分配
setenv netmask 255.255.255.0
setenv gatewayip 192.168.1.1
setenv serverip 192.168.1.100

5.NFS启动:

setenv bootargs ‘mem=76M console=ttyS0,115200n8 root=/dev/nfs nfsroot=192.168.1.101:/home/sprindy/workdir/filesys,nolock ip=dhcp vpif_display.ch2_numbuffers=0 vpif_display.ch3_numbuffers=0’

一、交叉编译环境搭建

参见E:\DM6467T\StartGuide\DVEVM Software Setup for DM6467 Platforms - Texas Instruments Embedded Processors Wiki.mht
mkdirp/home/sprindy/dvsdk cd /home/sprindy/dvsdk

安装编译器:

# mkdir -p /opt
# tar -xjf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -C /opt
$ tar -xzf linuxlibs-2009.11-armv5te.tar.gz -C /home/ /dvsdk

安装linux内核:

$ tar -xzf linux-davinci-staging.tar.gz -C /home/ /dvsdk

安装DVSDK软件:

dvsdk_3_10_00_19_Setup.bin ,将DVSDK安装在/home/  /dvsdk下 cs2dm6467_1_00_00_10_Setup.bin ,将cs2dm6467安装在/home//dvsdk/dvsdk_#_##_##_##/目录下

网络文件系统搭建:

确保虚拟机安装了rpcbind和nfs服务
这里写图片描述

启动rpcbind和nfs服务:

这里写图片描述
cd/home/sprindy mkdir -p workdir/filesys
cdworkdir/filesys su root
# tar /arago-demo-image-dm6467t-evm.tar.gz
# tar /dvsdk_3_10_00_19_overlay_dm6467.tar.gz
以上两个文件解压到/home/workdir/filesys中
# chmod 777 -R /home/sprindy /workdir/filesys

添加共享目录

# vi /etc/exports
添加一行:/home/ /workdir/filesys *(rw,no_root_squash,no_all_squash,sync)
# /usr/sbin/exportfs –av
# service nfs restart
以下要以useracct用户设置

添加路径:

gedit/home//.bashrcexportPATH=/opt/arm2009q1/bin:PATH”
source/.bashrc echo $PATH
查看输出的路径是否有刚添加的上述路径。

搭建DVSDK环境:

cd /home//dvsdk/dvsdk_3_10_00_19 gedit Rules.make
确保一下参数都正确
PLATFORM=dm6467
DVSDK_INSTALL_DIR=/home/sprindy/dvsdk/dvsdk_3_10_00_19
LINUXKERNEL_INSTALL_DIR=/home/sprindy/dvsdk/../git
LINUXLIBS_INSTALL_DIR=/home/sprindy/dvsdk/../linuxlibs-2009.11-armv5te
CSTOOL_DIR=/opt/arm-2009q1
EXEC_DIR=/home/sprindy/workdir/filesys/opt/dvsdk/dm6467

二、编译UBOOT,生成uboot.bin和mkimage

确认当前路径为:/home/sprindy

1.解压:

tarxzf/mnt/hgfs/xplinuxshare/dm6467t/ubootdm646x.tar.gz mv ./git/ ./dvsdk/uboot
$ cd ./dvsdk/uboot

2.编译:

makeCROSSCOMPILE=armnonelinuxgnueabiARCH=armdistclean make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm davinci_dm6467_evm_config
$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm

3.拷贝:

suroot cp /home//dvsdk/uboot/tools/mkimage /usr/bin/

三、编译内核及DVSDK

cd /home//dvsdk/dvsdk_3_10_00_19/ make linux_clean //清除内核中相关环境配置以及生成的不配套文件
makelinux//buildlinuxkerneluImageforplatform make dsplink_arm //configure and build DSP link for ARM
makeclean// make //build the DVSDK demo applications
$ make install //拷贝生成的二进制文件到/home//workdir/filesys/opt/

四、内核烧写

将生成的zImage.bin 拷贝到E:\DM6467T\tftp目录下,双加打开该目录下的tftpd32.exe
打开超级终端,开发板上电,看到吐出的uboot信息时,按下任意键

printenv 确认参数是否正确(主要是IP地址)
确认无误后
tftp 80700000 uImage.bin
弹出如下界面:
这里写图片描述
nand erase 0x160000 0x200000//(第二个参数一定要比内核大)
nand write 0x80700000 0x160000 0x200000
boot
超级终端界面如下:
这里写图片描述
即可成功启动。

知识点:
Make clean:清除之前编译的可执行文件及配置文件
Make distclean:清除所有生成的文件

关SELinux:
# vim /etc/sysconfig/selinux
# SELINUX=enforcing
SELINUX=disabled

遇到的问题及解决办法:

编译内核时出错:找不到.config文件

scripts/kconfig/conf -s arch/arm/Kconfig


* You have not yet configured your kernel!
* (missing kernel config file “.config”)


* Please run some configurator (e.g. “make oldconfig” or
* “make menuconfig” or “make xconfig”).


make[2]: * [silentoldconfig] Error 1
make[1]: * [silentoldconfig] Error 2
CHK include/linux/version.h
make[1]: include/asm-arm/mach-types.h' is up to date.
make: *** No rule to make target
include/config/auto.conf’, needed by `include/config/kernel.release’. Stop.
解决方法:
$ 将/home//dvsdk/git/arch/arm/configs/中的davinci_dm646x_1ghz_defconfig文件拷贝到/home//dvsdk/git/目录中
然后直接make即可编译内核

编译内核时出错:命令无法识别

[sprindy@localhost git]$ make
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
UPD include/linux/version.h
Generating include/asm-arm/mach-types.h
CHK include/linux/utsrelease.h
UPD include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CC kernel/bounds.s
cc1: error: unrecognized command line option “-mlittle-endian”
cc1: error: unrecognized command line option “-mapcs”
cc1: error: unrecognized command line option “-mno-sched-prolog”
cc1: error: unrecognized command line option “-mabi=apcs-gnu”
kernel/bounds.c:1: error: bad value (armv4t) for -march= switch
kernel/bounds.c:1: error: bad value (arm9tdmi) for -mtune= switch
make[1]: * [kernel/bounds.s] Error 1
make: * [prepare0] Error 2
解决方法:
$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm

从NAND_Flash启动系统后,mount到虚拟机失败的解决办法

mount -t nfs 192.168.1.101:/home/sprindy/workdir/filesys /mnt/net/
出错提示:
rpcbind: server localhost not responding, timed out
svc: failed to register lockdv1 RPC service (errno 5).
lockd_up: makesock failed, error=-5
rpcbind: server localhost not responding, timed out
mount: mounting 192.168.1.101:/home/sprindy/workdir/filesys on /mnt/net/ failed: Input/output error
解决方法:
mount -o nolock -t nfs 192.168.1.101:/home/sprindy/workdir/filesys /mnt/net/

运行loadmodules.sh报错

root@dm6467t-evm:/opt/dvsdk/dm6467# ./loadmodules.sh
CMEMK module: built on Jul 14 2010 at 15:49:56
Reference Linux version 2.6.32
File /sim/scratch_a0868396/arago-install/dvsdk_3_10_00_19/linuxutils_2_25_04_1
0/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
CMEMK Error: CMEM phys_start (0x84c00000) overlaps kernel (0x80000000 -> 0x87000
000)
insmod: error inserting ‘cmemk.ko’: -1 Invalid parameters
DSPLINK Module (1.64) created on Date: Jul 14 2010 Time: 15:39:32
root@dm6467t-evm:/opt/dvsdk/dm6467# ./interface
Demo interface started at level 0.
CMEM Error: init: Failed to open /dev/cmem: ‘No such file or directory’
Failed to allocate memory.
Interface Error: Failed to create buftab
解决办法:
将UBOOT的启动参数中内存参数mem=112M 改为mem=76M