Файл: ARM cross development with Eclipse, version 2 (J.P. Lynch, 2005).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 12.06.2025
Просмотров: 681
Скачиваний: 1
When the mirror site starts the download process, you have to select a destination directory to place the Eclipse zip file. In my case, I created an empty C:/scratch directory on one of my hard drives (you could use any other drive as well).
First click on Save below.
Now browse to the c:/scratch directory that you created previously.
Click on Save to start the download.
Now the download will start. Eclipse is delivered as a ZIP file. It’s 103 megabytes in length and takes 9 minutes to download with my broadband cable modem. If you have a dialup internet connection, this will be excruciating. If you don’t have a cable modem high-speed internet connection, I suggest you find somebody who does and go over there with a blank CDROM and a gift.
When the Eclipse download completes, you should see the following zip file in your scratch directory.
Eclipse is delivered as a ZIP file (eclipse-SDK-3.1-win32.zip). You can use WinZip to decompress this file and load its constituent parts on your hard drive.
If you don’t have WinZip, you can get a free evaluation version from this address:
http://www.winzip.com/
There’s a decent Help file supplied by WinZip. Therefore, we’re going to assume that the reader is able to use a tool such as WinZip to extract from zip files.
In my computer, with WinZip installed, double-clicking on the zip file name (eclipse- SDK-3.1-win32.zip) in the Windows Explorer display above will automatically start up WinZip. Click on “Extract” to start the Eclipse file decompression.
WinZip will ask you into what directory you wish to extract the contents of the zip file. In this case, you must specify the root drive C:
The WinZip Utility will start extracting all the Eclipse files and directories into a c:/eclipse directory on your root drive C:
At this point, Eclipse is already installed (some things are done when you run it for the first time). The beauty of Eclipse is that there are no entries made into the Windows registry, Eclipse is just an ordinary executable file. Here’s what the Eclipse directory looks like.
You can create a desktop icon for conveniently starting Eclipse by right-clicking on the Eclipse application above and sending it to the desk top.
Right-click on the Eclipse application and send it to the desk top.
Now is a good time to test that Eclipse will actually run. Click on the desktop icon to start the Eclipse IDE.
If the Eclipse Splash Screen appears, we have succeeded. If not, chances are that the Java Run Time Environment is not in place. Review and repeat the instructions on installing Java on your computer.
The first order of business is to specify the location of the Workspace. I choose to place the workspace within the Eclipse directory. You are free to place this anywhere; you can have multiple workspaces; here is where you make that choice.
When you click OK, the Eclipse main screen will start up.
If you made it this far, you now have a complete Eclipse system capable of developing JAVA programs for the PC. There are a large number of JAVA books and some really good ones showing how to develop Windows applications with JAVA using the Eclipse toolkit.
Eclipse itself was written entirely in JAVA and this shows you just how sophisticated a program can be developed with the Eclipse JAVA IDE.
However, the point of this tutorial is to show how the Eclipse platform with the CDT plug-ins can be used to develop embedded software in C language for the ARM microcomputers.
5 Eclipse CDT
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 zip files that are unzipped into the
Eclipse directory.
Unfortunately, the CDT plug-in from the Eclipse web site has some problems debugging applications in a cross-development environment (e.g. where the target is a circuit board with an ARM microprocessor and a JTAG interface). To the rescue is the Norwegian engineering company Zylin who have developed a special custom version of CDT that properly interfaces the GDB debugger to a remote target. The Zylin version of CDT was developed with the cooperation of the CDT Development Team and is essentially a copy of the latest version of
CDT with the special debug modifications. The open source community owes a debt of thanks to Øyvind Harboe and his associates at Zylin.
To download the Zylin version of the CDT plug-in, click on the following link:
http://www.zylin.com/embeddedcdt.html
The Zylin website page devoted to the CDT plug-in will have a link to the latest “snapshot”. This snapshot is two zip files that you will extract to the c:\eclipse folder.
Click on this link to get the
latest Zylin CDT snapshot.
Download the following two files from the Zylin web site.
http://www.zylin.com/embeddedcdt-20050810.zip
http://www.zylin.com/zylincdt-20050810.zip
Download these two files to c:/scratch
First, click on http://www.zylin.com/embeddedcdt-20050810.zip to download. Then click on “Save” in the File Download window.
Select the temporary c:\scratch directory as the target of the download and click “Open.”
The first Zylin CDT zip file will download into the c:\scratch folder. This file is an 11 Mb download.
Next, click on http://www.zylin.com/zylincdt-20050810.zip to download. Then click on “Save” in the File Download window.
Select the temporary c:\scratch directory as the target of the download.
The second Zylin CDT zip file will download into the c:\scratch folder. This file is a shorter file, only 173 Kb.
Select both Zylin CDT files in the c:\scratch folder using Windows Explorer and use WinZip to extract them to the c:\eclipse folder.
To verify that Eclipse had the CDT installed properly, start Eclipse by clicking on the desktop icon.
When Eclipse starts, click on “File – New - Project…”
When the New Project window appears, check if C and C++ appear as potential projects. If this is true, Eclipse CDT has been installed properly.
6 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:
>arm-elf-gcc –g –c main.c
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
The Cygwin web site opens as follows:
The first thing to do is to click on the install icon:
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.
The screen above allows you to specify what GNU packages you wish to install.
Basically, we want an installation that will allow us to compile for the Windows XP / Intel platform. This will allow us to use Eclipse to build Windows applications (not covered in this document). Remember that we’ll be installing the GNUARM suite of compilers, linkers etc. for the ARM processor family shortly.
If you look at the Cygwin “Select Packages” screen below, you’ll see the following line.
You must click on the little circle with the two arrowheads until the line changes to this:
This will force installation of the default GNU compiler suite for Windows/Intel targets. Here’s the “Select Packages” screen before clicking on the circle with arrowheads. 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.