Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15497138
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类:

2009-03-09 22:29:47


浅析如何编译eCos系统Redboot单元

在packages/ecos.db文件中包含我们能够生成的所有targets,其中就包括我们需要的ep9312
target edb9312 {
    alias { "Cirrus Logic EDB9312 evaluation board" ep9312 }
    packages { CYGPKG_HAL_ARM
                  CYGPKG_HAL_ARM_ARM9
                  CYGPKG_HAL_ARM_ARM9_EP93XX
                  CYGPKG_DEVS_FLASH_STRATA
                  CYGPKG_DEVS_FLASH_EDB9312
                  CYGPKG_DEVS_ETH_ARM_EP93XX
    }
    description "The EDB9312 target provides the packages needed to run eCos on the Cirrus Logic EP9312 based development boards."
    set_value CYGHWR_HAL_ARM_EDB93XX_VARIANT "EP9312"
}
下载ecos用到的toolchain
luther@gliethttp:/vobs/tmp/ep9312$ wget --passive-ftp ftp://ecos.sourceware.org/pub/ecos/ecos-install.tcl

luther@gliethttp:/vobs/tmp/ep9312$ sh ecos-install.tcl //然后选择安装就可以了

luther@gliethttp:/vobs/tmp/ep9312$ export ECOS_REPOSITORY=/vobs/works/ecos-2.0/packages
下面new target template,这里target就是packages/ecos.db中包含的ep9312;templates就是packages/templates下的redboot
生成一个新的ecos.ecc平台配置文件
luther@gliethttp:/vobs/tmp/ep9312$ /vobs/works/ecos-2.0/tools/bin/ecosconfig new ep9312 redboot
U CYGPKG_HAL_ARM_ARM9_ARM920T, new inferred value 1
U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0
//========================

如果使用的是GUI配置工具configtool,那么需要作如下选择:
luther@gliethttp:/vobs/tmp/ep9312$ /vobs/works/ecos-2.0/tools/bin/configtool
1.Build-->Templates下
Hardware选择"Cirrus Logic EDB9312 evaluation board"
Packages选择"redboot"
如果出现resolve conflicts对话框,那么直接点Continue按钮即可.
2.保存ctrl+s
比如保存为ep9312.ecc,与此同时configtool会执行tree操作.
3.ls一下
luther@gliethttp:/vobs/tmp/ep9312$ ls
ep9312_build ep9312.ecc ep9312_install ep9312_mlt
4.import进来ep93xx
File-->Import
选择/vobs/works/ecos-2.0/packages/hal/arm/arm9/ep93xx/v2_0/misc/redboot_ROMRAM.ecm
然后再ctrl+s保存
5.修改脚本tail
luther@gliethttp:/vobs/tmp/ep9312$ vim ep9312_build/hal/arm/arch/v2_0/makefile
将如下几个tail +2全部改为tail -n+2
ep9312_build/hal/arm/arch/v2_0/makefile|50| @tail +2 arm.tmp >> $(notdir $@).deps
ep9312_build/hal/arm/arch/v2_0/makefile|58| @tail +2 vectors.tmp >> $(notdir $@).deps
ep9312_build/hal/arm/arch/v2_0/makefile|66| @tail +2 target.tmp >> $(notdir $@).deps
6.然后就可以执行build了
7.烧写到开发板上
luther@gliethttp:/vobs/tmp/ep9312$ /vobs/tftp-dir/download -p1 ep9312_install/bin/redboot.bin
//========================

luther@gliethttp:/vobs/tmp/ep9312$ ls
ecos.ecc
//因为target已经完美的实现了开发板定制,所以就不需要作如下的import属性导入修改操作了,如果我们是自己定义的一个全新ep93xx平台或者

//做了很多平台相关的修改,那么我们就需要通过import继承很多ep93xx默认属性[luther.gliethttp]

//luther@gliethttp:/vobs/tmp/ep9312$ /vobs/works/ecos-2.0/tools/bin/ecosconfig import /vobs/works/ecos-2.0/packages/hal/arm/arm9/ep93xx/v2_0/misc/redboot_ROMRAM.ecm

luther@gliethttp:/vobs/tmp/ep9312$ /vobs/works/ecos-2.0/tools/bin/ecosconfig import ${ECOS_REPOSITORY}/hal/arm/arm9/ep93xx/v2_0/misc/redboot_ROMRAM.ecm
luther@gliethttp:/vobs/tmp/ep9312$ /vobs/works/ecos-2.0/tools/bin/ecosconfig tree //根据ecos.ecc生成对应的目录和makefile文件等

luther@gliethttp:/vobs/tmp/ep9312$ ls
ecos.ecc hal infra install isoinfra language makefile net redboot services

