手动安装过程如下:
一,下载软件
1,下载JRE(Java Runtime Environment) 。( http://java.sun.com/javase/downloads/index.jsp )
在打开的网页中点击JRE,之后就可下载了
2,下载eclipse SDK,( http://www.eclipse.org/downloads/ )
在打开的链接页面中,点取JRE(记住是linux平台)
因为该软件已经集成了CDT,所以有这两个包就够了。
二,安装JRE
1,建立java目录(下面第1步和第2步不是必需的,只要有一供自解压用的临时文件夹即可)
[root@localhost ~]#mkdir /usr/local/java
2,将下载的JRE软件存放到java目录下
3,添加JRE的执行权限
[root@localhost java]# chmod a+x jre-6u24-linux-i586-rpm.bin
4,执行自解压包
[root@localhost java]# ./jre-6u24-linux-i586-rpm.bin
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
inflating: jre-6u24-linux-i586.rpm
Preparing... ########################################### [100%]
1:jre ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...
Done.
5,rpm安装
[root@localhost java]# rpm -ivh jre-6u24-linux-i586.rpm
Preparing... ########################################### [100%]
package jre-1.6.0_24-fcs.i586 is already installed
[root@localhost java]#
(此时会将JRE装在/usr/java/jre1.6.0_24目录下)
6, 设定环境变量,让Linux能找到JRE
[root@localhost java]#vi /etc/profile
(将以下内容加入在档案后面)
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib:.
export JAVA_HOME
export PATH
export CLASSPATH
7, 测试Java是否安装成功
[root@localhost ~]# java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)
[root@localhost ~]#
1,找到eclipse档案所在文件夹
[root@localhost smbroot]# ls
eclipse-linuxtools-helios-SR1-incubation-linux-gtk.tar.gz
JLink_Linux_V422.tgz
jre-6u24-linux-i586-rpm.bin
linux-2.6.32.2.tar.bz2
[root@localhost smbroot]#
[root@localhost local]#
4,进入eclipse目录
[root@localhost eclipse]#
[root@localhost eclipse]#./eclipse
(将Use this as the default and do not ask again打勾,以后就不会出现这个窗口)
点击OK,会出现如下界面
Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.epp.usagedata.internal.gathering.services.UsageDataService$1
[root@localhost eclipse]#
6,安装git版本控制插件
如果不想使用中文界面,想回到之前使用的英文界面,那么可以在启动时加入启动参数-NL en_US,如eclipse -NL en_US 。
在桌面上点击右键,然后点取“创建起动器”,弹出创建起动器对话框,
[root@localhost eclipse]#cp /usr/local/eclipse/icon.xpm /usr/share/pixmaps
将eclipse启动用的图标icon.xpm复制目录pixmaps下。
B,点取“无图标”按钮,在弹出的对话框选中刚加入的图标icon.xpm,点“确定”返回。
C,在命令栏中点击“浏览”,定位到/usr/local/eclipse/下,选中eclipse应用程序。
D,在名称栏中输入”eclipse“,即在桌面上显示的程序的名字。
E,可以在注释行添上相关注释。
F,点击“确定”,完成设置。
之后,可以在桌面上看到eclipse的应用图标。
在eclipse安装成功后,如果需要开发嵌入式arm系统,就需要安装GNU ARM Eclipse Plug-in插件,参考文章
http://blog.ednchina.com/baifanshuishou/1858550/Message.aspx
GNU ARM Eclipse Plug-in 下载
http://sourceforge.net/projects/gnuarmeclipse/
GNU ARM Eclipse Plug-in 安装
http://sourceforge.net/apps/mediawiki/gnuarmeclipse/index.php?title=Plug-in_Installation
在插件安装成功后,需要在工程文件中进行相应设置
1,在eclipse主窗口,点击project->Properties,在打开的对话框中的左边列表中找到C++ Build->Tool Chain Editor,在Used tools中点击Select Tools按钮,在弹出的对话框的左边Available tools中分别双击ARM GCC C Compileler和ARM GCC Assembler,使其添加到右边Used tools当中。
然后点击OK,返回。在Current builder一栏选中ARM Sourcery Linux GNU Make builder,点击OK,返回主界面。
如果进行了以上部分的操作的话,并且您的主机上事先还没有安装Sourcery G++ Lite 编译器的话,那么将会出现下图中所示的“/bin/sh: arm-none-eabi-gcc: command not found”。
五,安装Sourcery G++ Lite 编译工具
Sourcery G++ Lite是一款免费的编译工具软件,针对ARM体系结构有三个不同版本:arm-none-eabi用于针对裸机目标板(不带操作系统)的固件开发,如,RTOS或Bootloader等;arm-linux-gnueabi主要用于基于Linux内核的应用开发;arm-uclinuxeab主要用于基于uClinux内核的应用开发。并且针对这三种用途分别有windows版和linux版,Getting Started Guide (PDF)中有详细的介绍。
1,在开始安装之前,请先阅读Getting Started Guide (PDF),然后下载arm-2010.09-51-arm-none-eabi,http://www.codesourcery.com/sgpp/lite/arm/portal/release1592
2,按照第二章的步骤,应该能够顺利地将上述三个编译器之一或全部安装自己的主机上。当下载完成之后,可以看到以下三个软件。
在 arm-2010.09-51-arm-none-eabi上双击,启动安装程序。
点击运行
点击 I accept ...
然后一直next,在下面的对话框中选择Choose按钮
将路径改为(不必需)下图所示
然后按默认,点击next,在下图中确认安装信息无误,点击Install
开始安装
在下图中点击Next
然后点击Done,完成安装,这时如果是按默认勾选了View "Getting Started Guide",则会能下载一份Getting Started Guide文档,帮助你进行下面的设置。
3,运行测试,在终端中输入下面命令
[root@localhost ~]# arm-none-eabi-gcc
bash: arm-none-eabi-gcc: command not found.[root@localhost ~]#
进入安装目录下查看下安装结果,如下图所示
可以看到,在安装程序的目录的bin目录下,有各种可用的命令,现在测试时下是否可用
[root@localhost bin]# ./arm-none-eabi-gcc -v
。。。。。Thread model: single
gcc version 4.5.1 (Sourcery G++ Lite 2010.09-51)可以看到当前的版本号,说明安装成功,但是不能在其它目录下运行。
4,为安装程序的目录的bin目录下命令添加环境变量
在终端执行pwd命令查看下当前路径
[root@localhost bin]# pwd
/usr/local/CodeSourcery/Sourcery_G++_Lite/bin
[root@localhost bin]#然后执行
[root@localhost bin]# vi /etc/profile
在打开的profile配置文件中的# Path manipulation的下面if语句后面加入下面粗体字部分# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
pathmunge /usr/local/arm/4.4.3/bin
pathmunge /usr/local/CodeSourcery/Sourcery_G++_Lite/binfi
然后保存退出。存盘后,重新启动Linux,打开终端,[root@localhost ~]# arm-none-eabi-gcc
arm-none-eabi-gcc: no input files
[root@localhost ~]#
说明环境变量添加成功。5,运行测试安装编译工具后的eclipse
这时你再打开eclipse,按Ctrl+B编译,会出现下图所示"cannot find entry symbol _start; defaulting to 00008000"和"undefined reference to ..."的错误。
出现上述错误的原因在Getting Started Guide (PDF)中讲得很详细,当使用arm-none-eabi-gcc对裸机程序进行编译时,必须通过-T选项指定连接脚本。也就是说,在编译时针对不同的目标板必须有相应的初始化文件与之对应,初始化文件主要做一些复位,中断设置,内存初始化,数据段和代码段空间重定位等操作,所作的工作流程与bootloader很相似。鉴于此,就关掉当前的工程,新建一个u-boot工程。
5,配置并编译smdk2410开发板
在将现有的u-boot工程导入ecipse之前,需要先配置开发板
[root@localhost ~]# cd u-boot-2010.03
[root@localhost u-boot-2010.03]# make distclean //在配置之前先清除所有生成文件+配置文件+编辑备份和补丁文件
Generating include/autoconf.mk
Generating include/autoconf.mk.dep
[root@localhost u-boot-2010.03]#
[root@localhost u-boot-2010.03]# make smdk2410_config
Configuring for smdk2410 board...
[root@localhost u-boot-2010.03]#在Eclipse IDE环境下编译u-boot之前,先在终端中使用命令编译一次一作比较
编译时指定交叉编译器的前缀
[root@localhost u-boot-2010.03]# make CROSS_COMPILE=arm-none-eabi-
..... ...... ......
arm-none-eabi-objcopy -O srec u-boot u-boot.srec
arm-none-eabi-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
[root@localhost u-boot-2010.03]#
可以看到u-boot.bin文件已经生成。
6,清除配置文件,然后再eclipse IDE中编译
[root@localhost u-boot-2010.03]# make distclean
Generating include/autoconf.mk
Generating include/autoconf.mk.dep
[root@localhost u-boot-2010.03]#
[root@localhost u-boot-2010.03]# make smdk2410_config
Configuring for smdk2410 board...
[root@localhost u-boot-2010.03]#
7,新建一个u-boot工程并导入已存在的代码
执行Eclipse->File->New->Makefile Project with Existing Code后,出现下图,点击Browse按钮 定位u-boot所在文件夹,记住选中的是ARM Linux GCC(Sourcery G++ Lite),点Finish然后在eclipse界面中按下Ctrl+B编译,结果如下图
出现错误“ fatal error: common.h: No such file or directory”。