Getting Started with Rust on NXP LPC55S69-EVK

The Rust Programming Language makes its way into the Linux kernel, and is used for embedded tooling. What about using it for Embedded? In this article, I’ll show how you get started with Rust on the NXP LPC55S69-EVK:

Rust on NXP LPC55S69 (Rust Icon: http://www.vericon.com)
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

Streamlining LinkServer Installation for CI/CD

I’m shifting more and more of my CI/CD testing infrastructure using the LinkServer runner. One reason is the LinkServer runner can run the test on-target. It can also collect GNO gcov coverage information at the same time. LinkServer is a suite of software tools for launching and managing GDB servers for NXP debug probes.

Streamlined LinkServer Installation on Linux
Streamlined LinkServer Installation on Linux
Continue reading

Sharing Standalone NXP SDK Projects in VS Code

The NXP SDK is git based which is great. If I create a project with VS code, it references the SDK cloned locally.

Standard NXP SDK Project in VS Code

A standalone project structure is needed if you want to easily share a project with your team. It’s also necessary for sharing inside a classroom environment. This article shows how to use an NXP SDK project in standalone mode.

Continue reading

Workaround for FreeRTOS Runtime Counter Issues in VS Code

FreeRTOS has a great performance measurement feature built-in: Performance counters. At each context switch, the RTOS can do a bookkeeping of time spent in tasks. With this, it can estimate the runtime distribution between the tasks. A very useful feature to get a feeling what the tasks are doing.

But I noticed that with recent FreeRTOS versions, VS Code extension have issues showing the correct runtime counter values:

Unknown Runtime Counters in VS Code Extension (mcu-debug.rtos-views)
Unknown Runtime Counters in VS Code Extension (mcu-debug.rtos-views)
Continue reading

Remote Debugging with DevContainer and VS Code

This is the second part describing how to use DevContainer for embedded applications with VS Code.

In Optimizing Embedded Development with VS Code and DevContainer I use VS Code with a docker ‘development’ container. The container is created with a recipe to install the development tools and SDK. With VS Code and DevContainer I have the same developer experience as I would develop locally on the host.

One thing not addressed in that earlier article is debugging. Using USB debug probes like a SEGGER J-Link or NXP MCU-Link is a challenge inside a container. This applies to any other debug probe as well.

The solution is to transform an USB based debug probe into one with a network connection:

VS Code DevContainer with Hardware Debugging
VS Code DevContainer with Hardware Debugging

In this article, I show how to do this.

Continue reading

Optimizing Embedded Development with VS Code and DevContainer

Embedded System have a lifetime of 10 or 15 years. During that time the software and tools has to be maintained. This can be very challenging. Who knows if that compiler or tool used is still available in 10 years from now? Additionally installing and configuring the tool chain and environment for a new team member is difficult. Even worse: using a different host operating system for the cross development can produce different results or introduce issues.

VS Code running with DevContainer
VS Code running with DevContainer

One solution for all these problems is to use Docker images and containers. I can pack all the necessary tools and software into a virtual environment and container. But developing inside a container comes with many challenges. In this article I’ll show how Visual Studio Code or VS Code makes working with containers very easy. In this article I show how easy it is to use modern development tools and methodologies for embedded development.

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

Start New VS Code Instances with Unique Environments

If working with different tool chains, SDKs, and vendors, then one must use different environments.

With VS Code, this can end up in counter-intuitive situation. When I start a new Visual Studio Code instance, it will open a new window. But if there is already an instance running, it actually will re-using that environment. This can cause lots of subtle problems, including failed builds.

VS Code re-using instance environment

So how to start a new Visual Studio Code Window, with a new instance?

Continue reading