Configuring Eclipse with GCC toolchain for ARM Cortex-M based Microcontrollers
Keywords: Embedded systems, Eclipse, Toolchain, GNU, make, GCC, ARM Cortex-M
In this tutorial we will demonstrate how to configure Opensource tools i.e. eclipse, GCC, and OpenOCD to compile and download code to ARM Cortex-M family of processors. Before we can move forward, here is a million dollars question? Why would somebody go through all these multip step procedure to configure an Opensource IDE for writing and compiling code for ARM MCU when there are bunch of free (or at least free with certain limits) IDEs out there?
Well the answer is simple… Portability. Most of the vendors supplied toolchains/Compilers available in market are configured and tightly coupled with an IDE that only run on specific Operating System. Well to be really honest, most of them are available for Windows only and porting support to other Operating Systems may or may not be provided by the vendors especially in case of Free/Evaluation versions and may charge extra money from client.
In such scenarios where you are not comfortable with OS that the MCU toolchain/IDE supports, you can either need to get use to the target OS or you may need to purchase a paid version of the Toolchain for the OS you are comfortable with OR you may follow this tutorial approach to configure your own MCU coding environment with absolutely 0 cost.
Note: As tools used for this tutorial are free of charge they do come with a cost… You may not get full support if you are stuck somewhere. Though these tools community is quite mature still the expectations may be kept lower. Second, paid IDEs comes with hell lot of other features other than just compiling the code, downloading, debugging etc. The free tools do come with limited support and features.
TIP: If you are planning to proceed with a long term project where your team may need long term support, it is highly recommended to go for a paid version of professional toolchains. They usually go that extra mile of adding extra features and provide long term support. This can save your team time to focus on project only rather than maintain the toolchain as well.
I think that was enough introduction, let’s get back to the tutorial. Following are the Opensource tools used in this tutorial.
- Eclipse with plug-ins: For providing front end to facilitate coding and debugging.
- GNU ARM Toolchain: The GNU C/C++ compiler/debugger binaries compiled for ARM Cores.
- OpenOCD: The middle wear that provide link between the eclipse front end, debugger and the physical MCU onchip debugger for downloading and debugging the code.
Let’s get started. First of all let’s create a separate directory for development. For this tutorial we will use E:\Development
(Windows OS) and will be simply refered Development
as directory.
1. Installing GNU Toolchain for ARM
In the previous tutorial we cross-complied GNU GCC Toolchain for ARM Cortex-M based processor. Though it was tedious job yet it indeed was a fun. Don’t worry this tutorial is not dependent on that cross-compiling tutorial. We mentioned in the previous tutorial that the better option is to grab the pre-compiled GNU GCC binaries from one of the given vendors as they are doing great job of keeping the toolchain maintained and up to date. For this tutorial we will use the GNU GCC binaries for bare-metal programming provided by the ARM developers. The Link is given bellow.
The above link contains links to GNU binaries for various OS. Choose one for your target OS. For this tutorial we are using windows OS so we will download binaries for Windows OS. The toolchain are named similar to gcc-arm-none-eabi-7-2018-q2-update-win32-sha1.exe
.
To install the toolchain simply double click the downloaded gcc-arm-none-eabi-7-2018-q2-update-win32-sha1.exe
binaries and follow the instructions. The installation is straight forward. We will install toolchain in E:\Development\GNU Tools Arm Embedded
– Figure-1.

Wait for the installation to complete – Figure-2.

Click Finish to complete installation – Figure-3. Congratulation you have successfully installed GCC ARM toolchain.

To verify installation, run the following command in the installation directory and the screen should look similar to – Figure-4.
gcc-none-eabi-gcc -v

2. OpenOCD Installation
In the previous step we installed and verified the GNU ARM toolchain which will be used to compile our C code for ARM Cortex-M Processors. The Toolchain can build the binaries for the target SoC but we also need some mechanism to download/program/burn flash these binaries to the target SoC. OpenOCD is an open-source middle-ware that provide interface between the target SoC (via JTAG, SWD, ICDI, etc. etc.) and the Host PC. OpenOCD is used to burn the target SoC flash and debug it on run-time. We have a dedicated tutorial for OpenOCD which explains OpenOCD in more detail. For now its enough to remember that it is used for programming and debugging purpose. Let’s install OpenOCD.
The OpenOCD Installation is straight forward. Being open-source, the source can be grabbed from Github and compiled as required but we will not go into that complicated process. There are pre-compiled distribution provided for various OS that can be downloaded and used straight from the box. The link to pre-compiled binaries are given bellow.
Download the binaries as per your OS. For Windows-64bit (the OS i am on) we will download gnu-mcu-eclipse-openocd-0.10.0-8-20180512-1921-win64.zip
. To install it, simply unzip the binaries in the Development
directory in our case its E:\Development
.
The target bin
directory will look similar to the Figure-5.

