How atessahin/stm32-flight-controller-freertos works
This firmware polls motion and barometric data, estimates attitude, and displays telemetry on an STM32F4. The documented runtime is a high-priority 250 Hz sensor task feeding a fusion task and then a slower display task; main.c creates those tasks and their queues. Source paths identify a BMP280 driver, while the README calls the barometer BME280, so the graph uses the implementation’s name. The sampled excerpts do not show all task timing and filtering details; those documented capabilities are represented at the task level.
Main entry points: main.c Task orchestration · i2c_bus.c Bare-metal I2C · mpu6050.c MPU6050 driver · bmp280.c BMP280 driver
Components 18
Runtime workflow
- Task orchestration
Core/Src/main.c - Sensor task
Core/Src/main.c - Raw data queue
Core/Src/main.c - Fusion task
Core/Src/main.c - Attitude estimation
Core/Src/flight_core.c - Display queue
Core/Src/main.c
Sensor acquisition
- MPU6050 driver
Core/Src/drivers/mpu6050.c - BMP280 driver
Core/Src/drivers/bmp280.c
Board and bus
- Bare-metal I2C
Core/Src/drivers/i2c_bus.c - I2C mutex
Core/Src/main.c - Board initialization
Core/Src/board/board_init.c - Clock configuration
Core/Src/board/system_clock.c
Telemetry output
- Display task
Core/Src/main.c - SSD1306 driver
Core/Src/ssd1306.c
Other components
- Flight controller user
- MPU6050 IMU
- BMP280 barometer
- OLED screen
Connections 25
- Flight controller user → Task orchestration: starts firmware
- Task orchestration → Board initialization: initializes board
- Board initialization → Clock configuration: configures clock
- Task orchestration → Sensor task: creates task
- Task orchestration → Fusion task: creates task
- Task orchestration → Display task: creates task
- Task orchestration → Raw data queue: creates queue
- Task orchestration → Display queue: creates queue
- Task orchestration → I2C mutex: creates mutex
- Sensor task → I2C mutex: locks bus
- Display task → I2C mutex: locks bus
- Sensor task → MPU6050 driver: reads motion
- Sensor task → BMP280 driver: reads altitude
- MPU6050 driver → Bare-metal I2C: reads registers
- BMP280 driver → Bare-metal I2C: reads registers
- Bare-metal I2C → MPU6050 IMU: communicates
- Bare-metal I2C → BMP280 barometer: communicates
- Sensor task → Raw data queue: sends samples
- Raw data queue → Fusion task: delivers samples
- Fusion task → Attitude estimation: updates attitude
- Fusion task → Display queue: sends estimate
- Display queue → Display task: delivers telemetry
- Display task → SSD1306 driver: renders telemetry
- SSD1306 driver → Bare-metal I2C: writes display
- Bare-metal I2C → OLED screen: communicates