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

Setup Guide for FRDM-IMX93 as Debug Server

In Using Raspberry Pi and MCU-Link for Remote Embedded Debugging I created a remote server for debugging. I did order the NXP FRDM-IMX93 a few weeks ago, and did not had a chance to use it. So why not doing the same?

FRDM-i.MX93 with MCU-Link
FRDM-i.MX93 with MCU-Link

Here is how it can be uses as remote debug server,

Continue reading

Running On-Target Tests with Coverage in VS Code

Test coverage is a very useful metric: it tells how much of your code has been covered by tests. Or the other way: it helps identifying areas of my code which has not been running tests. A new CMake extension in VS Code is available. It works with the new NXP LinkServer test runner to allow running tests on an embedded target. The really cool thing is: it collects and visualizes test data with coverage information in a single step:

Test Data combined with Coverage in VS Code
Test Data combined with Coverage in VS Code
Continue reading

Using Raspberry Pi and MCU-Link for Remote Embedded Debugging

Remote debugging an embedded target is very useful: I don’t need a direct debug probe or USB cable connection. Instead, I’m using a network connection (wired or even wireless) over TCP/IP to talk to the debug probe and target. That way I can place the debug probe and target system away from my desk.

In Debugging ARM Cores with IP based Debug Probes and Eclipse I have used IP-based debug probes. This is a logical path, but expensive.

In Remote Debugging with USB based JTAG/SWD Debug Probes I showed how normal USB based debug probes can be used. This approach uses a remote host machine (e.g. desktop machine or notebook). This approach is still expensive, not scalable and the host machine needs a lot of space too.

So what if I use a Raspberry Pi instead? The RPi is small, inexpensive and ideal for such a task. Additionally, I can easily use it to build a test or debug farm. In this article, I show the use of the Raspberry Pi for remote debugging. A sub $20 or embedded target debug probe can be employed.

Raspberry Pi with NXP MCU-Link for Embedded Target Debugging
Raspberry Pi with NXP MCU-Link for Embedded Target Debugging
Continue reading

MCU-Link-MR: Affordable CMSIS-DAP Debug Probe for Robotics and beyond

The MCU-Link-MR from NXP is a CMSIS-DAP debug probe. It includes dedicated connection headers found on mobile robotic systems. These systems include the Pixhawk/PX4 drone and robotics hardware.

MCU-Link-MR CMSIS-DAP Debug probe with Pixhawk 6x RT
Continue reading

Standalone Semihosting Host-Target Console with CI/CD Runner and CMSIS-DAP

NXP has released a new LinkServer software. It includes an interesting feature. The LinkServer test runner has been extended with a Semihosting console. This is not only very useful for on-target testing. With the Semihosting console, I have a bidirectional communication channel with the target. And I do not need any hardware pins or to run a debug session. All what I need is the CMSIS-DAP connection with the NXP LinkServer runner to have a command line shell:

Target Console with Semihosting
Target Console with Semihosting
Continue reading

On-Target Testing with LinkServer Runner and VS Code

The release 24.9.75 of LinkServer software and tools includes interesting feature: the ability to use the debug probe for automated on-target testing. It includes a ‘runner’ which can program, launch and run the application on the target through a debug probe. While the target is running, it uses semihosting or UART for communication. This makes it a perfect tool for automated testing, especially in a CI/CD environment. One such environment is running automated tests with CMake and CTest in VS Code.

Automated on-target testing with VS Code and LinkServer
Continue reading

NXP LinkServer 24.9.75: New GUI for Flash Programming

NXP has released a new version of the LinkServer software. This is a utility for debugging and using scripting for a wide range of devices and debugging probes. It includes support for the MCU-Link, LPC-Link2, on-board and CMSIS-DAP based debug probes with the ‘LinkFlash’:

Programming with LinkFlash

With the new release, it includes a graphical user interface (GUI) for flash programming. It also includes erasing, verifying, recovery, and saving the memory to a file.

Continue reading

MCUXpresso IDE v11.10: Easy MCU-Link Firmware Update with Eclipse

A new eclipse-based NXP MCUXpresso IDE v11.10 is available With this new release, it includes an even easier firmware update mechanism for the MCU-Link (LinkServer) debug probes.

MCU-Link based debug probes with a FRDM-K22F board
Continue reading

Using NXP i.MX RT685 with pyOCD: Device Support and Debugging Configuration

The NXP i.MX RT685 is an interesting device: an ARM Cortex M33 with a Cadence Xtensa audio DSP. To explore the features of the device, I’m using the NXP EVK board:

pyOCD with NXP i.MX RT685

I have used it so far with the on-board MCU-Link debug probe and LinkServer. This article describes how I have added pyOCD as debug interface for the RT685, as well how to patch and use custom DFP (Device Family Pack) files with pyOCD and Eclipse.

Continue reading