Configuration, you have successfully installed OpenOCD. We will refer to it back after installing eclipse and other plug-ins.
3. Windows build tools Installation (Only for Windows OS Users)
This step is only for window users. The reason behind this tool is that the eclipse plug-ins we will install later uses few UNIX commands e.g. rm, mkdir, sh, etc. during build process. These commands are not a part of Windows OS. The Windows build tools provides emulated versions of these UNIX commands on Windows.
To install Windows build tools, download the latest verion from the following link. In our case (Windows-64bit), we will download gnu-mcu-eclipse-build-tools-2.11-20180428-1604-win64.zip
.
Once the download, extract it in the Development
directory in our case its E:\Development
– Figure-6.

4. Eclipse and plug-ins Installation
Eclipse is an open-source cross platform very flexible IDE available/easily configurable for various languages including Java, C/C++, Python, PHP etc. etc. and is widely used for development. In this tutorial we will configure it for cross-compiling code for ARM Cortex-M Processors.
Eclipse itself is just an Integrated Development Environment (IDE). In order to configure it for specific language and extend its features, plug-ins are used. These plug-ins are mostly developed by Eclipse community members and can be accessed from Eclipse Marketplace
in Help
menu.
Eclipse comes in different flavors/versions named very beautifully by Eclipse developers e.g. Kepler, Luna, Mars, Neon, Oxygen, Photon. For this tutorial we will use Oxygen but Neon can be used instead.
Why Oxygen or Neon only?
These Eclipse versions are chosen because the plug-ins we are going to install for Cortex-M development are well tested with Oxygen and Neon ONLY. With other versions, the plug-ins may not work correctly as per plug-ins documentation.
Following are the steps to download, install, and configure eclipse.
4.1. The first step is to download Eclipse IDE. As mentioned earlier, eclipse comes in various flavors pre-configured for various languages. For this tutorial we will chose “Oxygen – Eclipse IDE for C/C++ Developers” for Windows 64-bits version – Figure-7.
The Download links are given bellow. The first one is from Eclipse official website while the second one is Github link provided by GNU ARM plug-ins (that we will install later) developer. The second link is more preferable as other Eclipse compatible versions with plug-ins apart from Oxygen are also given.

4.2. A compressed zip file will be downloaded, the simple way to install it is just to extract it in the Development
directory. In our case its E:\Development
.
Note: Eclipse requires Oracle Java Runtime Environment. If it is not installed on your computer; you may download it from the Oracle link given bellow. Make sure you choose the right version for your OS and System (32bits, 64bits).
4.3. Create a new directory named Workspace
in Development
directory in our case its E:\Development
.
4.4. Go to the eclipse installation direction (E:\Development\eclipse
) and open double click eclipse.exe
to start eclipse. After a very nice splash-screen a prompt window will open asking for Workspace. In the Workspace field enter the path of Workspace folder created in step-4.3 and check the checkbox – Figure-8.

Once Workspace is configured, Eclipse IDE main Welcome window will open.
5. Eclipse Plug-ins Installation
Now that you have successfully installed eclipse, its time to configure it for ARM Cortex-M firmware development via special plug-ins. Plug-ins are required as eclipse itself is an open-source general purpose IDE whose functionalities can be extended for specific development via plug-ins provided by eclipse developers or some third party developers. Let’s get started.
5.1. From menu bar click on Help --> Install New Software
Figure-9.

5.2. Click Add
. In the Name field enter GNU MCU Eclipse Plug-ins
, in the Location field enter http://gnu-mcu-eclipse.netlify.com/v4-neon-updates/
. Click Ok
– Figure-10.

5.3. Wait a while for the eclipse to grab the plug-in contents. Once the contents are grabbed, check the check-boxes for the following plug-ins in the list. Click Next
.
- GNU MCU C/C++ ARM Cross Compiler
- GNU MCU C/C++ Freescale Project Templates
- GNU MCU C/C++ Generic Cortex-M Project Template
- GNU MCU C/C++ J-Link Debugging
- GNU MCU C/C++ OpenOCD Debugging
- GNU MCU C/C++ Packs (Experimental)
- GNU MCU C/C++ STM32Fx Project Templates

Click Next
, accept License agreement and click Finish
.

Wait for the installation to complete and on completion restart Eclipse.
Note: If you get a warning during installation like the one shown in Figure-13, just ignore it and click Install Anyway
! Eclipse usually shows this warning when the plug-ins are provided by third party.

6. The Final Touch
So far we have successfully installed everything we need. The final step is to configure them. This is relatively the simplest step.
Clink on Windows → Preferences → MCU → Global ARM Toolchains Paths – Figure-14. Enter the path of bin folder inside GNU ARM Toolchain installation directory that we installed in Step-1. In our case the path is E:\Development\GNU Tools Arm Embedded\bin
.

Now click on Global Build Tools Path and enter the path of bin directory inside the Windows build tools we installed in step-3 – Figure-15. This step is for Windows Users only.

An Finally last but not the least Click on GNU OpenOCD Path and enter the path of bin directory inside the openOCD installation directory that we installed in Step-2 – Figure-16.

