These Marlin commands are mostly what a host program sends over the serial line: line numbering, status reports, messages, safety stops and settings of the link. A few remaining commands for particular hardware are at the end.
M110: line number
M110 Nline sets the number of the last line, and the
last N on the line is the one applied, so N100 M110,
M110 N100 and N101 M110 N100 are all valid. Each later
numbered line must be one higher, or it is ignored and a resend asked for.
Since 2.1.3 M110 alone reports the last line processed, as
Line: 1297.
M111: debug flags
S flags is the sum of the bits wanted.
| Value | Name | Effect |
|---|---|---|
| 1 | ECHO | Echo every command given to the parser |
| 2 | INFO | Extra information messages |
| 4 | ERRORS | Extra error messages |
| 8 | DRYRUN | No extrusion, no saving of levelling data and the like |
| 16 | COMMUNICATION | Not used at present |
| 32 | LEVELING | Detail on homing, probing and levelling, with DEBUG_LEVELING_FEATURE |
| 64, 128 | Reserved | For later use |
M111 S8 ; dry run
M111 S0 ; extra output off
M112, M120, M121 and M400: stopping, endstops and waiting
| Command | Meaning |
|---|---|
M112 | Halt at once: steppers and heaters off, and the power supply if possible; a reset is needed afterwards. It may wait for room in the command queue unless EMERGENCY_PARSER is on. The documentation warns that it is not a safety rated emergency stop |
M120 | Enable endstops and keep them enabled outside homing |
M121 | Disable them and keep them disabled outside homing |
M400 | Wait until every planned move has finished |
None of these takes parameters.
M400
M300 S440 P100 ; beep once the moves are done
M114 and M154: position
M114 reports where the active tool was last told to go, with the
stepper counts:
X:0.00 Y:127.00 Z:145.00 E:0.00 Count X: 0 Y:10160 Z:116000
ok
M114 parameter | Meaning |
|---|---|
R | With M114_REALTIME: the position taken from the steppers at that moment |
D | With M114_DETAIL: detailed report |
E | With M114_DETAIL: the E stepper position |
With M114_LEGACY the planner is synchronised before reporting.
M154 Sseconds, since 2.0.8.1 with
AUTO_REPORT_POSITION, sends the position at that interval without
polling; S0 stops it.
M115: firmware and capabilities
Without parameters it prints one line of identification:
FIRMWARE_NAME:Marlin 2.1.3 (Aug 1 2024 12:00:00) SOURCE_CODE_URL:github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:3D Printer KINEMATICS:Cartesian EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff
With EXTENDED_CAPABILITIES_REPORT lines of the form
Cap:NAME:0 or 1 follow, such as
Cap:EEPROM:1. The documented names are
SERIAL_XON_XOFF, BINARY_FILE_TRANSFER,
EEPROM, VOLUMETRIC, AUTOREPORT_POS,
AUTOREPORT_TEMP, PROGRESS, PRINT_JOB,
AUTOLEVEL, RUNOUT, Z_PROBE,
LEVELING_DATA, BUILD_PERCENT,
SOFTWARE_POWER, TOGGLE_LIGHTS,
CASE_LIGHT_BRIGHTNESS, EMERGENCY_PARSER,
HOST_ACTION_COMMANDS, PROMPT_SUPPORT,
SDCARD, MULTI_VOLUME, REPEAT,
SD_WRITE, AUTOREPORT_SD_STATUS,
LONG_FILENAME, LFN_WRITE,
CUSTOM_FIRMWARE_UPLOAD, EXTENDED_M20,
THERMAL_PROTECTION, MOTION_MODES, ARCS,
BABYSTEPPING, EP_BABYSTEP,
CHAMBER_TEMPERATURE, COOLER_TEMPERATURE,
MEATPACK and CONFIG_EXPORT. Adding
M115_GEOMETRY_REPORT gives the build area, listing only the axes
the machine has:
area:{full:{min:{x:0,y:0,z:0},max:{x:200,y:200,z:200}},work:{min:{x:0,y:0,z:0},max:{x:200,y:200,z:200}}}
M117, M118 and M414: messages and language
M117 text puts the rest of the line on the display’s
status line. M118 text sends it to the host, or a blank
line without text. Its options must come before the text:
M118 parameter | Meaning |
|---|---|
A1 | Put // in front, marking a comment or an action command for the host |
E1 | Put echo: in front |
P port | 0 all ports, 1 the main one, 2 the second (SERIAL_PORT_2); the range is given as 1 to 9 |
M414 Sindex, since 2.0.8 with
LCD_LANGUAGE_2, selects one of the configured display languages,
counted from 0; it is stored in EEPROM.
M117 Hello World!
M118 E1 P0 Hello World!
M118 A1 action:cancel
M414 S2 ; third language
M113: host keepalive
With HOST_KEEPALIVE_FEATURE Marlin tells the host that it is busy
or waiting for the user during long operations. S
seconds sets the interval, 0 to 60; without it the setting is
reported.
M119: endstop states
Each endstop, the probe and any runout sensor is reported as
open or TRIGGERED; with JOYSTICK_DEBUG
the raw joystick readings too. A BLTouch and sensorless homing give only a
short pulse, so a standing TRIGGERED is unusual for them and for
the BLTouch means an error.
Reporting endstop status
x_min: open
y_min: open
z_min: TRIGGERED
z_probe: open
filament: open
M122: Trinamic driver report
Since 1.1.7, for Trinamic drivers on SPI or UART: it checks communication and
prints the settings and status of each. Replies of all 00 or all
FF bytes point to a wiring or communication fault.
TMC_DEBUG lengthens the report.
| Parameter | Meaning |
|---|---|
X, Y, Z, E | Only those drivers |
I | Since 2.0.6: initialise the drivers again with the current settings, for instance after they were powered late |
V | With TMC_DEBUG: raw register data, to be read with the datasheet |
S 0/1 | With TMC_DEBUG and MONITOR_DRIVER_STATUS: continuous reporting off or on |
P ms | Same options: interval of the continuous reports |
M575 and M485: serial ports
M575, since 2.0.0 with BAUD_RATE_GCODE, changes the
speed. It breaks off communication and may reset the firmware when the host
reconnects.
M575 parameter | Meaning |
|---|---|
B baud | Required: 2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000 or 1000000. Since 2.0.6.1 also short forms: 24, 96, 19 or 192, 38 or 384, 57 or 576, 115 or 1152, 250, 500 |
P port | Port index; all ports if omitted |
M485, since 2.1.3 with RS485_SERIAL_PORT, sends bytes
written as pairs of hexadecimal digits, at most 32 bytes. Packets received
earlier are discarded and reported as rs485-unexpected-packet:. The
answer comes as rs485-reply: followed by hexadecimal; without one,
rs485-timeout is printed from M485_PROTOCOL 2 and
rs485-reply: TIMEOUT with protocol 1. A string with an odd number
of digits, too long or not hexadecimal is rejected, and a failed write is
reported with its reason.
M575 P0 B115200
M485 0A1B2C
M486: cancel objects
With CANCEL_OBJECTS one object on the bed can be abandoned while
the others go on. Objects are numbered from 0, and the file must mark where
each begins.
| Parameter | Meaning |
|---|---|
T count | Reset and give the number of objects |
S index | The commands that follow belong to this object, and are skipped if it is cancelled; -1 marks material that is no object and is never skipped |
P index | Cancel that object |
C | Cancel the current object |
U index | Take back a cancellation; no effect on an object already skipped |
M486 T12 ; twelve objects
M486 S3 ; object 3 follows
M486 S-1 ; not part of an object
M486 P10 ; cancel object 10
M293 and M294: single babysteps
Since 2.1.3 with EP_BABYSTEPPING: M293 moves Z up and
M294 down by one babystep, with no parameters. With
EMERGENCY_PARSER they act as they arrive, ahead of queued moves.
Direction follows BABYSTEP_INVERT_Z. Endstops are not checked and
the reported position does not change. For a chosen distance use
M290.
M125: park the head
With PARK_HEAD_ON_PAUSE the position is saved and the nozzle moves
to the park point.
| Parameter | Meaning |
|---|---|
L length | Retraction, default PAUSE_PARK_RETRACT_LENGTH |
X, Y position | Park position, default from NOZZLE_PARK_POINT |
Z raise | Z raise before parking, default from NOZZLE_PARK_POINT |
P 0/1 | With a display menu: always show a prompt and wait for an answer |
M125 L20 ; retract 20 and park
M100 and M430: memory and power
| Command | Parameters | Meaning |
|---|---|---|
M100 | I: initialise the watched free memory and print its figures; F: report free bytes and figures; D: dump the free block up to the stack pointer; C n: corrupt n locations on purpose and report them | With M100_FREE_MEMORY_WATCHER, for development |
M430 | I, V, W 0/1: show current, voltage and power on the display | With POWER_MONITOR_CURRENT or POWER_MONITOR_VOLTAGE; alone, report amps, volts and watts |
M430 I1 V1 W1
M102, M126 to M129 and M360 to M364: particular hardware
| Command | Parameters | Meaning |
|---|---|---|
M102 | S value: -6 start calibration, -5 read raw calibration data, -1 read sensor information, 0 switch height adjustment off, above 0 the height in tenths of a millimetre below which Z is adjusted | Since 2.1.1, with BD_SENSOR: the Bed Distance Sensor; M102 S4 adjusts at Z up to 0.4 mm |
M126, M128 | S pressure | With BARICUDA: open the valve of paste extruder 1 or 2 |
M127, M129 | None | Close that valve |
M360 | None | With MORGAN_SCARA: move to calibration position Theta 0 (A0 B120) |
M361 | None | Theta 90 (A90 B130) |
M362 | None | Psi 0 (A60 B180) |
M363 | None | Psi 90 (A50 B90) |
M364 | None | Theta to Psi 90 (A45 B135) |
Sources
- MarlinDocumentation – Marlin’s own documentation source, the files in
docs/gcode/for the commands on this page, as of 3 December 2026