Eclipse as IDE takes care about compiling and building all my source files. But in an automated build system I would like to build it from the command line too. While using make files (see “Tutorial: Makefile Projects with Eclipse“) is an option, there is another easy way to build Eclipse projects from the command line:
Last month (June 2017), the latest version of Eclipse “Oxygen” has been released, and I have successfully used it in several embedded projects. Time to write a tutorial how to use it to build a custom Do-It-Yourself IDE for ARM Cortex-M development: simple, easy, unlimited and free of charge. While the DIY approach takes a few minutes more to install, it has the advantage that I have full control and I actually know what I have.
The benefit of an IDE like Eclipse is: it makes working with projects very easy, as generates make files and it takes and automatically manages the make file(s). But sometimes this might not be what I want because I need greater flexibility and control, or I want to use the same make files for my continues integration and automated testing system. In that case a hand crafted make file is the way to go.
One thing does not exclude the other: This article explains how to use make files with Eclipse with similar comfort as the managed build system in Eclipse, but with the unlimited power of make files:
For reliable applications, I avoid using functions of the standard libraries. They are banned for most safety related applications anyway. I do not use or avoid malloc(), printf() and all the other variants, for many reasons including the ones listed in “Why I don’t like printf()“. Instead, I’m using smaller variants (see “XFormat“). Or I’m using only the thread-safe FreeRTOS heap memory allocation which exist for many good reasons.
Some silicon vendors provide their Eclipse example and SDK projects using linked files and folders. For example a bootloader demo application is provided in the context of an SDK or library. That’s fine until the time I want to transform such an example into a real project or if I want to have it without the hundreds of files for all the other devices I don’t need or use. I cannot take the project and put it into a version control system as the linked files won’t be in my VCS. I cannot move the project to another place as the links are pointing to many places. What I need is a ‘standalone’ project: a project which has all the needed files in it and is self-containing.
Eclipse Project with Linked Files and virtual groups
In many sources I have ‘inactive’ code: source code which is disabled by some macros or defines. Eclipse is great to ‘gray’ out the inactive parts using its Indexer, but they still need screen real estate:
I like to have as many lines of source code visible on my notebook or desktop monitor. And I think I have found a good balance between font size and readability.
On the other side: I’m getting older and my eyes are not getting any better. At the same time I noticed that students start using these ‘high-resolution-retina-displays’. They are great, but result in tiny default system fonts, so I have a hard time to read the source code on their machines.
Another challenge I noticed are the high-resolution projectors in class rooms or conferences. They are not well suited to show source code or text files because of the tiny fonts. Starting with Eclipse Neon there is an awesome feature which I can use to dynamically increase and decrease the font size which solves that problem:
For a research project, we are going to send a satellite with an embedded ARM Cortex microcontroller into space early next year. Naturally, it has to work the first time. As part of all the ESA paperwork, we have to prove that we tested the hardware and software thoroughly. One pice of the that is to collect and give test coverage evidence. And there is no need for expensive tools: Free-of-charge Eclipse and GNU tools can do the job for a space mission 🙂
The GNU tools include powerful utilities to collect coverage information. With coverage I know which lines of my code have been executed, which is a very useful test metric. The GNU coverage tools are commonly used for Linux applications. But to my surprise not much for embedded application development, mostly because it requires a few extra steps to have it available? Why not using free and powerful tools for improving software quality? This article explains how to install the GNU gcov tools into the Eclipse IDE.
For many projects it would be cool to build a custom USB Joystick device, either as custom game controller for Windows or any USB host which can be used with a USB Joystick. Instead buying one, why not build my version? All what I need is a USB capable board, some kind of input (potentiometer, push buttons) and some software, and I have my USB Joystick:
In “Cycle Counting on ARM Cortex-M with DWT” I have used the ARM DWT register to count the executed cycles. With the MCUXpresso IDE comes with a very useful feature: it can capture the ARM SWO (Single Wire Output) trace data. One special kind of trace data is the ‘cycle counter’ information which is sent through SWO.
During Embedded World 2017 in Nürnberg I was lucky to get a handful LPC800-DIP boards. To get all students who were lucky to get one, here is a tutorial to make that very exciting ‘blinky’ application on that board: