modm-io /modm
modm: a C++23 library generator for AVR and ARM Cortex-M devices
★ 1,000⑂ 180👁 38⑃ 975● 311▤ 23
+0
Daily
1,000
stars
180
forks
38
watchers
975
prs
311
issues
23
releases
README
modm: a barebone embedded library generator
modm (pronounced like dial-up "modem") is a toolbox for
building custom C++23 libraries tailored to your embedded device.
modm generates startup code, HALs and their implementations, communication
protocols, drivers for external devices, and BSPs in a modular, customizable
process that you can fine-tune to your needs.
- This project has a homepage.
- [Install the toolchain][install] and [explore our examples][examples].
- You can [discover the modm library][discover] in more detail.
- Easily start your [own completely custom project][custom-project].
- Our CI checks every contribution for regressions.
- We care [about testing modm][testing].
- [API reference is available here][api-docs].
- [We do quarterly releases][releases] with a [curated changelog][changelog].
This project also has a [forum for discussions][discussions] and a
[technical blog][blog] to document larger design concepts.
- You found a bug? [Open up an issue, we don't bite][issues].
- You have a question? [We probably have an answer][questions].
- You require a feature? [Write it down to get things rolling][ideas].
- You want to contribute? [Read the contribution guidelines][contrib] and [open a pull request][prs].
modm is optimized for the harsh requirements of the [Eurobot competition][eurobot],
where our robots need to run reliably and completely autonomously for the game's
100 second duration. Our robots contain a lot of different microcontrollers, some
without a lot of resources, so modm needs to fulfill a diverse set of objectives,
like small code size with small memory consumption, predictable program flow,
extreme portability.
The library source code is licensed as MPLv2 with any external source code under
compatible licenses (BSD, Apache2, MIT). So feel free to fork this project and
adapt it to your needs. The only thing we ask of you is to contribute your changes
back so everyone can benefit.
Please clone modm recursively, you need all the submodules:
sh
git clone --recurse-submodules --jobs 8 https://github.com/modm-io/modm.git
Features
- Efficient and fast object-oriented C++23 API.
- Support for thousands of AVR and ARM Cortex-M microcontrollers from Microchip, STMicroelectronics and Raspberry Pi.
- Build system agnostic: Choose SCons, CMake, Makefile or use your own.
- Modular, data-driven, target-specific HAL generation using the lbuild code generator.
- No memory allocations in HAL with very low overall RAM consumption.
- Highly configurable modules with sensible defaults and lots of documentation.
- Cross-platform peripheral interfaces incl. bit banging:
- GPIO, External Interrupt and IO expanders.
- ADC, DAC and Comparators.
- UART, I2C, SPI, CAN and Ethernet.
- Interfaces and drivers for many external I2C and SPI sensors and devices.
- Debug/logging system with IOStream and printf interface.
- Cooperative, stackful fibers and scheduler.
- Functional (partial) libstdc++ implementation for AVTop issues
#285Changing board configuration leaves behind unnecessary files, even after "lbuild clean"20 comments · 2019-09-10#1160Linker issues with newlib version 4.4.0 5 comments · 2024-05-03#1079OpenOCD cannot configure TPIU/SWO on STM32H75 comments · 2023-09-13#488Macro/global struct conflicts from CMSIS3 comments · 2020-10-05#1304Fiber causes errors with Ozone2 comments · 2025-12-04#1276CMake project generates incorrect DWARF source paths2 comments · 2025-07-06#1103lbuild fails when relative paths are on different Windows drives2 comments · 2023-12-04#1178CAN messages set to extended by default in only one constructor1 comments · 2024-07-06
Discussions
#1368J-link session teardown breaks modm::delay/DWT->CYCCNT2 comments · 2026-07-19#1367adc support for STM32H51 comments · 2026-07-16#1364Linker errors1 comments · 2026-07-06#1346Problems with examples and timings3 comments · 2026-03-16#1316Support for ADC oversampling with stm32h72 comments · 2026-01-06#1292Going for more standard C++ on AVR2 comments · 2025-09-16#1286Use with ThreadX - SysTick conflict1 comments · 2025-08-18#1272Fixes of multiple releated problems in one pull request?1 comments · 2025-06-22
Latest release
2026q3 release 2026q3 2026-10-01This release covers everything from 2026-07-01 and has been tested with avr-gcc v14.2.0 from upstream and arm-none-eabi-gcc v14.2.1 from xpack. Breaking changes: modm::math::crc8_ccitt discarded the MSB of every input byte on non-AVR targets and now computes the correct CRC. This changes the AMNB header CRCs on the wire, so AMNB nodes must be updated together. Features: - RP2040 PIO driver with compile-time assembler. - RP2040 flash driver. - STM32H7 flash driver with single and dual bank support. - CMSIS-DAPv2 integration to turn any USB-capable board into a debug probe. -