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 / Pico W) thumbv6m-none-eabi cortex-m0plus
RP2350 (Raspberry Pi Pico 2 / Pico 2 W) thumbv8m.main-none-eabi cortex-m33

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
UF2 packer              →  firmware.bin    →  firmware.uf2  (BOOTSEL image)

The flat flash image (firmware.bin, boot2 at offset 0) is what the RP2040Sharp emulator's PicoSimulation.LoadFlash(...) consumes in the integration tests. firmware.uf2 is the same image in UF2 form (family 0xe48bff56 on RP2040, 0xe48bff59 on RP2350) — it is what pymcu flash uploads with picotool or by drag-and-drop onto the RPI-RP2 volume.

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/python/pymcu/programmer/rp2040/ UF2/picotool flash programmer plugin
src/runtime/                        boot2 (crc32), crt0 / crt0_m33, picobin block, rp2040.ld / rp2350.ld

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.0a4-py3-none-win_arm64.whl (1.8 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

pymcu_arm-0.1.0a4-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.0a4-py3-none-manylinux_2_28_aarch64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 26.0+ ARM64

pymcu_arm-0.1.0a4-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.0a4-py3-none-win_arm64.whl.

File metadata

  • Download URL: pymcu_arm-0.1.0a4-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.0a4-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 151d4b41a54d5262f37602724433b32b58ee99a208b1700987cba7e2550d543a
MD5 79cd1ec3b7fc4f1f471f88a984b6ee0a
BLAKE2b-256 6868b05a3775180497631581eafbeeebaa1ed0eece9ac21636b9344cd4021b16

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a4-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.0a4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 75ea1caf7a403363e7fb5a8aa65d5d6dc37edf05b6741c78b2aceef1f1cb234e
MD5 2424794ae7fcb8e366b1ba65040f0553
BLAKE2b-256 6d0bdc13ee82da2c0ed80b017d36dd85f00dc6623877bd912b8eb1be4124499b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a4-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.0a4-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 daf920ada0ad9d2c2c480e41108c048ff17e6d85f4f2fbf5d0489ccdf1b1aa0a
MD5 ad967a7c9b379ee2adbc4b9e647e384c
BLAKE2b-256 8b14018f586a58d451454d167539c9d4a7049652f126866df95927c7795b762d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a4-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.0a4-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 78fc70ebca04d5144a938e5acce7b902ec4b3359d7cbb68ed7a5f6baa640d327
MD5 1dba4edd684c5997f0a057ea010fd2e7
BLAKE2b-256 ad28603630ba1c3994799305051fed9db30db92fb3b2a23321722c06b545eafa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a4-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.0a4-py3-none-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 d23674197fb40e46391a33c5f8e5466f403c4a49bb4f9c921f7d979b41d86d65
MD5 194c0483729ee173f04d321745a9fb0e
BLAKE2b-256 6750bc773b36c6e7cdfbddcbda4b24dabc625fbf650eb0e857f069f890e46b56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a4-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.0a4-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f52f4d9e4368485cb30493a04754ee7f08042dde3beac53df362c03dd7a07e71
MD5 0fa5659349e1a30ac1eb8a48474837c1
BLAKE2b-256 05dd6ccf4d260a030be8e31af7acf9e93a6b7923887e0861029e865d45c99c17

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