Boost Windows 11 Dev Performance with Docker Volumes

I recently upgraded from Win10 to Win11. Windows 10 was not great for building performance compared to Linux. And I feel that with Windows 11 things got worse too.

Dev Container in VS Code uses docker-based environments. This enables me using a full-featured development environment, with isolated dependencies. This is especially very useful for development in the embedded systems space. There I have to use many different SDKs, toolchains and libraries. Using Dev Containers is super easy. But file I/O operations with building etc/is not that great.

The solution is to use a Docker Volume with VS Code and Dev Container:

Build Performance Comparison
Continue reading

Using CAN FD for Remote Hardware Debugging of Cortex-M Devices

Today’s projects and systems get more and more complex. Many systems include multiple MCUs, connected with a field bus or network, for example CAN. For example there can be up to 70 CAN nodes in modern cars. Such larger and connected systems are a challenge for debugging.

Traditional hardware debugging requires a hardware debug probe, connected with a dedicated SWD/JTAG debug cable to the target device. This needs dedicated pins on the target device plus physical access to the device itself. In many cases, this is not possible in the final product. The hardware debug probes, cables, pins and high speed signals are costly. And worse they can introduce new problems and are prone to interference.

If there is a field bus like CAN connecting all the MCUs, why not use it for hardware debugging? Hardware debugging meaning programming the FLASH memory, halt the MCU, inspect the memory and registers, and step through the code?

Cortex-M Hardware Debugging over CAN

Yes, we can! With the help of a rather unknown hardware feature on ARM Cortex-M devices. We can use the ARM DebugMonitor Interrupt to control and debug the target system. As we would use a JTAG/SWD connection. Instead, we use the CAN bus :-).

Continue reading

Transforming a Lawn into a Wildflower Meadow

This article is not about software or an electronics project. It is about a multi-year project transforming a lawn into a home and food for various species. Slugs plus a cat have played a role in this, in one way or another.

Swallowtail Caterpillar (Schwalbenschwanz Raupe)
Wildflower Meadow
Continue reading

Low-Power Optimization Techniques for ARM Cortex-M Microcontrollers

Europe is currently facing an ‘Energy Crisis,’ and ‘Sustainability’ is a popular topic among companies. However, embedded engineers go beyond talking—they take action and make tangible changes in the world. With the increasing use of electronic devices, minimizing their energy and power consumption is crucial. Optimizing systems for deep low power or deep low energy is a challenging task. Nonetheless, as I will demonstrate in this article, it is possible to reduce energy consumption by a factor of 100 or more. This article provides a brief overview of the foundational concepts and then applies them step-by-step to an ARM Cortex microcontroller.

Measuring on-board LPC804 with MCU-Link Pro
Continue reading

How to make sure no floating point code is used

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?

wrapping float and double runtime routines

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 reading

VS Code: Telemetry-free VSCodium

“There is no such thing as a free lunch.”

https://en.wikipedia.org/wiki/No_such_thing_as_a_free_lunch

And this applies to VS Code and many of its extensions. You agree to the licensing conditions, and you pay with your data.

VS Code source code is MIT licensed, but the binaries you can download and install have telemetry built in: you are giving Microsoft your usage data in return for using VS Code.

If you are concerned about this, and looking for free and libre open source binaries of VS Code, then have a look at MIT-Licensed VSCodium.

https://vscodium.com
Continue reading

MCUXpresso IDE 11.8.0

Don’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…

MCUXpresso IDE 11.8.0
Continue reading

Consolidating with VS Code

It is August 1st, and Switzerland is celebrating its National Holiday. Rather cold and rainy, so this gets me some time to catch up on things. The preparation for the coming university semester in September is in full swing, and I have the honor to take over building up a new Master of Science in Engineering education module. In the existing courses I teach on the topic of embedded systems, I do use devices and MCUs from vendors like Broadcom, NXP, STM, Nordic, Raspberry Pi and Espressif. This not only means different SDKs, but different IDEs with different debug probes.

Just a subset of different hardware kits used in different labs

Eclipse has been the common factor in the mix with all these, and with all the pros and cons, it worked very well. With NXP having released support for Visual Studio Code, adding an announcement, and other vendors going into the same direction, I took the decision that I want to migrate my lab and lecture infrastructure to VS Code.

Continue reading

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