← All projects
Project record1 mention
Originally shared on Hacker News

RPI Pico (RP2040) PIO Emulator Package for Go

A Go package that emulates the Raspberry Pi Pico (RP2040) programmable I/O (PIO) hardware. It supports running multiple electrically connected RP2040s, emulating their full PIO blocks (all 8 processors each), niche inter-processor interactions, and GPIO functionality, so PIO programs can be tested inside other programs such as test suites.

Last shared For Other RP2040 users.
01 / The problem

What it addresses

Real RP2040 hardware is undebuggable and existing emulators did not support connecting multiple RP2040s together and lacked functionality, leaving PIO programs without a way to be tested.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. RPI Pico (RP2040) PIO Emulator Package for Go

    A Go package that emulates the Raspberry Pi Pico (RP2040) programmable I/O (PIO) hardware. It supports running multiple electrically connected RP2040s, emulating their full PIO blocks (all 8 processors each), niche inter-processor interactions, and GPIO functionality, so PIO programs can be tested inside other programs such as test suites.

    Problem: Real RP2040 hardware is undebuggable and existing emulators did not support connecting multiple RP2040s together and lacked functionality, leaving PIO programs without a way to be tested.

    Audience: Other RP2040 users.

    Posted by @headblockhead · Original source ↗

    Story title · @headblockhead · · Source ↗

    Show HN: RPI Pico (RP2040) PIO Emulator Package for Go

    Submitted URL · @headblockhead · · Source ↗

    https://git.edwardh.dev/pio

    Source text · @headblockhead · · Source ↗

    My emulator supports running multiple RP2040s electrically connected together, and emulates the whole of their PIO blocks (all 8 processors each), along with all of the more niche inter-processor interactions and GPIO functionality I could possibly find in the datasheet.

    Source text · @headblockhead · · Source ↗

    I built it as a Go package so that it can be used inside of other programs; I intend on using it myself inside a test suite against my in-development protocol.

    Source text · @headblockhead · · Source ↗

    I have been developing a bus communication protocol for a while using the Raspberry Pi Pico (RP2040)'s programmable IO (PIO) hardware (basically- 8 tiny processors that run assembly programs to manipulate GPIO pins) and I needed some way of testing my programs, as the real hardware is undebuggable.

    Source text · @headblockhead · · Source ↗

    none of the existing emulators I could find supported connecting multiple RP2040s together, and they each had a few different missing bits of functionality, so I decided to make my own!

    Source text · @headblockhead · · Source ↗

    using the Raspberry Pi Pico (RP2040)'s programmable IO (PIO) hardware (basically- 8 tiny processors that run assembly programs to manipulate GPIO pins)

    Source text · @headblockhead · · Source ↗

    Hope it can be useful to other RP2040 users.