Skip to content

Pre-Release v0.1.0a1

Pre-release
Pre-release

Choose a tag to compare

@begeistert begeistert released this 08 Jun 03:36
d860989

pymcu-arm 0.1.0a1 — Pre-Release

First public pre-release of pymcu-arm, the ARM (Cortex-M) backend for the
PyMCU compiler.

This release was formerly distributed as pymcu-rp2040. The package has been
renamed to reflect its scope: the backend targets the ARM Cortex-M architecture,
with the RP2040 as the first supported chip.


What's included

Component Description
pymcuc-arm AOT-compiled .NET 10 binary — lowers PyMCU IR to LLVM IR
Rp2040BackendPlugin Backend entry-point registered under pymcu.backendsrp2040
Rp2040ToolchainPlugin Toolchain driver registered under pymcu.toolchainsrp2040
Rp2040LlvmToolchain Resolves opt, llc, llvm-mc, ld.lld, llvm-objcopy via pymcu-arm-toolchain or system LLVM

Supported targets

Chip Triple CPU Status
RP2040 (Raspberry Pi Pico) thumbv6m-none-eabi cortex-m0plus

Compilation pipeline

PyMCU source (.py)
  → pymcuc (frontend + IR)
  → pymcuc-arm (LLVM IR)
  → opt  (LLVM optimiser, -O2)
  → llc  (LLVM → ARM Thumb2 assembly)
  → llvm-mc  (assembly → ELF object)
  → ld.lld  (linker → ELF)
  → llvm-objcopy  (ELF → flat binary / UF2)

Installation

pip install pymcu-arm==0.1.0a1

pymcu-arm-toolchain (LLVM 22.1.7) is declared as a platform-gated dependency
and is pulled in automatically on supported platforms (linux-x64, linux-arm64,
macos-arm64, windows-x64). On first use the toolchain stub auto-downloads the
LLVM binaries (~300 MB) into ~/.pymcu/tools/.

# Verify the toolchain resolved correctly
python -m pymcu_arm_toolchain status

Language features (RP2040)

  • Blink / GPIOmachine.Pin output, toggle, value read
  • UARTmachine.UART transmit and echo
  • MicroPython compatibility layerpymcu-micropython stub mapped to machine.*
  • CircuitPython compatibility layerpymcu-circuitpython stub mapped to digitalio.* / busio.UART
  • Function pruning — unreachable functions stripped from codegen output
  • Concurrent build safetyLazy<T> compiler guard prevents OOM under parallel test runs

Test status

6 integration tests pass against the RP2040Sharp simulator (blink + UART echo, both MicroPython and CircuitPython compat layers).


Known limitations

  • Alpha quality — API and IR format may change between pre-releases.
  • Only the RP2040 target is currently exercised; other Cortex-M0+ chips may
    work but are untested.
  • The pymcuc-arm binary is built per-platform at release time; wheels are
    published to GitHub Releases (too large for PyPI).

What changed from pymcu-rp2040

  • Package renamed pymcu-rp2040pymcu-arm
  • Python module remains at pymcu.backend.rp2040 / pymcu.toolchain.rp2040
    (chip-level paths are stable).
  • Binary renamed pymcuc-rp2040pymcuc-arm
  • Toolchain dependency renamed pymcu-rp2040-toolchainpymcu-arm-toolchain
    (LLVM 22.1.7, now wired as a runtime dependency)
  • CI migrated from a private Docker runner to GitHub-hosted runners
  • Publish workflow uses OIDC trusted publishing (no stored PyPI token)