In Klipper, once a [board_pins]
is defined, the aliases are used in all sections to make them more readable (official board_pins Klipper documentation). I use this mechanism extensively on a two-level model to add genericity and simplify the MCU configuration for everyone.
Klippain is designed using a two-level [board_pins] model:
- First level: Some rules and pin naming conventions (let's call them "Frix-x names") were defined and used in all config files. Then a set of user board_pins templates were created for the most common MCUs of the market. This is basically what you need to put in your
mcu.cfg
file. - Second level: Since it's always a pain to retrieve the pin names from the boards manufacturer's documentation like
PA12
orgpio23
(let's call them "controller names"), I added a second layer of [board_pins] to link some "easy to retrieve names" (ie. what's printed on the MCU boards around the ports and easy to read with "MCU_" as a prefix) to these "controller names". This second layer of board_pins is located in this folder and is not intended to be modified.
To summarize, we have two board_pins used for each MCU. One user board_pins and one manufacturer board_pins. They link the following:
Frix-x names -> Manufacturer (PCB print) names > controller names
So in order to populate your own mcu.cfg
file, just copy one of the user template into it. Then feel free to change the wiring to your liking. For example, if you have wired your part fan to port FAN3
instead of FAN0
, just change the definition to PART_FAN=MCU_FAN3
and that's it!
Info:
Klipper does not allow
[board_pins]
sections to contain pin modifiers such as!
,^
and~
. Moreover, when configuring multiple MCUs at the same time, all the aliases used in the hardware sections must be prefixed with the MCU name. This is a current limitation of Klipper and is why you need to use the overrides.cfg file to add them.
If you want to use a new MCU that is not yet supported in my config, you just have to define a new [board_pins] in your mcu.cfg
file and use the same convention. Also feel free to also add a manufacturer board_pins to my config and submit a PR: I'll be happy to merge it and extend MCU support for new boards :)
Here is a list of all the "Frix-x names" available to use in your own board_pins:
[EXYZ1-3]_STEP
: drivers step pins[EXYZ1-3]_DIR
: drivers dir pins[EXYZ1-3]_ENABLE
: drivers enable pins[EXYZ1-3]_TMCUART
: drivers UART pinsDRIVER_SPI_MOSI
,DRIVER_SPI_MISO
,DRIVER_SPI_SCK
: used in case of SPI drivers- Beside standard axis there is also the support for the
MMU_GEAR_...
andMMU_SEL_...
drivers used in the MMU/ERCF/TRADRACK
[XYZ]_STOP
: classic axis endstops pinsPROBE_INPUT
: classical probe input like Klicky, Omron, Pinda, TAP, etc...MMU_SEL_ENDSTOP
: for the MMU/ERCF physical selector endstop
E_HEATER
: hotend heater cartridgeBED_HEATER
: bed heating pad (or bed SSR)
E_TEMPERATURE
: hotend temperature sensorBED_TEMPERATURE
: bed temperature sensorCHAMBER_TEMPERATURE
: chamber temperature sensor (used to heatsoak the chamber during the START_PRINT sequence)ELECTRICAL_CABINET_TEMPERATURE
: electrical cabinet temperature sensor (not really used in the config, but if present, this sensor is added to the Mainsail / Fluidd web interface as an additional info)
E_FAN
: hotend fan. This fan should stay at 100% whenever the hotend is hot, so a PWM capable pin is not mandatoryE_FAN_TACHO
: tachometer of the hotend fan, optional and used to validate that the fan is spinning as a safety featurePART_FAN
: part fan used during the print. This pin should be a PWM capable pin to allow modulation of the fan speedPART_FAN_TACHO
: tachometer of the part fan, optional and used to validate that the fan is spinning as a safety featureEXHAUST_FAN
: for an exhaust filter (such as the Voron basic exhaust). This pin should be a PWM capable pin to allow modulation of the fan speedFILTER_FAN
: for a filter (such as a Nevermore filter). This pin should be a PWM capable pin to allow modulation of the fan speedCONTROLLER_FAN
: to cool down your MCUs or electronic bayHOST_CONTROLLER_FAN
: to cool down your Pi (or equivalent Klipper host controller)
LIGHT_OUTPUT
: simple chamber lights (such as 24v leds or 24v fcob light bars)LIGHT_NEOPIXEL
: neopixels chamber lightsSTATUS_NEOPIXEL
: toolhead/machine status led neopixels (such as the one used on the Voron StealthBurner toolhead)MMU_NEOPIXEL
: for the specific MMU/ERCF neopixel leds
RUNOUT_SENSOR
: filament runout sensor (currently only one motion or switch sensor is supported in Klippain)MMU_ENCODER
: filament motion sensor used in the MMU/ERCF carriageTOOLHEAD_SENSOR
: optional toolhead filament sensor used for the MMU/ERCF/TRADRACKSERVO_PIN
: for a mechanical and movable probe dock or brush (such as the ones that are commonly found on the Voron V0 mods)MMU_SERVO
: for the MMU servoMMU_GATE_SENSOR
: for the MMU/TRADRACK gate sensorMMU_PRE_GATE_[0-11]
: for the MMU/ERCT sensors
For more information on the boards and pinouts, please see directly the manufacturers website or github: