Eclipse Embedded CDT

A family of Eclipse CDT extensions and tools for GNU Arm & RISC-V development

Article - GNU ARM Eclipse: open source tools with (experimental) CMSIS Pack support

(This article was published in the ARM Connected Community blog, on 17.08.2014).

Overview

The GNU ARM Eclipse project includes a set of open source Eclipse plug-ins that enhance Eclipse CDT (C/C++ Development Tooling) with the specific functionality required to create/build/debug/manage ARM (32-bit) and AArch64 (64-bit) applications and static/shared libraries, using the latest GNU ARM GCC toolchains. These plug-ins will be the foundation of a future integrated suite intended to meet the growing demands of entry level users and small companies.

Project sites

The main source of information for GNU ARM Eclipse is the project site http://gnuarmeclipse.github.io/, currently with the following home page:

The GNU ARM Eclipse home page

The Git repositories and all public releases are available from SourceForge.

SourceForge project

Install

The recommended way to install the GNU ARM Eclipse plug-ins is to use the Eclipse standard install/update mechanism: in the Eclipse menu, go to: Help → Install New Software… and use the update site location: http://gnuarmeclipse.sourceforge.net/updates

Install the plug-ins

The managed build

The managed build plug-in allows to create C/C++ managed projects and to configure an extensive list of compiler and linker options.

Tool settings

The GNU ARM Eclipse build plug-in also provides extensive configuration options for selecting the toolchain and to portably manage the toolchain path:

Toolchain settings

Extra build steps

In addition to building the ELF file, the build plug-in can also create a binary file (ihexsrecbinary) to be programmed in the processor flash memory, create a listing, and display the program size.

Extra build steps

Discovery Options & Indexing

In order to allow Eclipse users to navigate to definitions and declarations, to allow smart completion, refactoring and all these nice features, the CDT needs to have exactly the same knowledge of the source files as the compiler. For this, it also needs to know the system headers used at compile time and the default preprocessor definitions issued by the compiler. GCC provides a magic combination of command options to do this (-E -P -v -dD ${plugin_state_location}/specs.c), so the CDT needs to issue the proper compiler commands (one for each language, C & C++). The build plug-in provides these details, for each toolchain.

Language settings provider options

The result of a proper discovery setting is a correct set of preprocessor definitions that reflect the compiler options and a correct set of include folders:

Automatically discovered system include folders

Functional ready to run templates

For beginners, who need initial help to put together all details for their first project, a complete sample with startup code, linker scripts, semi-hosting support and all necessary options already set, can be a major time saver.

Elaborated templates are available for the STM families of processors STM32F[01234]x, and for some Freescale KLxx processors. They create the classical application that blinks a LED, and, specific for the Debug configuration, prints a string on the tracing (SWV or semi-hosting) output.

New STM32F4 project template

For processors from other families, there is also a generic Hello World ARM Cortex-M3 Project template.

Debugging support

During the lifetime of a project, creating/editing source files and building binaries are certainly important activities, but in many cases the most time is spent during debugging sessions, therefore a reliable debugging environment is an absolute must.

There are many debugging techniques and tools, but GNU ARM Eclipse recommends two solutions:

The preferred solution is the SEGGER J-Link, and the J-Link plug-in allows to configure most relevant J-Link GDB server options:

The J-Link GDB server configuration

Packs support

Packs refers to a new modular technology, intended to simplify distribution of software and documentation. The main difference from usual libraries or source archives is that the actual source/object files are accompanied by some form of metadata, defining the dependencies between files, the use of constraints and conditions, plus lists of devices the software runs on, with full descriptions, memory map, registers and peripherals, etc.

The GNU ARM Eclipse Packs Support plug-in is intended to manage (list/install/inspect/remove) packs from multiple sources. It currently implements the specifications of CMSIS Packs v1.2, as defined by ARM/Keil, with some extensions.

The Packs perspective

The importance of the packs technology is amazing, and there are many useful things available in the packs; unfortunately most of the existing ones, being created by ARM/Keil, were designed with Keil MDK in mind, so are expected to be included in projects compiled with the outdated ARMCC compiler; moreover all available examples can be used only with Keil MDK, and are of no direct use for Eclipse and GCC environments.

For the moment, inspecting the content of the packs is all that can be done, but the packages also include some portable files, that can and will be used in future versions of the plug-ins, for example:

  • the list of supported devices and memory maps will be used to associate devices to projects; this will allow to automatically fill in some of the compile options, like the architecture (M0/M0+/M3/M4); even more importantly, it will allow to automatically generate the linker scripts with the correct values (avoiding severe headaches for many users, especially beginners);
  • the detailed list of device peripherals and the register bits will be used to extend the debug perspective with a detailed view presenting the register bit values, a very convenient feature when developing embedded software;
  • the list of documentation files (PDF or CHM) will be available on a project view, for easy access to the specific device or board documentation;
  • the vendor CMSIS headers and source files will be used in the future version of the project template.

And, in the mid-term future, the GNU ARM Eclipse templates will be fully replaced with component based projects, allowing an easy update and advanced configurability for projects.

More info

For more info about the GNU ARM Eclipse project, please refer to the project site http://gnuarmeclipse.livius.net/ (update: no longer available).