‘Experience Energy’ at the Verkehrshaus: The ‘House of Energy’ Construction Kit

The ‘Verkehrshaus der Schweiz‘, the ‘Swiss Museum of Transport’ is Switzerland’s most popular museum.

In April 2023, it opened up a new building and the ‘Experience Energy!’ exhibition. For the opening event we created a unique construction kit to explore energy: from harvesting to storing and up to distributing and using energy.

“House of Energy” at the Swiss Museum of Transport in Lucerne
Continue reading

Implementing File I/O Semihosting for the RP2040 and VS Code

I’m working recently on a new lecture module using the Raspberry Pi Pico (RP2040) board, which highlights several aspects of modern software engineering, including DevOps and CI/CD. An important part of any CI/CD pipeline is testing. For a host application, one could pass arguments to the application, e.g. ‘myapp --test=module1‘, or let it read such information from a configuration file which describes the tests. Or write GNU gcov data to a file to collect coverage information.

Unfortunately, a normal embedded application has no argv[], and many system have no file system. A solution to this problem would be using semihosting with file I/O. Unfortunately for the Raspberry Pi Pico SDK 1.5.1 for the RP2040, there is no semihosting file I/O implemented :-(.

I have now implemented and added file I/O to the SDK, making it possible for the RP2040 to access and use files on the host, among other things. This greatly extends the capabilities of the device, and is very useful for testing, including gathering test coverage information.

RP2040 writing files on the host with semihosting
Continue reading

Debug Probes for RP2040 with VS Code

For systematic debugging, an engineer needs a debug probe. For the Raspberry Pi Pico (RP2040) device there are plenty of debug options with VS Code.

In this article I show different options, from professional tools to DIY solutions and the settings in VS Code I’m using.

Continue reading

Semihosting with VS Code on RP2040

With semihosting I can use standard I/O function like printf() and I can read and write data on the host through the debug connection. If used with care, this is a great feature especially for unit testing.

Raspberry Pi Pico-W (RP2040) board
Continue reading

Open Source picoLink: Raspberry Pi RP2040 CMSIS-DAP Debug Probe

One essential part of embedded development is the ability to debug the target application. The good thing with the Raspberry Pi Pico RP2040 Eco-system is: One can use another RP2040 Pico board as a debug probe to debug other ARM Cortex-M devices.

But instead using a Raspberry Pi Pico board with some wires, why not building a dedicated board? The result is a small, versatile and open source debugging probe which virtually can debug any ARM Cortex-M device as a standard ARM CMSIS-DAP probe:

picoLink Debug Probe debugging a Raspberry Pi Pico Board
Continue reading

RP2040 with PIO and DMA to address WS2812B LEDs

I love the WS2812B (aka SK6812) addressable LEDs: they are inexpensive and available in different packages. I have used them in different projects, including the MetaClockClock one. I used the NXP Kinetis for these projects, but because they are not available any more, for a new project we had to choose a new microcontroller, with the Raspberry Pi Pico RP2040 as the winner.

Raspberry Pi Pico RP2040 driving WS2812B with PIO and DMA
Continue reading

Using a Watchdog Timer with an RTOS

When something goes wrong in an embedded system, a watchdog timer is the last line of defense against a blocked or malfunctioning system. A watchdog is a special timer which needs to be ‘kicked’ in a special way, otherwise the timer will run out and reset the system.

For example, a watchdog is an important safety feature in the E-Vehicle charging controller with Raspberry Pi Pico-W RP2040:

EVCC Controller
Continue reading

Add extra Storage to the Raspberry Pi Pico with W25Q128 and LittleFS

The RP2040 Pico board comes with 2 MByte onboard FLASH memory. While this is plenty of space for many embedded applications, sometimes it needed to have more storage space. Having the ability to adding an extra SPI FLASH memory with a useful file system comes in handy in such situations. This makes the RP2040 ideal for data logger applications or otherwise store a large amount of data. In this article I’ll show you how to add an extra 16 MByte of memory to the Raspberry Pi Pico board, running FreeRTOS, a command line shell and using LittleFS as the file system.

Continue reading

Getting Started: Raspberry Pi Pico RP2040 with Eclipse and J-Link

In this time where many micro-controllers have 100+ weeks estimated delivery time, it makes sense to look at alternatives. So it is not a surprise that the Raspberry Pi RP2040 gets used more and more in projects. It is not only inexpensive, it is (at least for now) available which makes all the difference. The RP2040 is the first microcontroller from Raspberry Pi: a dual-core ARM Cortex-M0+ running up to 133 MHz, 264 KByte on-Chip RAM and up to 16 MByte external FLASH.

Raspberry Pi Pico with J-Link, with a NXP sensor board

It is a very versatile microcontroller, with a rich eco-system and set of tools. It can be easily used with C/C++ or MicroPython, and the Raspberry Pi Pico board only costs around $5. There are plenty of tutorials out there, for example how to use the Pico board as debug probe to debug another Pico board. While this is great, there is an easy way to use any existing J-Link and Eclipse IDE too, so this is what this article is about.

Continue reading