This repository contains the firmware for a rotary controller board based on the STM32F411 microcontroller (github.com). It provides Digital Read Out (DRO) and single-axis control for CNC-style rotary tables.
🛒 Purchase all boards from our shop: Provvedo Shop
- Utilizes STM32CubeMX for hardware configuration (.ioc file included)
- Modular firmware structure with FreeRTOS support
- Supports ST‑Link V2 and Raspberry Pi + OpenOCD programming
- Optimized for high-speed encoder + stepper motor control
- CMake & C/C++ toolchain (e.g.
arm-none-eabi-gcc
,make
) - ST-Link v2 or Raspberry Pi with OpenOCD
git clone https://github.com/bartei/rotary-controller-f4.git
cd rotary-controller-f4
cmake -DCMAKE_BUILD_TYPE=Release .
make -j$(nproc)
make clean
-
ST‑Link V2:
st-flash --format ihex write rotary-controller-f4.hex
-
Raspberry Pi + OpenOCD:
openocd -f ./raspberry.cfg
The default
raspberry.cfg
configures SWD over GPIO pins 24/25 + GND. Ensure GND wiring is the same length as SWCLK/SWDIO for reliability. Modify the GPIO pins inraspberry.cfg
if needed.
.ioc
file for use with STM32CubeMX included- Pin assignments for encoder, buttons, LEDs, SWD, etc. reviewed and tested
- Memory layout defined by
STM32F411CEUX_FLASH.ld
andSTM32F411CEUX_RAM.ld
Firmware integrates with hardware design available at:
- PCB repo: bartei/rotary-controller-pcb — includes Proteus schematic, BOM (with pricing), and fab files; KiCad version in progress (github.com, github.com, github.com)
Together, they form a complete controller + UI system when paired with:
rotary-controller-python
— a Raspberry Pi Kivy-based DRO + control UI
- Works as a single-axis rotary DRO
- FreeRTOS scheduler handles encoder sampling loop
- GPIO/button routines support nudge and rotary button functions
- SWD pins must be appropriately wired and matched in length
- Firmware repo
- PCB repo (Proteus/KiCad)
- Raspberry Pi UI with Kivy
- Join the community on Discord
- Test hardware interface in CubeMX; verify pin assignments
- Build and flash firmware, connect to DRO UI app
- Utilize FreeRTOS for real-time sampling and control
- Contribute improvements — e.g. KiCad support, UI features, multi-axis
Need help? Join our Discord community for support, discussions, and updates.
Let me know if you'd like additions like block diagrams, pinout tables, or usage screenshots!