这是一篇完整的文档,我就是按照这篇文档的指导,建立了基于eclipse平台的ARM开发环境。
Installing the Necessary Components
To set up an ARM cross-development environment using Eclipse, you need to download and install several components. The required parts of the Eclipse/ARM cross development system are:
1. SUN Java Runtime
2. Eclipse IDE
3. Eclipse CDT Plug-in for C++/C Development
4. CYGWIN GNU C++/C Compiler and Toolset for Windows
5. GNUARM GNU C++/C Compiler for ARM Targets
6. GNUARM Insight Debugger
7. Philips Flash Programmer for LPC2100 Family CPUs
8. Macraigor OCDremote for JTAG debugging
第一步:JAVA Runtime
The Eclipse IDE was written entirely in JAVA. Therefore, you must have the JAVA runtime installed on your Windows computer to run Eclipse. Most people already have JAVA set up in their Windows system, but just in case you don’t have JAVA installed, here’s how to do it.
The JAVA runtime is available free at
www.sun.com . Click on “Downloads – Java 2 Standard Edition” to continue. Select the “latest and greatest” Java runtime system by clicking on ,Specifically, we need only the Java Runtime Environment (JRE).
图片传不上来,总之这一步就是安装JAVA的运行环境,最好安装JDK,不过仅仅安装JRE也可以。
第二步:Eclipse IDE
The Eclipse IDE is a complete integrated development platform similar to Microsoft’s Visual Studio. Originally developed by IBM, it has been donated to the Open-Source community and is now a massive world-wide Open-Source development project.
Eclipse, by itself, is configured to edit and debug JAVA programs. By installing the CDT plug-ins, you can use Eclipse to edit and debug C/C++ programs (more on that later).
When properly setup, you will have a sophisticated programmer’s editor, compilers and debugger sufficient to design, build and debug ARM applications.
You can download Eclipse for free at the following web site.
www.eclipse.org
The following Eclipse welcome page will display. Expect some differences from my example below since the Eclipse web site is very dynamic.
现在的版本应该是3.2.1。大概80 多M,下载后解压就可以了,不需要执行安装程序。执行Eclipse.exe就可以启动程序。
第三步:Eclipse CDT
这是开发c/c++程序必须要的。
Eclipse, just by itself, is designed to edit and debug JAVA programs. To equip it to handle C and C++ programs, you need to download the CDT (C Development Toolkit) plug-in. The CDT plug-in is simply a collection of files that are inserted into two Eclipse directories.
The CDT plugin selected must be compatible with the Eclipse SDK 3.2.1 release we just installed! To determine this, click on the following CDT link.
http://update.eclipse.org/tools/cdt/releases/new
可以采用Eclipse的update功能进行安装:
You can let Eclipse install the CDT plugins for you. Start Eclipse and click on “Help – Software Updates – Find and Install.”
We can let Eclipse install the CDT plugins for us.
Start up Eclipse and click on “Help – Software Updates – Find and Install … “
Copy this URL to the clipboard
OK, these CDT releases will work with Eclipse 3.2.1
This is the most recent CDT release compatible with Eclipse 3.2.1。
Select the “Search for new features to install” radio button and click “Next” Select the “Search for new features to install” radio button and click “Next”
We need to specify the CDT update site, so click on “New Remote Site.”
If you still have the CDT update URL saved above, paste it into the URL text box below.
http://download.eclipse.org/tools/cdt/releases/new
Enter “CDT” into the Name text box and click OK.
Now check the “CDT” box and click “Next” to continue the CDT installation。
Check the box for “Eclipse C/C++ Development Tools 2.1.1” in the window below and click “Next” to continue the installation.
Accept the license agreement and click “Next.”
Take the defaults on the next screen and click “Finish” to start the CDT installation.
When the CDT download and installation completes, a pop-up window will advise you to restart Eclipse. Answer yes and when Eclipse restarts, it will have the CDT plugins properly installed. Eclipse must be restarted for the CDT plugins to take effect.
Let’s now test if the CDT Plugin installation was successful. If Eclipse is not already running, click on the desktop Eclipse icon to start up the Eclipse IDE (Integrated Development Environment).
Now click on “File – New – Project”. This should display the “new project” window.
If you see C and C++ as possible projects to select, then you know that the CDT has been installed successfully. Exit from Eclipse and we’ll proceed to downloading the Cygwin GNU Toolkit.
第四步:CYGWIN GNU Toolset for Windows
The GNU toolset is an open-source implementation of a universal compiler suite; it provides C, C++, ADA, FORTRAN, JAVA, and Objective C. All these language compilers can be targeted to most of the modern microcomputer platforms (such as the ARM 32-bit RISC microcontrollers) as well as the ubiquitous Intel/Microsoft PC platforms. By the way, GNU stands for “GNU, not Unix”, really – I’m serious!
Unfortunately for all of us that have desktop Intel/Microsoft PC platforms, the GNU toolset was originally developed and implemented with the Linux operating system. To the rescue came Cygwin, a company that created a set of Windows dynamic link libraries that trick the GNU compiler toolset into thinking that it’s running on a Linux platform. If you install the GNU compiler toolset using the Cygwin system, you can literally open up a DOS command window on your screen and type in a DOS command like this:
The above will compile the source file main.c into an object file main.o for the ARM microcontroller architecture. In other words, if you install the Cygwin GNU toolset properly, you can forget that the GNU compiler system is Linux-based.
Normally, the Cygwin installation gives you a compiler toolset whose target architecture is the Windows/Intel PC. It does not include a compiler toolset for the ARM microprocessors, the MIPS microprocessors, and so forth.
It is possible to build a compiler toolset for the ARM processors using the generic Cygwin GNU toolkit. In his book “Embedded System Design on a Shoestring”, Lewin A.R.W. Edwards gives detailed instructions on just how to do that. Fortunately, there are quite a few pre-built tool chains on the internet that simplify the process. One such tool chain is GNUARM which gives you a complete set of ARM compilers, assemblers and linkers. This will be done in the next section of this tutorial.
It’s worth mentioning that the GNUARM tool chain doesn’t include the crucial MAKE utility, it’s in the Cygwin tool kit we’re about to install. This is why you have to add two path specifications to your Windows environment; one for the c:/cygwin/bin folder and one for the c:/programfiles/gnuarm/bin.
The Cygwin site that has the GNU toolset for Windows is:
www.cygwin.com
We need to download the setup executable and automatically run it.
Click on “Run” to download and run the Cygwin setup program.
Now the Cygwin wizard will start up. Select “Next” to continue.
Choose “Install from Internet” and then click “Next.”
Now we specify a directory where all the downloaded components go, our c:/scratch folder will do just fine.
Since I have a high speed internet connection, I always select “Direct Connection.” Click “Next” to continue.
Now the Cygwin Installer presents you with a list of mirror sites that can deliver the Cygwin GNU Toolkit. It’s a bit of a mystery which one to choose; I picked
http://planetmirror.com because it sounds cool. You may have to experiment to find one that downloads the fastest. Click “Next” to continue.
Cygwin will download a few bits for a couple of seconds and then display this “Select Packages” list allowing you to tailor exactly what is included in the down load.
If you look at the Cygwin “Select Packages”,You must click on the little circle with the two arrowheads until the line changes ,The following four packages must be selected and changed from “default” to “install.”
Archive Default Archive Install
Devel Default Devel Install
Libs Default Libs Install
Web Default Web Install
Click on the little circle with the arrowheads until you change the four packages listed above from “default” to “install.”
You should see the screen displayed directly below. Note that the Archive, Devel, Libs and Web components are selected for “Install”. Everything else is left as “default.”
Click “Next’ to start the download.
Now the Cygwin will start downloading. This creates a huge 700 Megabyte directory on your hard drive and takes 30 minutes to download and install using a cable modem.
When the installation completes, Cygwin will ask you if you want any desktop icons and start menu entries set up. Say “No” to both. These icons allow you to bring up the BASH shell emulator (like the command prompt window in Windows XP). This would allow you do some Linux operations, but this capability is not necessary for our purposes here. Click on “Finish” to complete the installation.
The directory c:\cygwin\bin must be added to the Windows XP path environment variable. This allows Eclipse to easily find the Make utility, etc.