Configuration we have successfully configured Eclipse, GCC, and OpenOCD for programming ARM Cortex-M Microcontrollers. In the next step we will demonstrate how to create project for ARM Cortex-M based Microcontrollers.
Note: There are few Debug configuration steps which are both Project and SoC dependent. These are covered in the next tutorial.
References:
[1] – Mastering Embedded Linux Programming by Chris Simmonds
[2] – LLVM Project
[2] – GCC ARM Options
Hmm it seems like your website ate my first comment (it was super long) so I guess
I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
I as well am an aspiring blog writer but I’m still new to the
whole thing. Do you have any recommendations for rookie blog writers?
I’d genuinely appreciate it.
Hello, Neat post. There’s a problem along with your website in internet explorer, might check
this? IE still is the market chief and a large element of
people will omit your excellent writing due to this
problem.
Hey exceptional blog! Does running a blog similar to this
require a large amount of work? I have no expertise in programming however
I had been hoping to start my own blog in the near future.
Anyways, if you have any ideas or techniques for new blog owners please share.
I know this is off subject but I just had to ask. Kudos!
It’s enormous that you are getting thoughts from this paragraph as well as from our
discussion made here.
Having read this I thought it was rather enlightening. I appreciate
you taking the time and energy to put this article together.
I once again find myself personally spending a lot of time
both reading and commenting. But so what, it was still worthwhile!
wonderful issues altogether, you just gained a new reader.
What could you recommend in regards to your publish that you simply
made a few days in the past? Any certain?
Hi there just wanted to give you a brief heads up and
let you know a few of the images aren’t loading correctly.
I’m not sure why but I think its a linking issue.
I’ve tried it in two different web browsers and both show the same outcome.
You ought to take part in a contest for one of
the highest quality sites on the web. I most certainly will highly recommend this web site!
Hello, its nice post on the topic of media print, we all be aware of media is a great source of information. asmr https://app.gumroad.com/asmr2021/p/best-asmr-online asmr
Very great post. I simply stumbled upon your blog and wanted to mention that I’ve really enjoyed browsing your weblog posts.
After all I’ll be subscribing in your feed and I’m hoping you write once more very soon! cheap flights
http://1704milesapart.tumblr.com/ cheap flights
Hello! I know this is kinda off topic but I’d figured I’d ask.
Would you be interested in trading links or maybe guest writing a blog post or vice-versa?
My website covers a lot of the same subjects as yours and I feel we could greatly benefit from each other.
If you are interested feel free to shoot me an e-mail.
I look forward to hearing from you! Terrific blog by the way!
quest bars http://bit.ly/3C2tkMR quest bars
Very great post. I just stumbled upon your blog and wanted to mention that I have
really enjoyed browsing your weblog posts.
In any case I will be subscribing for your feed and I am hoping you write again soon! quest bars https://www.iherb.com/search?kw=quest%20bars quest bars
Hey There. I found your blog using msn. This is a really well written article.
I’ll make sure to bookmark it and come back to read more of your
useful info. Thanks for the post. I will definitely return. scoliosis
surgery https://0401mm.tumblr.com/ scoliosis surgery
Good day! I know this is kinda off topic but I was wondering
if you knew where I could get a captcha plugin for my comment
form? I’m using the same blog platform as yours and I’m having trouble finding one?
Thanks a lot! scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery
I pay a quick visit day-to-day some websites and websites to read content, however this web site
gives quality based articles. ps4 games https://bit.ly/3z5HwTp ps4
Pay day loan is the quickest way of getting crisis cash within a day.
And it’s easy to use for. Here’s what do for a payday loan application.
Take a look at my web blog; Personal loan
each time i used to read smaller content which as well clear their motive, and that is also happening with this article which I am reading now.
Really appreciate you sharing this post.Really looking forward to read more. Fantastic.
SMS Onay hizmeti genellikle şirketlerin yaptıkları kampanyalarda tercih edilen bir hizmet türüdür. Şirketler mevcut kampanyalarından herkesin bir defa yararlanmasını istedikleri için bir telefondan sadece bir kez onaya müsade etmektedir. Diğer yandan, kampanyalardan çok daha fazla sayıda yararlanmak için smsgetir sms onay hizmetini alabilirsiniz. Sitemizden hizmet almanız için üye olmanız yeterlidir. Web sitemizden SMSGetir için verdiğimiz tüm numaralar sanal olmakla birlikte herhangi bir fiziki sim kartı hizmeti vermemekteyiz.
naturel soğuk sıkım sızma zeytinyağı
günümüzde ceza hukukunda önemli mesleki tecrübeye dayalı
Hi, i believe that i noticed you visited my blog
thus i came to return the want?.I’m trying to to find issues to enhance my
site!I suppose its good enough to make use of some of your concepts!!
I believe what you said was very reasonable. But, what about this?
suppose you wrote a catchier title? I am not saying your information isn’t solid., but suppose you added something that makes people desire more?
I mean Configuring Eclipse with GCC toolchain for ARM Cortex-M based Microcontrollers –
EcoderLenz is kinda vanilla. You could glance at Yahoo’s front
page and note how they create article titles to get viewers to
open the links. You might try adding a video or a pic or two to get people interested about everything’ve written. In my opinion,
it would bring your blog a little livelier.