Last modified 2017-09-25 00:25:11 CDT

Setting up the ARM-GCC Toolchain on Windows

This is a basically a condensed portion (specifically on setting up the basic ARM-GCC toolchain) of James P. Lynch’s “ARM Cross Development with Eclipse Tutorial”. The tutorial is superb, and helped me greatly, but I also decided to post the simplified insturctions in text. These are the abridged instructions to install the ARM-GCC toolchain in a GNU environment on Windows, minus the memory killing eclipse. This does not include information on how to setup and operate OCDRemote with GDB- later I might make a short guide on that (once I choose a decent IDE to do my ARM coding in).

What you need to setup a working ARM-GCC Toolchain on Windows:

Step 1 - Install Cygwin

Cygwin is a bunch of core GNU apps crosscompiled for Windows. The heart of cygwin is the cygwin1.dll, which emulates the Linux API on Windows. Through Cygwin many GNU apps can be recompiled and ran on Windows, such as GCC and therefore the ARM-GCC toolchain. The Cygwin setup is intelligently designed, or so I think. You download the installer, which you should keep on your computer. In setup.exe, you choose a mirror, the precompiled GNU apps you want and the location of your cygwin directory. It will download these packages off of the internet and install them. If you ever want to remove or install more packages, simply rerun setup.exe, and if you haven’t deleted those temp files, it will see the already installed cygwin, and take you to removing packages or adding additional ones. I’m not sure exactly which packages are required for the GNU-ARM toolchain, but you can just install the general categories if disc space isn’t a problem for you. The general categories recommended by the ARM Cross Development with Eclipse Tutorial are: Archive, Devel, Libs, and Web. So. click on the little circle thing next to each one until they all read “Install”. Specifically, you’ll want to make sure you have the “make” package so you can build source from Makefiles. Then finish the installiation (this might take some time depending on your internet connection and the mirror you chose).

Step 2 - Install ARM-GCC Toolchain

GNU ARM, a group obviously dedicated to developing GNU tools for ARM architectures, conveniently releases binary distributions of the ARM-GCC toolchain for Cygwin, Linux, and Mac OS X (Linux users: this is probably the only thing you need). So, visit the website, go to their files section, scroll down to the Binaries section, and download the latest version of the GCC-4.0 Toolchain for Cygwin. Go through the setup and make sure you have a “Full installiation”. However, disable the “Install Cygwin DLLs” checkbox. This is very important, as installing their version of the Cygwin DLLs apparently will mess things up (according to the ARM Cross Development with Eclipse Tutorial).

Step 3 - Setup the Windows Path

Now that you have the ARM-GCC toolchain installed in a Cygwin environment, you can make these programs globally accessible so you can use them with your own IDE (if you want). To do this, we must edit the Windows Path variable, which you can access by: Right-click on “My Computer”, click “Properties”. Click the “Advanced” tab. Click the “Environment Variables” button. Select “Path” out of the “System Variables”, and click the “Edit” button. Now make sure your path includes the following:

C:\cygwin\bin;C:\cygwin\usr\local\bin;C:\program files\gnuarm\bin;

The first two are obviously for the Cygwin apps, the last is for the ARM-GCC toolchain.

Step 4 - Test Compile a Demo Project

Now that you have everything setup, the next step is to test it out. The sample code I am giving a link to is for LPC2106 and LPC2148 microcontrollers only, but regardless of the microcontroller you’re using, if this code compiles, your ARM-GCC toolchain should be ok. Go ahead and download Lynch’s sample code here: http://www.olimex.com/dev/soft/arm/LPC/sourcecode.zip. Extract the directories somewhere, and in a Windows command prompt, change to the same directory, and then type “make”. If everything worked out well, you should have a main.hex file in the end. If not, then, uh, email me or something. (End of Lynch’s guide has a troubleshooting section you might want to check).

Step 5 - Install Flashing Software

The final step is to download the software to Flash your chip through the serial port. For Phillips LPC21xx series, you can find that software here. For the Atmel AT91SAM series, check the Atmel website. For the newer LPC21xx chips, I am a fan of Flash Magic: http://www.flashmagictool.com/.


Flashing ARM7 Microcontrollers with OpenOCD

See http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html for detailed instructions on flashing LPC2000 and AT91SAM7S series ARM microcontrollers with OpenOCD through the JTAG interface.

Creative Commons License