It has been a while since I published my ‘build my own DIY IDE’ (see “DIY Free Toolchain for Kinetis: Part 1 – GNU ARM Build Tools“). I have used that approaches in my classes successfully. Now a new semester is coming up, so time to update the instructions using the latest Eclipse IDE (Mars) and tools (GCC ARM Embedded (launchpad) with GNU ARM Eclipse).
UPDATE: after writing that post, a few things have been changed. See http://aaes.us/eclipse.html for a list of steps and additional hints/information.
The goal is to build a custom Eclipse IDE and toolchain which can be used to create/build/debug ARM Cortex M based devices. Compared to vendor provided tools like Freescale’s Kinetis Design Studio or NXP’s LPCXpresso it requires to download and install several packages. It only takes about 30 minutes to get it done, but at the end I have something which can be used as IDE for multiple vendors.
For the ones of you using the Freescale Kinetis Design Studio (KDS v3.0.0), it gives the following advantages:
- 64bit IDE. KDS uses 32bit Eclipse, I can use the 64bit Eclipse version which has better performance.
- Eclipse Mars (4.5) with new features. KDS v3.0.0 uses Luna (4.4).
- Eclipse CDT 8.7 with new multicore features. KDS v3.0.0 uses CDT 8.6
- GNU ARM Eclipse with better tool integration: I can use the latest GNU ARM Eclipse plugins (see this discussion).
I’m going to build my toolchain with the following parts:
- IDE: Eclipse IDE and C/C++ CDT tools from http://www.eclipse.org
- GNU ARM Plugins: GNU ARM Eclipse plugins from https://sourceforge.net/projects/gnuarmeclipse/
- Build tools: GCC ARM Embedded (launchpad) from https://launchpad.net/gcc-arm-embedded and
- Debugging: Segger J-Link and/or P&E Multilink
- Freescale only: Freescale New Project Wizard, Processor Expert and Kinetis SDK.
1. Eclipse IDE
Go to http://www.eclipse.org and download ‘Eclipse IDE for C/C++ Developers’ for your operating system. At the time of this article, the latest release is ‘Mars’
Download the archive and extract it. E.g. on Windows you could put the files into a folder like
💡 For Windows there are 32bit and 64bit versions. Initially I had issues to start the 64bit version my my 64bit Windows 7 because of the Java version installed by IT on my machine. The 32bit version worked fine. After IT updated the Java on my machine, the 64bit version was working properly too.
Then launch the eclipse executable (e.g. in c:\tools\IDE\eclipse) inside the eclipse folder.
With this, we have the most of the IDE and for C/C++ development. What is missing in the default download is the ability to use GDB for debugging. To use Eclipse for GDB debugging, I have to install that support from this update site
I use the menu Help > Install New Software and point to that site. From there, I select ‘C/C++ GDB Hardware Debugging’ and install it:
💡 For all Eclipse updates, I recommend to disable ‘Contact all update sites during install to find required software”, see “Workaround for “Installing Software has encountered a problem” in Eclipse“.
💡 If you want to download the CDT package for offline installation or to store it for later re-installation, you can download it from here: https://www.eclipse.org/cdt/downloads.php
2. GNU ARM Eclipse Plugins
In order to use a toolchain and the debugger with nice settings panels, I need to install more plugins. The best plugins to my knowledge for GNU ARM development are the ‘GNU ARM Eclipse’ open source plugins by Liviu.
In Eclipse use the menu Help > Install New Software and point to the following update site:
and install the plugins from there.
💡 If you want to download the plugins for off-line installation or later re-installation, you can download them from here: https://sourceforge.net/projects/gnuarmeclipse
3. GCC ARM Embedded Tool Chain
Go to https://launchpad.net/gcc-arm-embedded and download the toolchain (at the time of this writing it is 4.9-2015-q2). If you download the archive/zip, you simply can unpack the files somewhere, e.g. inside your IDE (c:\tools\IDE) folder.
💡 At this time, ARM/launchpad only offers 32bit binaries of the GNU tools for Windows.
Otherwise run the setup which installs the tool chain on Windows (32bit path below) in
C:\Program Files (x86)\GNU Tools ARM Embedded\4.9 2015q2
Now we compiler/assembler/linker and libraries, but we need other tools like make. I get them from here: https://sourceforge.net/projects/gnuarmeclipse/files/Build%20Tools/ and run the setup. You can use the default path:
💡 There are 32bit and 64bit installers/files for Windows. My screenshots below show the 32bit version, as I missed the fact that there is a 64bit version available too.
Inside Eclipse (menu Window > Preferences), using the GNU ARM Eclipse plugins I can point my workspace setting to the build tools and toolchain folder:
4. Debugging with Segger and/or P&E
So far I have pretty much everything to build/debug projects for ARM. What is missing is debugging support.
To install support for Segger, go to the download page at https://www.segger.com/jlink-software.html and download the setup/package and run the installation process. You can go with the default installation path:
In Eclipse, make sure that you point to that installation location (menu Window > Preferences):
To install support for the P&E Multilinks, point Eclipse (Help > Install New Software) to the following update site:
💡 If I need to store a snapshot of the P&E update site, then I can use the approach described in “Replicating an Eclipse Update Site for Offline Usage“.
After installation I have now support added for the P&E debug devices, including support for OpenSDA.
5. Kinetis New Project Wizard, Processor Expert and Kinetis SDK
This part only applies if using Freescale Kinetis devices. To install the Kinetis New Project Wizard and Processor Expert, I go to http://www.freescale.com/tools/embedded-software-and-tools/software-development-tools/processor-expert-and-embedded-components/software-suites/processor-expert-software-microcontroller-driver-suite:PE_DRIVER_SUITE?tid=PEH and download the Processor Expert for Kinetis plugin package (registration required):
That package contains several files:
Unpack them and install first the ‘freescale_updater.zip’ with Help > Install New Software:
Then do the same using PEx_for_Kinetis_3.0.0.zip:
There is an Update for Processor Expert V3.0.1 available which needs to be installed BEFORE installing the Kinetis SDK. You can use the following update site:
The screenshot beow shows it on my system already installed:
The Kinetis SDK (now v1.3) is available from http://www.freescale.com/ksdk for download (registration required). Run the setup, and by default it will install it into
on Windows. Inside that installation there is an update for Eclipse add support for the Kinetis SDK. Use again Help > Install New Software and install the following zip file:
This pretty much completes the setup for the Freescale parts.
There is one more thing: at the time of this writing, there is a Processor Expert V3.0.1 update available from http://www.freescale.com/tools/embedded-software-and-tools/software-development-tools/processor-expert-and-embedded-components/software-suites/processor-expert-software-microcontroller-driver-suite:PE_DRIVER_SUITE?code=PE_DRIVER_SUITE&nodeId=015210BAF73F6BEC92&fpsp=1&tab=Design_Tools_Tab
Download that file, *unzip* it and update Eclipse with the zip file inside the downloaded package:
Now I have pretty much replicated what is in Kinetis Design Studio v3.0.0, but using my DYI Eclipse IDE :-).
What is missing is a nice way to inspect the device peripheral registers. For this, install the EmbSysReg Viewer, see “Freescale CMSIS-SVD Register Files with Eclipse MARS and EmbSysRegView“.
With this, I have constructed my own DIY IDE to develop application for ARM Cortex based devices. It only requires to download and install a few standard packages. Best of all: I have all the packages available so I can repeat the installation again, or simply put my current IDE layout into an archive and use it on another machine.
Of course it does not stop here: I will add many more plugins: FreeRTOS kernel awareness, static source analysis, doxygen, version control system, …
Compared to distributions from vendors like Freescale (Kinetis Design Studio), I have full flexibility: I don’t have to wait for new releases to get a bleeding edge tool chain. While it takes a little time at the beginning to do such an IDE and tool chain setup, it is very valuable afterwards because I *understand* what I have, and where I have it. And knowing what I do is always a good thing :-).
Happy Do-It-Yourself-ing 🙂
- Liviu’s GNU ARM Eclipse blog: http://gnuarmeclipse.livius.net/blog/
- GNU ARM Eclipse plugins on SourceForge: https://sourceforge.net/projects/gnuarmeclipse
- GNU ARM Eclipse build tools on SourceForge: https://sourceforge.net/projects/gnuarmeclipse/files/Build%20Tools/
- Eclipse download page: http://www.eclipse.org/downloads/
- CDT Offline download page: https://www.eclipse.org/cdt/downloads.php
- Segger J-Link download page: https://www.segger.com/jlink-software.html
- Freescale Processor Expert page: http://www.freescale.com/ProcessorExpert
- Freescale Kinetis SDK page: http://www.freescale.com/ksdk
- Previous article series how to build a DIY IDE: DIY Free Toolchain for Kinetis: Part 1 – GNU ARM Build Tools