Header files in C/C++ are defining the interface between different modules. In this article I share some tips and tricks how create such interface files.Continue reading
It is interesting to see that some aspects (mostly unintended) can stimulate lots of good and fruitful discussions. So this happened with “Spilling the Beans: Endless Loops” (recommended to read 🙂 where using (or not using) volatile for inline assembly created thoughts which warrant an article on that subject.
The volatile qualifier in C/C++ is misunderstood by many programmers, or wrongly used.
Still, ‘volatile’ is very useful if you know what it means for the compiler and what is good use of it.Continue reading
Welcome to ‘Alice in Wonderland‘! For a university research project using an ARM Cortex-M33 we are evaluating position-independent code as way to load applications or part of it with a bootloader. It sounds simple: just add -fPIC to the compiler settings and you are done.
Unfortunately, it is not that simple. That option opened up a ‘rabbit hole’ with lots of wonderful, powerful and strange things. Something you might not have been aware of what could be possible with the tools you have at hand today. Leading to the central question: how is position-independent code going to work with an embedded application on an ARM Cortex-M?
Let’s find out! Let’s start a journey through the wonderland…Continue reading
If you are not aware (yet?): it looks like the COVID pandemic caused a global silicon and microcontroller shortage with lead times >50 weeks in some cases. The microcontroller I have used for the MetaClockClock build (see “New MetaClockClock V3 finished with 60 Clocks” and “MetaClockClock V4 for the Year 2021“) is affected by this too, but I had luck and still enough microcontrollers to build a few more boards.
So I still have enough for building a new variant with it (not finished yet). While everyone else is waiting for the devices to arrive, here are more details and instructions for your own build.
“A young man is smoking one cigarette after each other without a pause. An elderly woman observes that and says: “Young man, you are smoking like crazy! Don’t you know that there is a warning on each cigarette package that this can kill you?” The young man finishes his cigarette, looks at the elderly person and says: “Yes, I know. But look, I’m a programmer, and it is only a warning.”
I don’t smoke, and I do pay attention to warnings :-). I always try to keep my source code free of compiler warnings. And I always pay special attention to the following on:
If you are developing Linux or desktop applications with GNU tools, you very likely are familiar with gcov: the GNU coverage tool. It collects data what parts of the code gets executed and represents that in different formats, great to check what is really used in the application code or what has been covered during multiple test runs.
GNU coverage is possible for resource constraint embedded systems too: it still needs some extra RAM and code space, but very well spent for gathering metrics and improves the firmware quality. As I wrote in “MCUXpresso IDE V11.3.0 for 2021” things are now easier to use, so here is a short tutorial how to use it.
There are many different aspects of Open Source projects: It is not only about the fact if the sources are available (‘open’). It is about the licensing terms (how permissible is it, what can I do with it), maintenance and continuous development (what has changed between releases), how and where is it delivered (Sourceforge, dedicated distribution, packaging) up to collaboration (how can I contribute or submit issues).
NXP has now published the MCUXpresso SDK on Github:
Something I was waiting for a long time.
It is always good to have a close look what ends up in a microcontroller FLASH memory. For example using EHEP Eclipse plugin to inspect the binary file:
Obviously it has path and source file information in it. Why is that? And is this really needed?
- Privacy: the path or file name might expose information (secret project name?) or might be used for reverse engineering?
- Size: The strings add up to the final data/FLASH size, so this increases the need for ROM space?
So let’s have a look what is the reason for this and how it could be avoided or at least reduced.
Something what I say quite often is: “Google is your friend”. It means that the answer to many questions can be found with an internet search engine. And I have to admit that I have to ‘google’ my own articles to find solutions for problems I feel I have seen in the past too :-).
But for the one problem below I did not find anything: not on my own blog, and not anywhere else in the internet:
I had a few of PCBs left over from the V3 MetaClockClock, and originally I planned to finish a build with them by the end of 2020. But as always: things took a bit longer than expected, so I finally finished it today on the first day of the year 2021.
The build uses the same hardware as in the previous V3, but instead of an ‘artistic’ canvas background I decided for a more natural and wood design: