Cppcheck is a static analysis tool for C/C++. I have used it a lot for my Eclipse projects. And it runs with VS Code as well.

Cppcheck is a static analysis tool for C/C++. I have used it a lot for my Eclipse projects. And it runs with VS Code as well.

Embedded System have a lifetime of 10 or 15 years. During that time the software and tools has to be maintained. This can be very challenging. Who knows if that compiler or tool used is still available in 10 years from now? Additionally installing and configuring the tool chain and environment for a new team member is difficult. Even worse: using a different host operating system for the cross development can produce different results or introduce issues.

One solution for all these problems is to use Docker images and containers. I can pack all the necessary tools and software into a virtual environment and container. But developing inside a container comes with many challenges. In this article I’ll show how Visual Studio Code or VS Code makes working with containers very easy. In this article I show how easy it is to use modern development tools and methodologies for embedded development.
Continue readingIn an earlier article I explained how to generate GNU coverage information, for an embedded application written in C.
In this article, I show the steps and configuration needed to use GNU gcov targeting an embedded application with C++.

Float and double data types area a bad choice for embedded applications. At least in most applications, and can or should be avoided, even with hardware FPU support present.
But how can I be sure that no floating point operations are used?

This article describes how to configure the GNU toolchain, so that no float or double operations are used, with the example of ARM Cortex-M. What I do? ‘Poisoning’ (!!!) the source code, force the gcc compiler to use software floating point operations and then catch them with the GNU linker :-).
Continue readingIn the OOP world, global objects get initialized with a constructor and destroyed at the end with a destructor. Interestingly, the GNU gcc has attributes to mark functions as constructor and destructors, which can greatly simply system startup and shutdown, even if not using C++.

With the GNU gcc compiler, I can mark functions with an attribute, so they get called before entering main() or after exit of main(). The attribute works both in C and C++, but it especially useful in C to initialize modules in an automated way.
Continue readingDon’t worry: despite all the things going on with VS Code, Eclipse is here to stay probably for many more years. The Eclipse foundation is pumping out releases, and so does NXP with their latest MCUXpresso IDE 11.8.0. Lets have a look…

It looks like my previous article “Which Embedded GCC Standard Library? newlib, newlib-nano, …” stirred up something: I saw and knew about the Picolib created and maintained by Keith Packard, but never had the time to try it out. With the university grading mostly over, I have put aside a few hours to try it out. And the result is very interesting:

When developing with C or C++ an application, then you mostly focus on your own code. You don’t want to bother with the details how input/output functions like printf() or scanf(), and you might just use these functions and helpers and that’s it.
The implementation is part of the ‘C Standard Library’ (or C++ Standard Library). In the world of Linux, this is usually the ‘glibc’ or ‘GNU C Library, and one usually link with ‘libc’. That provides the implementation of printf(), or use ‘libm’ if using math functions like sin() or cos().
In the embedded world, things are much more complex, with plethora of choices, for example in the MCUXpresso IDE:

If using C++ on an embedded target, you depend on the constructors for global objects being called by the startup code. While in many cases an embedded system won’t stop, so you don’t need to call the global C++ destructors, this is still something to consider for a proper shutdown.
