Skip to main content
Associate II
August 21, 2026
Question

TMC2209 driver for STM32 — looking for feedback

  • August 21, 2026
  • 0 replies
  • 12 views

I’ve been working on a small TMC2209 driver for STM32F4 using bare-metal/CMSIS, without HAL.

The driver currently supports:

  • UART half-duplex through function pointers

  • TMC2209 register read/write

  • CRC calculation

  • GCONF configuration

  • IHOLD/IRUN current control

  • CHOPCONF configuration

  • Microstep configuration

  • Direction control

  • Enable/disable

  • VACTUAL for testing

  • Current calculation from mA to the TMC2209 CS value

The motor is working correctly, and I’m now mostly interested in feedback on the driver architecture, API design, abstraction and code quality.

This is a learning project, so I’d really appreciate honest criticism and suggestions from more experienced embedded developers.

What would you improve or change in this driver?

https://github.com/embeddedrafo/tmc2209_driver