![]() |
|
||||||||||||||
| | 网站首页 | 数据库教程 | web编程 | 服务器 | 程序设计 | | ||
|
||
|
||||||
| 在Ubuntu上搭建E-Ink AM-100开发环境 | ||||||
作者:佚名 文章来源:不详 点击数: 更新时间:2007-9-12 ![]() |
||||||
|
E-Ink的AM-100 Active Matrix Prototyping Kit主要由4块板组成:
6英寸Active matrix display Apollo显示控制模块 Gumstix单板计算机(基于Intel XScale PXA 255) 串口适配器 一、编译Gumstix 1,安装必须的软件包。
>sudo apt-get install build-essential libncurses-dev bison flex texinfo zlib1g-dev gettext 装好后尤其要记得检测一下makeinfo工具是否可用,我就是在这里卡了好几天。 2,安装Subversion,已经装过的跳过。 >sudo apt-get install subversion wget subversion-tools 3,解压缩AM-100配套光盘上的压缩包thinspace-1-00.tar.gz到一个目录下。 我是放在/home/dmbi/thinspace下。也可以通过CVS连到EInk网站去获取最新的thinspace(密码是anonymous): >cvs -d:pserver:anonymous@support.eink.com:/home/cvsroot/ login >cvs -z3 -d:pserver:anonymous@support.eink.com:/home/cvsroot/ co thinspace 4,获取Gumstix,把它放到thinspace目录的子目录下,这里我是放在thinspace/gumstix目录下的(am100soft文档要求下载643版本的buildroot,不过不一定非要这个版本的)。 >cd /home/dmbi/thinspace >mkdir gumstix >svn co -r 643 http://svn.gumstix.com/gumstix-buildroot/trunk gumstix(备注:用export代替co也可以) PS1:光盘上附带的am100soft文档里给出的svn服务器地址是http://svn.rungie.com/svn/gumstix-buildroot/trunk,试了一下连不上去。 PS2:虽然不一定要用643版本的,1432版本的buildroot我试过也可以烧入开发板正常运行,但是AM-100开发板上的Flash容量只有4M,较新的buildroot最终生成的文件系统大约有3.5M,解压缩之后Flash只剩下60K的空间了,不够mount MMC卡,那些测试程序如果放在MMC卡上也就无法执行了,只能预先拷入thinspace/gumstix/build_arm_nofpu/root/bin下,在make打包进根文件系统。 5,buildroot在make的时候默认是不生成C++交叉编译器的,因为在test程序是用C++写的,所以我们先设定make的时候生成g++。 如果你下载的buildroot版本小于等于775,进入/home/dmbi/thinspace/gumstix目录,打开makefile,找到“INSTALL_LIBSTDCPP:=false”,改为“INSTALL_LIBSTDCPP:=true”即可; 如果buildroot版本高于775,那么makefile里已经找不到INSTALL_LIBSTDCPP这个变量了。改用如下方法打开C++选项: >cd thinspace/gumstix >make menuconfig 进入Toolchain Option菜单,往下翻,找到“Build/install c++ compiler and libstdc++?”,设为Enable,保存退出。 然后删除之前的gcc设定: >rm toolchain_build_arm_nofpu/gcc-*-final/.configured 接着命令行输入: >grep LIBSTDCPP .config 如果显示“BR2_INSTALL_LIBSTDCPP=y”,说明C++选项已经正确打开了。 注意:以上设定做完后,make可能仍然会出错,保险起见,make之前先删除目标目录: >rm -rf toolchain_build_arm_nofpu 6,编译toolchain和内核。 因为demo程序需要内核中的一些功能,先添加进去: >cd gumstix/build_arm_nofpu/busybox-1.00 >make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig 选中以下几个选项: Archival Utilities: bunzip2 Coreutilities: usleep, wc Miscellaneous Utilities: string, time Linux System Utilities: hexdump 最后开始编译整个根文件系统: >make DEPMODE=/bin/true 这个时间比较久,因为需要下载一堆东西,对于643版本,这些东西默认下载在gumstix-buildroot/sources/dl目录下,对于较新的buildroot,下载在gumstix-buildroot/dl下,这些东西可以保存起来下次编译就不用下载了,要注意buildroot的版本不同,所下载的package的版本也不同,不可混用。编译完成后,buildroot目录下会出现root_fs_arm_nofpu、uboot.bin、uboot.srec三个文件。 PS1:如果你所用的是Ubuntu系统,make到执行sh patchin.sh时会出现问题,报告“(” unexpected,这是因为Ubuntu用dash代替了bash,dash是一个简化版的shell,解决的办法就是改用bash: >cd /bin >sudo rm sh >sudo ln -s bash sh 然后回到buildroot目录再次执行make。 PS2:因为643版本较老,所以有些package的下载链接已经失效了,如果出现无法下载的情况,有两种解决办法,一时去google上搜,手动下载压缩包,下载好后放到%gumstix-buildroot%/sources/dl下就可以了,但是有一个压缩包比较特殊,就是hostapd-0.3.9.tar.gz。我发现这个压缩包每次make时都要连上internet去下载,即使预先下载放到dl目录下也没用。一劳永逸的办法是去搜一个确保可下载的链接,然后修改%gumstix-buildroot%/hostap.mk文件,把HOSTAP_URL替换成可用的链接(注意后面不要把压缩包的文件名也加上),譬如我设成:HOSTAP_URL=http://ftp.escom.bg/Linux/wireless。 PS3:对于643版本,编译出来的根文件系统文件名是root_fs_arm_nofpu,对于较新的版本,编译出来的根文件系统文件名是rootfs.arm_nofpu.jffs2 7,编译测试程序 首先把编译出来的交叉编译器arm-linux-gcc、arm-linux-g++等加入环境变量PATH: >cd /home/dmbi/thinspace >source add_gumstix_tools.sh 然后编译测试程序: >cd display_tools >make clean >make >cd .. >cd gumstix_tests >make clean >make 编译完成后会在这两个目录下生成几个可执行文件。 8,烧入开发板。 首先要配置minicom,进入miniconm按Ctrl+A再按Z进入设置菜单。先按P设置串口参数为115200 8N1。保存退出。再次返回主菜单,按O,选择Serial port setup,进入子菜单按A选择串口设备,这里我设成/dev/ttyS0,表示串口1,按F选择Hardware Flow Control为No(否则键盘会失效),保存退出后重新启动minicom。 取出开发板自带的MMC卡,将以下几个文件拷入MMC卡: 把编译好的这几个文件拷入MMC卡: root_fs_arm_nofpu(对于较新的buildroot应该是rootfs.arm_nofpu.jffs2) ../gumstix_test/gcc_test ../gumstix_test/cpp_test ../gumstix_test/run_test.sh ../gumstix_test/check_utils.sh 把MMC卡插入开发板,打开终端运行minicom,插上开发板电源,按任意键进入uboot命令行模式,输入以下命令: GUM> mmcinit GUM> fatload mmc 1 a2000000 root_fs_arm_nofpu GUM> era 1:2-31 GUM> cp.b a2000000 40000 ${filesize} GUM> boot 用root账户登录,密码是gumstix,mount MMC卡: # mount /mnt/mmc # cd /mnt/mmc # ./run_test.sh # ./check_util.sh 两个测试都应该正确通过,否则请检查前面的相关步骤。 本文来源:http://blog.csdn.net/codewarrior/archive/2007/08/23/1756285.aspx
|
||||||
| 文章录入:admin 责任编辑:admin | ||||||
| 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 | ||||||
| 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!) |
| | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 网站地图 | 管理登录 | | |||
|