#peripheral-access-crate #gpio #interrupt

stm32-metapac

Peripheral Access Crate (PAC) for all STM32 chips, including metadata

21 major breaking releases

Uses new Rust 2024

21.0.0 Mar 20, 2026
20.0.0 Mar 12, 2026
19.0.0 Jan 4, 2026
18.0.0 Aug 25, 2025
0.0.0 Jun 15, 2021

#1505 in Embedded development

Download history 9077/week @ 2025-12-28 13048/week @ 2026-01-04 14950/week @ 2026-01-11 13961/week @ 2026-01-18 14122/week @ 2026-01-25 11962/week @ 2026-02-01 10460/week @ 2026-02-08 10407/week @ 2026-02-15 11293/week @ 2026-02-22 11541/week @ 2026-03-01 12137/week @ 2026-03-08 10114/week @ 2026-03-15 12766/week @ 2026-03-22 12603/week @ 2026-03-29 11642/week @ 2026-04-05 12852/week @ 2026-04-12

50,928 downloads per month
Used in 37 crates (4 directly)

MIT/Apache

240MB
8M SLoC

stm32-metapac

This is a Peripheral Access Crate for STMicroelectronics STM32 microcontrollers.

This crate has been automatically generated based on data in the stm32-data project, and is used for the embassy-stm32 Rust Hardware Abstraction Layer (HAL) for the STM32 microcontrollers.

Metadata

This PAC additionally exports "metadata" about the chips. To use it, enable the metadata feature and access it at stm32_metapac::METADATA. It is intended to be consumed from build.rs scripts or code-generation tools running on PCs, not from the firmware itself.

The metadata includes the following info:

  • Memory maps for RAM, flash.
  • Interrupts
  • GPIO Alternate Function mappings
  • Interrupt -> peripheral mappings
  • DMA channel -> peripehral mappings
  • RCC clock tree information for each peripheral (what clocks does it receive, which RCC registers to poke to enable, reset, or choose the clock)

Supported chips

This PAC aims to support all STM32 chip families:

  • STM32F0
  • STM32F1
  • STM32F2
  • STM32F3
  • STM32F4
  • STM32F7
  • STM32C0
  • STM32G0
  • STM32G4
  • STM32H5
  • STM32H7
  • STM32H7RS
  • STM32L0
  • STM32L1
  • STM32L4
  • STM32L5
  • STM32U0
  • STM32U5
  • STM32WB
  • STM32WBA
  • STM32WL

Dependencies