GNUARM for ARM microcontrollers
In this article you’ll find some information about how to configure GNUARM toolset for compiling ARM7 microcontrollers.
GNUARM is the open source toolset for ARM7 MCUs. It has GCC compiller and debugger. Our purpose now is to set up tools in Windows environment and compile one project.
First of all download compiled toolset from http://www.gnuarm.com:

Select the newest [GCC-4.0 toolchain] located bellow Cygwin.
After it is downloaded, start the installation:

1. Start window

2. Accept license agreement.

3. Select folder where do you want GNUARM to be installed:

4. Select the components. You can select all of them.

5. Chose Start menu folder name – just leave as it is.

6. Select desktop shortcut to be placed. I higly recoment to check Cygwin DLL, because despite I had cygwin installed, but I had to copy DLLs to copy manually. If this option ischecked, DLL files will be copied without bothering you.

7. And press install..

8. Select checkbox in order to create system variable: PATH=c:\gnuarm\bin
After we have GNUARM installed, download binutils from http://optimize.ath.cx/ARM7/src/utils.zip. Download this archive and unpack all contents to c:\gnuarm\bin folder. Also download http://optimize.ath.cx/ARM7/src/cygncurses-8.dll and put it in c:\gnuarm\bin folder. Now we are set to start compillation.
Lets try test compillation. Jus download project from http://optimize.ath.cx/ARM7/src/lpc2214_blink.zip and extract in any folder. Here you’ll find few files:
| lpc2214.h | LPC2214 header. You can also download from www.gnuarm.com page where support files are. |
| blink.c | LED blink example program. |
| boot.s | The startup routine which first is executed after the resetting CPU. From among these C main function is called. |
| makfile | makefile |
| lpc2214-rom.ld | The load script file which linker usesThe start address size and the like of ROM/RAM is described. Necessity to ROM conversion binary is drawn up. |
| setenv.cmd | Configuration file, where you have to show path to C:\GNUARM\bin and bin C:\GNUARM\bin\utils |
| jtag_flash.exe | The tool, which writes the flash by way of jtagWriting the hex file, which it appoints, it executes.When ‘N’ is appointed in 2nd parameter, after the writing in, it does not execute. |
| jtag_stub.exe | The JTAG debugger for GDB/Insight. |
Because setenv.cmd is used to show path to C: when GCC is installed in different location, you have to edit it. If you left default settings, then don’t edit this file.
Lets try to compile this program. Start DOS console window:
Lets create hex file. I leave make file not edited. So I will have to use commands: make and once again make.hex. That’s it hex is done.
Here is a table with most common make commands:
| Command | Target (function) |
| Make | Compiling & linking and forming the elf file |
| Make clean | The formation file (o lst elf hex bin) it deletes |
| Make hex | Hex (forming the hexa-) file |
| Make bin | Bin (binary) forming the file |
| Make lst | Listing (assembling) formation of file |
| Make run | Compiling & linking and it writes in to the flash, starts the program |
| Make debug | Compiling & linking and it writes in to the flash, starts Insight/GDB. Because it does not start the program automatically, you indicate with the debugger |
If you have programmer adapter, you can flash you ARM7 microcontroller with only one command – make run.
Good luck
Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post | TrackBack URI for this post
New on WinAVR Tutorial
Running TX433 and RX433 RF modules with AVR microcontrollers,Sometimes in embedded design you may want to go wireless. Might be you will want to log various readi …Programming AVR ADC module with WinAVR,Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solut … |
New on WinARM Tutorial
What are differences between WinARM and WinAVR,Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR (http://win …LPC2000 watchdog timer,As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount … |

July 3rd, 2006 at 6:43 am
You don’t say anything about requiring Cygwin to be installed already.
July 3rd, 2006 at 7:52 am
You don’t need Cygwin to be installed. GnuARM installer has option to add necessary dll’s. And if you have Cygwin installed I recommend to leave this option selected.
July 19th, 2006 at 3:35 am
Thanks for the directions, which I followed. It wouldn’t make properly so the first thing I had to do was add the path “c:\GNUARM\arm-elf\bin” to the setenv.cmd file so ld, as, etc. could be located. Once that was done I couldn’t get past the “ld: cannot find -lgcc” error. I suspect other environment variables must also be manually set, or files moved, or who knows! It’s probably just me, but everytime I try to set up anything based on GNU in Windows its a battle I usually give up on. It seems that GNU is for real men, not wimps like me!
April 22nd, 2007 at 12:26 pm
[...] toolchain for Linux user. For Windows user, there have the installer executable EXE files already. http://www.scienceprog.com has a turial on seting up this tool on Windows [...]
November 2nd, 2007 at 7:39 am
Nice link for setting up arm toolchain in windows environment. :):)
Karthik Balaguru
May 29th, 2009 at 1:07 am
[...] only for Linux users. For Windows users, there have the installer executable EXE files already. http://www.scienceprog.com has a tutorial on setting up this tool on Windows [...]