【嵌入式開發】DM6467T環境搭建

本文借鑑了師兄的報告得到。感謝師兄的大力幫助。

基本環境和參數:

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章