This tutorial series will describe how to build a free Eclipse based ARM GCC toolchain which uses a GDB client Eclipse plugin to communicate with the OpenOCD GDB server for debugging. In this tutorial you will build a blinking light program that will run on an STM32F4 development board made by Olimex.
Links and Credits
In working through this tutorial, I used a few other tutorials as examples to help me get things up and going. Though most of the steps in the example tutorials were very similar to what I’ve described in the following parts, I made a few slight variations. When I follow tutorials, I like to vary at least a little bit. This usually helps me learn, and requires me to pay a little more attention as I follow along.
Below is a list of links to tutorials that I followed while building up my tool chain:
One of the most useful tutorials that I followed was the one from Matthew Mucker at thehackerworkshop.com. This is a really thorough tutorial. I especially like how he shows the steps he took to troubleshoot when compiling and debugging as he builds the toolchain. Here is part one of the tutorial, and here is part 5 which I included because it has an index to the other sections of the tutorial.
Another tutorial I really like is the one written by Dr. Hussam Al-Hertani at hertaville.com. This tutorial is also very detailed. I especially like it because he uses make files for compiling. I’ve used both make files and the ARM GCC Eclipse plugin, but I think there is just as much to learn to maintain the ARM GCC Eclipse plug in as there is to maintain already written makefiles, and I prefer the nearly unlimited power and flexibility of building with makefiles.
This tutorial by Erich Styger was posted later on, but It was still very helpful to me in cleaning up some of the issues that were still left to be resolved. Erich very regularly posts great articles on Freescale ARM microcontrollers in Eclipse. I got lost reading his site while going to get the link to his tutorial.
Also, the end results of my tutorial should be similar to the results of following Jim Lynch’s tutorial. I’ve only skimmed through his tutorial, but I thought it may be useful to some.
This tutorial is based on the STM32-E407 development board made by Olimex. I chose this board because it is based on a very feature rich microcontroller, and includes connectors for many of the peripherals including USB, Ethernet, and a micro SD card. For what you get, I feel that the board is reasonably priced. Also, one of the things I like most is that it has a common 20 pin JTAG connector. Many of the cheap development boards these days come with an on board debugger. I may be the only one, but I don’t really like this, I prefer that the JTAG be a generic one that can be used on any development board, or electronic device that I choose to connect it to, and I want the development board to not have the extra bulk of having the debugger circuitry included.
For this tutorial, I will be using the ARM-USB-TINY-H. There are many reasons to like this debugger. First of all, at around $55 USD, it is very reasonably priced. Also, it is compatible with many different processors, from across many different vendors. In contrast to the debuggers built in to many development boards, I like the idea that once I’ve set up the tool chain, and my computer to use a particular debugger, that debugger will work with pretty much any ARM device I choose to work with in the future.
Where I bought the hardware from
I also thought this 20 to 10 pin JTAG adapter could be useful if you are using a different development board: ARM-JTAG-20-10