Booting J-Link as CMSIS-DAP Debug Probe

Mostly unnoticed (at least for myself), SEGGER has enabled some of the J-Link debug probes to support the CMSIS-DAP debug protocol.

SEGGER J-Link as CMSIS-DAP Debug Probe

This greatly enhances the use of J-Link debug probes for CMSIS-DAP based tools.

Continue reading

Adding the Picolib C/C++ Standard Library to an existing GNU ARM Embedded Toolchain

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:

Footprint of different embedded libraries

Continue reading

Which Embedded GCC Standard Library? newlib, newlib-nano, …

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:

Library Selection in MCUXpresso IDE
Continue reading

Energy Crisis in Europe: Optimizing a Building from 4.5 to 2.4 MWh

With the war in the Ukraine, energy prices in Europe reached new record levels. This initially affected the gas price which does not affect me directly. But it had a big impact on the price for electrical energy too. In my village, the price for electrical energy is now at 0.45 CHF/kWh, starting October 1st 2022. It is twice as much as what it used to be, and three times more what it used to be the price for the energy at night time.

Saving energy always makes a lot of sense, now even more, both for the environment and directly saving money. Luckily, I started thinking about optimizing the electrical energy used in my house back in 2021, and now in 2022 it really pays off: The daily average of 16 kWh/day (including heating and cooling) came down to 7 kWh/day, or from 4.5 MWh/year down to 2.4 MWh/year, or a reduction of 47%.

There were different areas contributing to this very positive result:

The above graph shows the changes in the different categories, from 2021 (blue, 4.5 MWh) to 2022 (orange, 2.4 MWh).

Continue reading

Are WLCSP the Solution during Silicon Shortage?

If you are in the electronics or microcontroller business: you very well know the problems with chip and silicon availability. What was supposed to last maybe for a few months starting with COVID-19 is still a problem in 2022: chips are not available or the price has skyrocket.

Cost-effective usage of NXP LPC804 with WLCSP20 Package

We at the Lucerne University are using NXP Kinetis micro controllers which seem to be affected by the silicon shortage somewhat more than any other devices? When looking that the usual sources, it was clear some are still available, but in a rather exotic WLCSP package. So the question is: can it be useful?

Continue reading

Choosing GNU Compiler Optimizations

Tool chains like the GNU compiler collection (gcc) have a plethora of options. The probably most important ones are the ones which tell the compiler how to optimize the code. Running out of code space, or the application is not performing well? Then have a look at the compiler optimization levels!

However, which one to select can be a difficult choice. And the result might very well depend on the application and coding style too. So I’ll give you some hints and guidance with an autonomous robot application we use at the Lucerne University for research and education.

INTRO Sumo Robot
INTRO Sumo Robot
Continue reading

Silicon Shortage and Semihosting with NXP MCUXpresso SDK on FRDM-KE02Z

The silicon shortage is still going on. While the NXP Kinetis KE devices might not be my first choice, they still seem to be available, in at least in lower quantities. This has been recognized by others, as I’m getting more and more questions and requests for the KE and KV family. This is why I un-dusted my old FRDM-KE02Z to be used with the latest MCUXpresso SDK and IDE.

FRDM-KE02Z Board

And in case you want to use that board or device with semihosting, I have you covered.

Continue reading

MCUXpresso IDE 11.5.0

I’m now in the middle of the university fall semester exam season with writing exams and grading student work, and the same time the new semester courses need to be prepared. With the global silicon and board shortage, this will be again a challenge to equip all the labs with the needed infrastructure. The good thing is that there is no shortage on software and tools side of the infrastructure: NXP released last week their new flagship Eclipse based IDE: the MCUXpresso IDE 11.5.0. Time to check it out for the upcoming lectures and classes….

NXP MCUXpresso IDE Version 11.5.0

Spoiler Alert: It has a new view for FreeRTOS lovers, plus new features for energy/power measurements!

Continue reading

Spilling the Beans: storage class and linkage in C, including static locals

In Spilling the Beans: C/C++ Header Files, I touched on interfaces and the difference between external and internal linkage. This article has a focus on internal linkage with using the static keyword in C.

Photo by Markus Spiske on Pexels.com

So this might be a programming language refresher, in case you are clear about the difference between declaration and definition, or if you are wondering about internal or external linkage in C.

Continue reading