Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pymcu-arm

ARM (Cortex-M) support for the PyMCU compiler: LLVM-IR codegen backend + LLVM toolchain driver.

Unlike the AVR/PIC/RISC-V backends, this backend does not emit assembly directly. It lowers PyMCU's architecture-agnostic IR (.mir) to LLVM IR text (.ll) and hands it to LLVM — so register allocation, instruction selection, the AAPCS calling convention, and all optimization passes are done by LLVM.

Currently supported targets:

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

The codegen is chip-agnostic: only -mtriple/-mcpu change per target.

Pipeline

pymcuc --emit-ir        →  firmware.mir    (target-agnostic IR, 32-bit pointers)
pymcuc-arm (this pkg)   →  firmware.ll     (LLVM IR text)
LLVM toolchain          →  opt → llc → ld.lld → llvm-objcopy
                            + generic boot2 (crc32) + crt0  →  firmware.bin

The flat flash image (firmware.bin, boot2 at offset 0) is what the RP2040Sharp emulator's PicoSimulation.LoadFlash(...) consumes in the integration tests.

Installation

pip install pymcu-arm

LLVM tools are resolved (in order) from the pymcu-arm-toolchain wheel cache, common system install paths (/opt/homebrew/opt/llvm/bin, /usr/lib/llvm/bin), or PATH. A system LLVM (brew install llvm lld / apt install llvm lld) also works with no extra package.

Layout

src/python/pymcu/backend/rp2040/    backend plugin — wraps pymcuc-arm
src/python/pymcu/toolchain/rp2040/  LLVM toolchain driver (opt → firmware.bin)
src/csharp/lib/                     Rp2040BackendProvider + Targets/RP2040/Rp2040LlvmCodeGen
src/csharp/cli/                     pymcuc-arm runner CLI
src/runtime/                        generic boot2 (crc32), crt0, rp2040.ld linker script

Status

Alpha. Single-core (core0). GPIO, UART0, SPI, I2C, ADC, PWM, DMA, PIO. Exceptions (portable T-flag model), f32 (RP2040 via the bootrom fast-float library, RP2350 via the M33 FPU in softfp mode), operand-form inline asm. No GC yet.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pymcu_arm-0.1.0a3-py3-none-win_arm64.whl (1.8 MB view details)

Uploaded Python 3Windows ARM64

pymcu_arm-0.1.0a3-py3-none-win_amd64.whl (1.9 MB view details)

Uploaded Python 3Windows x86-64

pymcu_arm-0.1.0a3-py3-none-manylinux_2_28_x86_64.whl (2.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

pymcu_arm-0.1.0a3-py3-none-manylinux_2_28_aarch64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

pymcu_arm-0.1.0a3-py3-none-macosx_26_0_arm64.whl (1.8 MB view details)

Uploaded Python 3macOS 26.0+ ARM64

pymcu_arm-0.1.0a3-py3-none-macosx_13_0_x86_64.whl (2.0 MB view details)

Uploaded Python 3macOS 13.0+ x86-64

File details

Details for the file pymcu_arm-0.1.0a3-py3-none-win_arm64.whl.

File metadata

  • Download URL: pymcu_arm-0.1.0a3-py3-none-win_arm64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymcu_arm-0.1.0a3-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 9b9ec7cf825a3f03c142058fa84598a93fd112e89e125532ff5c02797e29b7a1
MD5 adcccc17cbbc9bbbdd94dd585ed425c5
BLAKE2b-256 ef532ffa8b3db9b24c18902bf1674c0124ff4ec030e308d5d73c96d82f0c73fa

See more details on using hashes here.

File details

Details for the file pymcu_arm-0.1.0a3-py3-none-win_amd64.whl.

File metadata

  • Download URL: pymcu_arm-0.1.0a3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymcu_arm-0.1.0a3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5590ef721d26d999fdfd3687dcb587d9914d6d1663f30831f3e1986e0231729b
MD5 6cc6b5122232eeb8232c96e0211eebb7
BLAKE2b-256 8bc091d2b41a04645213b46dbb2b372a0d33d202f0e6d546bc88b233a1e17910

See more details on using hashes here.

File details

Details for the file pymcu_arm-0.1.0a3-py3-none-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: pymcu_arm-0.1.0a3-py3-none-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymcu_arm-0.1.0a3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b30211b2d08c8f71c2ac57cfcdc2b60bc902d30a1071998ae384ba30387f6358
MD5 86fcd00d6b9a6f10e5e3f2fce44875d4
BLAKE2b-256 59215aaf6e28d7346895e0ef5ee8f88c8734e94a3de9fb1db6898cb30ee75051

See more details on using hashes here.

File details

Details for the file pymcu_arm-0.1.0a3-py3-none-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: pymcu_arm-0.1.0a3-py3-none-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymcu_arm-0.1.0a3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8c976843534ddae6085dfd431103ba19cda606102600cdf5b2c83bf8b1f012be
MD5 838f5c1723dd00febb9675a75bf5829e
BLAKE2b-256 8b6df2c652b01eeba7fbf128487465f316b3a785f113d69480902033fac806c7

See more details on using hashes here.

File details

Details for the file pymcu_arm-0.1.0a3-py3-none-macosx_26_0_arm64.whl.

File metadata

  • Download URL: pymcu_arm-0.1.0a3-py3-none-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3, macOS 26.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymcu_arm-0.1.0a3-py3-none-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 c445f24901516c5b15cedba63843f7e20788b214f46dd285013b0510c55d5afe
MD5 94a4753bd92823d28369447dfadc16f6
BLAKE2b-256 00f5c853865e3699459793cd537df8e5d3af25bdf4e4b047efd8f8402cfbcd92

See more details on using hashes here.

File details

Details for the file pymcu_arm-0.1.0a3-py3-none-macosx_13_0_x86_64.whl.

File metadata

  • Download URL: pymcu_arm-0.1.0a3-py3-none-macosx_13_0_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3, macOS 13.0+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymcu_arm-0.1.0a3-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 55176ef6510e41421350bcc5839c970aeea7fe92e160d4bad71f96f9fd8b4f21
MD5 6250ab5907871b1a65ddc0f51b348916
BLAKE2b-256 7bac4cfa98b70cdada93ad35731b08b3131a2ba7d93dea202ab9e39178fd528c

See more details on using hashes here.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page