micropython / micropython/micropython-lib

Use Emulation to Run RP2 PIO Code on Other Ports

Open
#900 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
1.1k
Avg merge
7d 6h
Merged PRs (30d)
3

Description

The RP2 chip's PIO peripheral is a powerful piece of hardware capable of performing tasks that might otherwise require very fast bit-banging code, but it's also quite difficult to validate the correctness of a complicated PIO program as this code can then "only" be run on real hardware.

I'm planning to implement a library that's API-compatible with the rp2.StateMachine interface, to allow other ports to run PIO programs via emulation. I don't know if this can ever allow practical real-time I/O on any of the microcontroller ports; my primary use-case is to enable using the unix port to run test cases involving PIO functionality.

Given that initial goal, I intend to implement this by wrapping the rp2040-pio-emulator python package. A later stab at this idea might re-implement it in C later, if someone can figure out a path to doing this in real-time on microcontroller hardware.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the rp2.StateMachine interface and the rp2040-pio-emulator package named in the issue. Determine the compatibility surface and how the Unix port could exercise PIO test cases. Done means a usable API-compatible emulation library is available for those tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.