安装arm-elf-gcc编译器
luther@gliethttp:/vobs/tools/arm-tools$ wget http://

作如下修改,否则报错:tail: cannot open `+43' for reading: No such file or directory
以下方法参考:http://hi.baidu.com/xxwl04108/blog/item/5e0706ecd77e92d22f2e21c3.html
luther@gliethttp:/vobs/tools/arm-tools$ sed '
s/^tail /tail -n/' arm-elf-tools-20030314.sh > arm-elf-tools-20030314.sh.luther
luther@gliethttp:/vobs/tools/arm-tools$ chmod +x arm-elf-tools-20030314.sh.luther
luther@gliethttp:/vobs/tools/arm-tools$ sudo ./arm-elf-tools-20030314.sh.luther 这样就可以正常安装了

将如下几个tail +2全部改为tail -n+2,否则将提示:
hal/arm/arch/v2_0/makefile|50| @tail +2 arm.tmp >> $(notdir $@).deps
hal/arm/arch/v2_0/makefile|58| @tail +2 vectors.tmp >> $(notdir $@).deps
hal/arm/arch/v2_0/makefile|66| @tail +2 target.tmp >> $(notdir $@).deps

luther@gliethttp:/vobs/tmp/ep9312$ export INCLUDE_PATH='
-I/vobs/works/ecos-2.0/packages/io/eth/v2_0/include'

luther@gliethttp:/vobs/tmp/ep9312$ vim /vobs/works/ecos-2.0/packages/hal/arm/arch/v2_0/src/redboot_linux_exec.c
原内容 #include
改为 #include
luther@gliethttp:/vobs/tmp/ep9312$ vim /vobs/works/ecos-2.0/packages/io/eth/v2_0/include/eth_drv.h
注释掉 #include
注释掉 /vobs/works/ecos-2.0/packages/hal/arm/arch/v2_0/src/redboot_linux_exec.c|389|第389行
/* add by luther
    if (__local_enet_sc) {
        __local_enet_sc->funs->stop(__local_enet_sc);
    }
*/
luther@gliethttp:/vobs/tmp/ep9312$ make
luther@gliethttp:/vobs/tmp/ep9312$ ls install/bin/ //这样我们就生成了redboot了
redboot.bin redboot.elf redboot.img redboot.srec
//========================
浅析如何配置ecos图形界面

find . -type f -exec dos2unix '
{}' ';


1.建立图形配置程序所需的so库
luther@gliethttp:/vobs/tmp/luther$ sudo ln -s /usr/lib/libpng12.so.0.27.0 /usr/lib/libpng.so.2
luther@gliethttp:/vobs/tmp/luther$ sudo ln -s /usr/lib/libtiff.so.4.2.1 /usr/lib/libtiff.so.3
2.启动图形配置程序configtool
luther@gliethttp:/vobs/tmp/luther$ /vobs/works/ecos-2.0/tools/bin/configtool
//========================
//开发环境tcl和tk的建立
1.
luther@gliethttp:/vobs/tmp$ mkdir luther
2.
luther@gliethttp:/vobs/tmp/luther$ sudo apt-get install tcl-dev
luther@gliethttp:/vobs/tmp/luther$ sudo apt-get install tk-dev
3.建立环境
后来在/vobs/works/ecos-2.0/tools/src/libcdl/configure中发现:
if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then
    { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; }
fi
luther@gliethttp:/vobs/tmp/luther$ export TCL_INC_DIR=/usr/include/tcl8.4
4.可以执行配置了
luther@gliethttp:/vobs/tmp/luther$ /vobs/works/ecos-2.0/configure
5.make环境设置
luther@gliethttp:/vobs/tmp/luther$ vim /vobs/works/ecos-2.0/tools/src/infra/assert.cxx
#include       // add by luther.gliethttp
luther@gliethttp:/vobs/tmp/luther$ vim /vobs/works/ecos-2.0/tools/src/libcdl/cdlmisc.cxx
#include       // add by luther.gliethttp
luther@gliethttp:/vobs/tmp/luther$ vim /vobs/works/ecos-2.0/tools/src/libcdl/parse.cxx
#include       // add by luther.gliethttp
luther@gliethttp:/vobs/tmp/luther$ vim /vobs/works/ecos-2.0/tools/src/libcdl/build.cxx
#include       // add by luther.gliethttp
luther@gliethttp:/vobs/tmp/luther$ vim /vobs/works/ecos-2.0/tools/src/tools/configtool/standalone/common/ecosconfig.cxx
#include       // add by luther.gliethttp
luther@gliethttp:/vobs/tmp/luther$ vim /vobs/works/ecos-2.0/tools/src/tools/configtool/standalone/common/cdl_exec.cxx
#include       // add by luther.gliethttp

阅读(4290) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~