Download ARM_Cross Development_with_Eclipse

Transcript
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