How bitcraze/crazyflie-firmware works
Project type and purpose
• This is the Crazyflie firmware: a low-level, embedded C codebase running on an STM32 microcontroller. It implements real-time flight control, sensor fusion, communication stacks and a plug-in “deck” hardware abstraction for modular sensor/deck expansions.
File structure
• Top-level layers:
• src/ (core firmware: init, RTOS glue, system startup)
• hal/ (hardware abstraction layer for MCU peripherals)
• drivers/ (concrete drivers for sensors, radios, decks)
• modules/ (high-level services: estimators, controllers, CRTP/CPX comms, supervisor state machine)
• app_api/ (application API, sample apps)
• bindings/ (Python/CFFI bindings)
• lib/ (third-party libraries: CMSIS, FatFS, USB stacks)
• platform/ (platform-specific configurations and porting)
• utils/ (utility code: math, Kalman engines, data structures)
• tests/ and test_python/ (unit and integration tests)
• tools/ (build, flash, docs generation, system-ID, logging, debugging scripts)
README for additional insights
• Confirms it’s firmware for multi-platform Crazyflie drones, built with Make/Kbuild, configured with Kconfig, tested via C unit tests and Python tests, and extensible through “deck” APIs and Python bindings.
Essential architectural elements
• Don’t over-decompose; focus on the major layers and extension points (decks, bindings).
• Key boundaries are shown: hardware boundary, RTOS boundary, API boundary, build/test boundary.
• Document any configuration systems (Kconfig) and plug-in mechanisms (Kbuild).
• Review with domain experts to confirm that critical interactions (e.g., sensor → Kalman → controller → motor PWM) are clearly visible.