Debugging with Dynamic Printf Breakpoints

I’m not a big fan of using printf() in embedded applications, but I have to admit that in some cases it is very useful. One problem in debugging embedded systems debugging is getting values or information off the target: because of the limited resources this can be very challenging.

So why not doing this with the debugger in an automated way? And here dynamic printf breakpoints can help: it adds printf()-style output on-the-fly to your program without the need to recompile or restart your program, without the need to run printf() on the target:

Using Dynamic Printf Breakpoint
Continue reading

Spilling the Beans: volatile Qualifier

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.

Photo by Tara Winstead on Pexels.com

Still, ‘volatile’ is very useful if you know what it means for the compiler and what is good use of it.

Continue reading

Optimized Vinyl Cutting G-Code Tool Path with DXF2GCODE

G-Code (or RS-274) is a widely used protocol for CNC machines. I have added vinyl cutting capabilities to the Shapeoko desktop CNC recently (see DIY Vinyl Cutting Drag Knife for Desktop CNC), however cutting vinyl with a drag knife is whole different story compared cutting materials like wood or aluminum. As with many other things, it is about handling all corner cases properly.

Expected and not expected results cutting vinyl
Continue reading

Position-Independent Code with GCC for ARM Cortex-M

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

Visual Studio Code for C/C++ with ARM Cortex-M: Part 3 – Build

This is the third part in a series to get up and running using the Microsoft Visual Studio Code for embedded development on ARM Cortex-M. So far we have installed the needed tools, created a project and are able to build it from the command line. Now it is about how execute directly scripts or the build from the IDE.

Building with a Visual Studio Code Task
Continue reading

Touch & Build: Auto-Update of Firmware Date and Time

It is very valuable to have a date and time information in the binary. That way for example using a shell I can check the version of the firmware running on a device, or it can be printed on a console or UART as needed.

Firmware Date and Time

Firmware Date and Time

Continue reading

MetaClockClock Build Instructions

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.

MetaClockClock Temperature Display

MetaClockClock Temperature Display

Continue reading