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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymcu_arm-0.1.0a5-py3-none-win_arm64.whl.
File metadata
- Download URL: pymcu_arm-0.1.0a5-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.5 {"installer":{"name":"uv","version":"0.12.5","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65bbc0836e472aa7d2e9c8f385b1083e744f7f115cfc3fd5f57ae611c359b83b
|
|
| MD5 |
92ba159f03383f1e5f5ea6f0ddc02eda
|
|
| BLAKE2b-256 |
104910c6cd521feee8252b945d6d504e628e2585bd6e010e02eef2a7985994e8
|
File details
Details for the file pymcu_arm-0.1.0a5-py3-none-win_amd64.whl.
File metadata
- Download URL: pymcu_arm-0.1.0a5-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.5 {"installer":{"name":"uv","version":"0.12.5","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e91078550d07e9ba21207d3a2560b1303dadb1ba29d3254e0c08e95cc26ef6dd
|
|
| MD5 |
78c410e317a189a3569ae1bc7a3dfbbf
|
|
| BLAKE2b-256 |
2e23ec6d37cc7dc09d781d951399b54bb1aea1de519272460d27bbc7c9b7ba35
|
File details
Details for the file pymcu_arm-0.1.0a5-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pymcu_arm-0.1.0a5-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.5 {"installer":{"name":"uv","version":"0.12.5","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfed05f26e956bc758c713afaa469c4a112b06023eca22fd787bd0a49adb066b
|
|
| MD5 |
7046da4a9a6b9c32a535e7ef481a089e
|
|
| BLAKE2b-256 |
328d6b43fdc12667352754429bdc6004356ca66414d72494aa189aa68fc2b30a
|
File details
Details for the file pymcu_arm-0.1.0a5-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pymcu_arm-0.1.0a5-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.5 {"installer":{"name":"uv","version":"0.12.5","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d7cb5d599da1b441de454cf68ad302bf74afd726a545ea9d8f2861b2b202f7c
|
|
| MD5 |
f7590d889e970d28601a996885a479c3
|
|
| BLAKE2b-256 |
202f44a24be1ecbdaefcb9471c2a1631448d30f7036068674badb52938c71804
|
File details
Details for the file pymcu_arm-0.1.0a5-py3-none-macosx_26_0_arm64.whl.
File metadata
- Download URL: pymcu_arm-0.1.0a5-py3-none-macosx_26_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a1a104f86f90c379f859593d771a9bff9dd32b188185bc8e565d86276b0cef8
|
|
| MD5 |
b31fe3fe192c50c03d79a3f32c7f999e
|
|
| BLAKE2b-256 |
6b23a84994d7ad20f44835958e131efefee5a1a1f95a05bfec39267d93f7e8fa
|
File details
Details for the file pymcu_arm-0.1.0a5-py3-none-macosx_13_0_x86_64.whl.
File metadata
- Download URL: pymcu_arm-0.1.0a5-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.5 {"installer":{"name":"uv","version":"0.12.5","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0490333f825cd067f1ae3f6996d8bd7e176207a5a48ace8e7c5424d32c91e646
|
|
| MD5 |
2a0bed7f746c0301720bef3734833b44
|
|
| BLAKE2b-256 |
22e719fd1cd7f411f3efa53a7951054fe539f93c7a5daae08735cd2472bd1cf0
|