How marlinfirmware/marlin works
Marlin is configurable 3D-printer firmware for multiple hardware platforms. The principal workflow is host commands entering firmware, being planned as coordinated motion, and executed through board-specific hardware; thermal control is another runtime domain. The README documents the shared HAL and support for up to nine axes and eight extruders. The supplied excerpts do not show the main command-processing or motion call chain, so those relationships are marked unverified. The graph also includes documented hardware abstraction and visible storage/UI and USB-storage subsystems; unsampled subsystem details are represented cautiously.
Main entry points: MarlinCore.h Firmware core · planner.h Motion planning · temperature.h Thermal control · extui LCD interfaces
Components 19
Printer runtime
- Firmware core
Marlin/src/MarlinCore.h - Motion planning
Marlin/src/module/planner.h - Axis state
Marlin/src/module/motion.h - Stepper execution
Marlin/src/module/stepper.h - Thermal control
Marlin/src/module/temperature.h - Thermistor tables
Marlin/src/module/thermistor/thermistors.h - Machine configuration
Marlin/Configuration.h - Advanced configuration
Marlin/Configuration_adv.h
Hardware abstraction
- Common HAL API
Marlin/src/HAL/HAL.h - Platform HALs
Marlin/src/HAL - Controller fan
Marlin/src/feature/controllerfan.cpp
User interfaces
- LCD interfaces
Marlin/src/lcd/extui - Web UI
buildroot/web-ui/data/www/webmarlin.js
Removable and flash storage
- USB host storage
Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp - UHS bulk storage
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h - SD storage
Marlin/src/sd/storage.h - Touch UI flash
Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp - MKS flash storage
Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp
Other components
- Command host
Connections 17
- Command host → Firmware core: sends commands
- Firmware core → Motion planning: dispatches motion
- Motion planning → Axis state: uses axis state
- Motion planning → Stepper execution: plans steps
Marlin/src/module/stepper.h - Firmware core → Thermal control: controls temperatures
- Thermal control → Thermistor tables: uses tables
Marlin/src/module/temperature.h - Firmware core → Common HAL API: uses HAL
README.md - Common HAL API → Platform HALs: abstracts platforms
README.md - Controller fan → Thermal control: reads temperatures
Marlin/src/feature/controllerfan.cpp - Machine configuration → Firmware core: configures
- Advanced configuration → Firmware core: configures
- LCD interfaces → Firmware core: provides UI
- Web UI → Firmware core: interfaces with
- UHS bulk storage → USB host storage: alternative implementation
- USB host storage → SD storage: provides USB storage
- Touch UI flash → LCD interfaces: stores UI data
Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp - MKS flash storage → LCD interfaces: stores UI data
Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp