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

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 26.0+ ARM64

pymcu_arm-0.1.0a3.post0-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.post0-py3-none-win_arm64.whl.

File metadata

  • Download URL: pymcu_arm-0.1.0a3.post0-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.post0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 b4699af60cee2c7ed88552236d6f917c2558d7abd23441e5dbb5d7283e8720da
MD5 b4278e30257da6759f61d7bc0118cb14
BLAKE2b-256 47c4625d718351b9b6f2fb39f7ad831b9937e54218358c887a8dd856d8f11294

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a3.post0-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.post0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 fdcda85ba73f4d2a12cad0062fcfe63d2ed1b5e1584a4afbbebff05206c8593e
MD5 5c0d01329d7bfa4f69885c976078b129
BLAKE2b-256 b9005fe15cebcdc837dd66810114d835d2a0ac163e6515ad1152baa1910e789e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a3.post0-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.post0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bf7bc467817c8adb1fd7138df8eea1fe8bac492c54db54d97154b69a92eb1902
MD5 1f7fc29188497a7d5e2a19587590c14f
BLAKE2b-256 58c1f7c3aab399c5d16ecbf356c1ce55c05e39b79616b59c56bdda1b4d845f56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a3.post0-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.post0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 11a42fb3f771117b1267fbd8c8375b26e246c437acf4de0dfb6f92ac5b4c5abf
MD5 c2aec4fb6e7fc27619b3522093841335
BLAKE2b-256 5d086774fedbf770cd88d0593c7ef81fe1c1a63d64d81307d558f3bfe6558ca5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a3.post0-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.post0-py3-none-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 c3dd7b9687957146b7e41c8498b2466deb5593f443c63b0b7e321d40d05a3ad1
MD5 fd061665af5d654813665792519a768f
BLAKE2b-256 a6241af46022181a2451d6cd9959b2c16b6e665bcd8d518db12f4c045f3935ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymcu_arm-0.1.0a3.post0-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.post0-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 2838cd053ba736b74041451b21b4521eac5b1b69039b7a124e8c83a14842417c
MD5 bd237a85cb0536236e23f33f43cff678
BLAKE2b-256 0f5e66957d8133b3f97bbd15da4a00b921c4b3b365008424a1838b653e0baed2

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