LinkServer for Microcontrollers

GDB is the de-facto debugging engine and debug connection for micro-controllers these days: it is versatile and with its client-server architecture very flexible and powerful, and pretty much every debug probe and vendor (PEMICRO, SEGGER, OpenOCD, pyOCD, …) offers it. But a GDB server or command line implementation was not available for the NXP LinkServer family of debug probes (LPC-Link, MCU-Link, MCU-Link Pro). This has changed now: LinkServer is available as command line tool and can be used as GDB Server:

LinkServer as GDB Server with Eclipse

With the new LinkServer package I do not only get a gdb server implementation: I have now a command line tool I can use for automation and all kind of different things: programming boards, erasing flash, and so on.

Continue reading

Building a Triumvirate: From Eclipse CDT to CMake, CMD and Visual Studio Code

A Triumvirate is or Triarchy is built by three individuals which lead or rule something. In this article I want to rule a project with Eclipse CDT, Visual Studio Code and with building it from the command line for automated builds.

So what if I have an Eclipse project (say MCUXpresso IDE and SDK), and want to build it on a build server, and and I want to use the same time the project with Eclipse IDE and Visual Studio code?

Key to this is CMake: I’m keeping the Eclipse CDT features, adding CMake with Make and Ninja to the fix, and have it ‘ruled’ by three different ’emperor’: Eclipse, Visual Studio Code and from a shell console:

MCUXpresso SDK CDT project with CMake for Eclipse, Visual Studio Code and Command Line Building
Continue reading

Changing the Startup: Custom initial PC and SP Register Setting with the Debugger

By default, the debugger cares about the initial register settings after connecting to the target. But for special cases like using a bootloader combined with a loaded application, this requires a bit more than the usually ‘standard procedure’. For example I need to set both a custom program counter (PC) and stack pointer (SP).

How to set custom PC and SP for startup of the application
Continue reading

Using Semihosting the direct Way

Most embedded developers have probably used ‘semihosting’. And yes, it is generally seen as a bad thing. Maybe you have used it, without realizing what it really is and what it does. It is simple to add a printf() to the code (again: you should not use printf), and with the right standard library, it magically it shows up in a console view:

printf a hello world

That looks great, but what is behind this, to make it happen? Actually, it is really amazing technology. And it can be used for better things than just printing text.

Continue reading

Debugging Embedded Targets with pyOCD and Eclipse

If doing embedded development, then the debugging solution is probably the most important single tool in the development chain. Because very debugging probe has its pros and cons, I usually have at least three different debug probes on my desk, simply to get the job done in all aspects.

What is true for the hardware debugging probes, is true for the gdb client and server side. I’m using mostly the P&E, SEGGER and CMSIS-DAP plugins (e.g. NXP LinkServer) and OpenOCD from the Eclipse IDE side. But there are more choices, for example pyOCD.

Continue reading

New “MCU-Link Pro”: Debug Probe with Energy Measurement

After the release of the NXP MCU-Link debug probe, there have been hints in the Eclipse based MCUXpresso IDE that there must be another one coming. And indeed: another and more powerful debug probe is now available: the MCU-Link Pro. It is not only a debug probe but a power/energy measurement tool too, including an extra LPC804 mikrocontroller which can be used for all kind of things, like automation or scripting.

NXP MCU-Link Pro
Continue reading

Visual Studio Code for C/C++ with ARM Cortex-M: Part 7 – FreeRTOS

This is a new article in my series about using Microsoft Visual Studio Code: After installation, project setup, building, debugging, setting up a kit and IntelliSense. This one is about setting up and using FreeRTOS:

Microsoft Visual Studio Code with Debugging FreeRTOS application on ARM Cortex-M
Continue reading

Finding Memory Bugs with Google Address Sanitizer (ASAN) on Microcontrollers

Dangling pointers and memory corruption problems are nasty issues for any developer, and usually hard to find and locate in the code. Luckily Google has developed an open source tool to solve such issues: the Address Sanitizer (ASAN). The tool is available for x86 and other desktop style architectures, including Android and Linux. This article describes how ASAN can be used for an embedded target, e.g. ARM Cortex-M4 or similar.

Catching memory errors on ARM Cortex-M4F with ASAN
Continue reading

Full Bathroom Remodeling (with the Help of a 3D Printer)

This is about one of my ‘long running projects’: I happily can report that the missing last piece has been installed after 16 months from the start of the project: the ‘3D-Printed-Supported-Driftwood-Bath-Tub-Shower-Gel-Holder’ 🙂 :

This is the ‘official finish’ of a complete bathroom renovation and remodeling. It has been a joint project with the help of friends, contractors, my family and my brother in law (who is an outstanding carpenter and cabinetmaker), plus the Ultimaker2 3D printer which contributed many ‘background and hidden’ features.

I invite you to a virtual time travel. I hope you enjoy it and get inspired….

Continue reading