This page gives the commands of Prusa-Firmware, Prusa Research’s Marlin
descendant for its 8-bit printers (the i3 MK2.5 and MK3 families, on the
MK3 branch of the repository), as described by the documentation
comments and code of Marlin_main.cpp read on 3 December 2026. Many
commands are compiled in only for some models or build options. The newer 32-bit
printers run a different firmware,
Prusa-Firmware-Buddy.
G codes
| Command | Meaning and parameters |
|---|---|
G0, G1 | Move to X Y Z E at F mm/min. The two are the same. With automatic retraction on (M209), an E-only move large enough counts as a retraction or recovery and the firmware’s own is done instead |
G2, G3 | Clockwise and counter-clockwise arc to X Y Z E with centre offsets I J, at F. The source warns that mesh levelling is applied only at the end of the move, so long arcs should be avoided |
G4 | Dwell: P milliseconds or S seconds |
G10, G11 | Firmware retract and recover, as set by M207 and M208; with several extruders G10 S1 uses the swap length |
G21 | Millimetres; accepted and does nothing, as inches are not supported |
G28 | Home. X Y Z choose axes; W homes without mesh levelling when no axis is given; C calibrates the X and Y origin (MK3 and MK3S). With no parameters it homes all axes and then runs G80 |
G30 | Probe once with the sensor over the bed; at most 10 mm of travel |
G75, G76 | Print the probe temperature interpolation; calibrate the PINDA probe’s temperature drift |
G80 | Mesh bed levelling. N points per side, 3 or 7; C probe retries, 1 to 10; O return to origin (default 1); M magnet compensation, 7-point mesh only; L R F B manual corrections for the left, right, front and back of −100 to 100 µm; X Y W H corner, width and height of the printed area |
G81 | Report mesh levelling status and profile |
G86, G87 | Disable or enable the live Z adjustment correction after homing, used around calibration scripts |
G88 | Reserved; no effect |
G90, G91 | Absolute or relative positioning |
G92 | Set X Y Z E positions. Unlike some firmware, with no axis nothing is reset |
G98, G99 | Farm mode on and off (farm builds only) |
Stopping, SD card and job
| Command | Meaning and parameters |
|---|---|
M0, M1 | Wait for the user. P milliseconds or S seconds to expire; text after the code is shown on the display when no time is given |
M17 | Enable all motors |
M20 | List files between Begin file list and End file list; L long names, T timestamps as a 32-bit hexadecimal value |
M21, M22 | Mount and release the card |
M23 name | Select a file |
M24 | Start the print, or resume a paused one |
M26 | S byte position in the file, between M23 and M24 |
M27 | Report progress; P shows the full short-name path |
M28 name, M29 | Start and stop writing received lines to a file |
M30 name | Delete a file |
M31 | Report the print time as minutes and seconds |
M32 | Select and start a file; S starting byte, P marks a sub-program |
M928 name | Start logging to a file |
M72 | Report the printer state (0 not ready, 1 ready, 2 idle, 3 SD print finished, 4 host print finished, 5 SD printing, 6 host printing); S0 or S1 sets the first two, used by PrusaConnect |
M73 | Progress: P percent and R minutes left in normal mode, Q and S the same in silent mode, C and D minutes to the next change or pause in each |
M75, M76, M77 | Start, pause and stop the job timer |
M78 | Report filament used (cm) and print time (min); outside a job S and T set the stored totals |
M79 | Restart the host keep-alive timer, which enables host features while it runs; S"..." two characters, such as "PL" |
M25, M601, M125 | Pause and park: X (default 50), Y (190), Z lift (20), kept until changed or reset. S0 restores the defaults and S1 stores the values, both without pausing |
M602, M603 | Resume; stop the print |
M600 | Filament change: X Y park position, Z relative lift, E first retraction, L removal retraction, C"name" filament name to show, AUTO with the multi-material unit. Below 25 mm the head is lifted to keep clear of the print |
Temperature, fan, power and motors
| Command | Meaning and parameters |
|---|---|
M104, M140 | Set the hot end or bed target, S |
M109 | Set and wait: S and R are treated alike and both wait for heating or cooling; with neither, wait for the current target. B maximum for automatic temperature, only in builds with it |
M190 | Bed: S waits only while heating, R for heating or cooling |
M105 | Report: T: hot end actual/target, B: bed, T0: and so on per tool, @: and B@: heater power, P: PINDA probe, A: ambient |
M155 | Automatic reports every S seconds (up to 255, 0 off); C bit mask: 1 temperatures (default), 2 fans, 4 position |
M106, M107 | Part fan duty S 0 to 255 (255 if omitted); off |
M123 | Report fan speeds in RPM and PWM values, as E0:, PRN1:, E0@: and PRN1@: |
M80, M81 | Power supply on and off |
M82, M83 | Absolute or relative extrusion |
M84, M18 | Disable motors: X Y Z E choose them; S sets the idle timeout in seconds |
M85, M86 | S seconds: inactivity shutdown timer; heater safety timer; 0 disables |
M301, M304 | Hot end and bed PID: P I D |
M302 | S minimum temperature for extrusion |
M303 | PID autotune: E extruder (default 0, E-1 the bed), S target (210, or 70 for the bed), C cycles (5) |
M310 | Thermal model, see below |
M860 | Wait for the PINDA thermistor to reach S |
M861 | PINDA compensation table: ? print, ! factory values, Z zero all five, S microsteps with I index 0 to 4 |
| M310 parameter | Meaning |
|---|---|
| none | Report the settings |
S, B | 0 or 1: model enabled; beep at the warning threshold (default 1) |
I R | Resistance R in K/W at index I, 0 to 15 |
P U V C | Power (W), temperature coefficient and intercept of the power, capacitance (J/K) |
D, L | Simulation filter factor; response lag, 0 to 2160 ms |
E, W, T | Error and warning thresholds (K/s); ambient correction (K); defaults per printer variant |
A, F | Autotune capacitance and resistances; with it, force the self-test fan state 0 or 1 |
Motion settings and EEPROM
| Command | Meaning and parameters |
|---|---|
M92 | Steps per mm, X Y Z E |
M200 | Filament diameter D in mm for volumetric extrusion, T extruder |
M201, M203 | Maximum acceleration (units/s²) and maximum feed rate per axis, X Y Z E |
M204 | Accelerations: P printing, R filament only, T travel. In the old form, S sets printing and travel and then T means filament only; S selects the old form |
M205 | S minimum print feed rate, T minimum travel feed rate, B minimum segment time (µs), X Y Z E maximum jerk |
M206 | Homing offsets X Y Z |
M207 | Retraction: S length (mm), F feed rate, Z lift |
M208 | Recovery: S extra length, F feed rate |
M209 | S 1 or 0: automatic retraction |
M214 | Arc splitting: P segment length in mm (maximum and default, above 0), S minimum length, N segments between corrections, R minimum segments per arc, F segments per second; 0 disables S N R F. Rejected if S exceeds P |
M220 | Speed factor S percent; B back up the current factor, R restore it |
M221 | Extrusion factor S percent |
M350 | Microstepping: X Y Z E, B second extruder, S all axes |
M351 | Set microstep pins: S which pin, B its value, X Y Z E axes |
M500, M501, M502, M503 | Store settings in EEPROM, read them, restore defaults, report them |
M900 | Linear advance: K factor; R ratio, or W width, H height and D diameter to derive it |
M907 | Motor current: X Y Z E, B second extruder, S all |
M908 | Digital potentiometer channel P, value S |
M910 to M913 | TMC2130 drivers: initialise; set holding currents X Y Z E; set running currents; report currents |
M914, M915 | Normal or silent driver mode: P store permanently, R return to the stored mode, Q report |
M916, M917, M918 | Per axis X Y Z E: stall detection threshold; PWM amplitude offset; PWM amplitude gradient |
M850 | Print sheets: S sheet 0 to 7 (active if omitted), Z offset, L label of up to 7 letters or digits, B bed temperature, P PINDA temperature, A 1 or 0 active |
Host, display and devices
| Command | Meaning and parameters |
|---|---|
M42 | Set pin P to S (0 to 255 analogue, 0 or 1 digital) |
M44 | Reset skew and offset calibration and the sheet’s Z offset |
M45 | Skew and offset calibration; Z only the Z part; V verbosity 1, 10 or 20 where built in |
M46 | Report the address of a FlashAir card, or n/a |
M47 | Show endstops on the display (builds without TMC2130 drivers) |
M110 | Set the line number, N |
M112 | Emergency stop |
M113 | S seconds between busy messages, default 2 |
M114 | Report position |
M115 | Report firmware name and version, protocol, machine name, extruder count and capabilities. V only the version; Uversion asks the user to upgrade if that version is newer |
M117 text | Show a message |
M118 | Send text to the host: A1 prefixes //, E1 prefixes echo: |
M119, M120, M121 | Report endstops; enable and disable them |
M150 | R red, U green, B blue; only in builds with BlinkM |
M226 | Wait until pin P has state S |
M240 | Trigger a camera |
M256 | Display backlight: B bright level (default 130), D dim level (50), S mode 0 dim, 1 bright, 2 automatic, T timeout 15 to 900 s (15) |
M300 | Beep: S frequency in Hz, P milliseconds, at most 3500 |
M400 | Wait for moves to finish |
M405, M406 | Filament sensor on and off |
M420 | Report mesh levelling, as G81 |
M509 | Force the language selection screen |
M540 | S 1 or 0: abort the print when an endstop is hit |
M552 | Store the IP address, Pa.b.c.d |
M862: print checking
A print file states what it was sliced for, and the printer compares that with
itself. P checks a value; Q reports the printer’s
own.
| Command | Checks |
|---|---|
M862.1 P0.40 | Nozzle diameter in mm |
M862.2 Pcode | Numeric printer model code |
M862.3 P"MK3S" | Printer model by name |
M862.4 Pversion | Firmware version |
M862.5 Plevel | G-code level |
M862.6 | Not used; reserved for the 32-bit firmware |
Model names and codes listed in the source: MK1 100, MK2 200, MK2MM 201, MK2S 202, MK2SMM 203, MK2.5 250, MK2.5MMU2 20250, MK2.5S 252, MK2.5SMMU2S 20252, MK3 300, MK3MMU2 20300, MK3MMU3 30300, MK3S 302, MK3SMMU2S 20302 and MK3SMMU3 30302.
Filament and the multi-material unit
| Command | Meaning and parameters |
|---|---|
M403 | Tell the unit the filament type: E extruder from 0, F type |
M701 | Load: P or T unit slot from 0; L insertion length without the unit; Z lift (default 0) |
M702 | Unload: U retraction length without the unit; Z lift |
M704, M705, M706 | Preload, eject or cut the filament of slot P |
M707 | Read a unit register, hexadecimal address, as M707 A0x1b |
M708 | Write: A hexadecimal address, X 16-bit value (default 0) |
M709 | S 1 or 0 enables or disables the unit (stored); X 0 soft reset, 1 reset pin, 42 erase its EEPROM; alone, report |
Tn | Select extruder or, with the unit, filament slot T0 to T4; a load command must follow |
Tx | Ask the user for a slot and load as far as the extruder wheels; heating must follow |
Tc | Load from the extruder wheels into the nozzle |
T? | Tx followed by Tc |
PRUSA commands
Lines starting with the word PRUSA are internal commands.
| Command | Meaning |
|---|---|
PRUSA FAN | Report both fan speeds |
PRUSA uvlo | Recover from a power failure: resume an SD print, or leave a host print paused |
PRUSA MMURES | Reset the multi-material unit |
PRUSA RESET | Restart the printer |
PRUSA SN, Fir, Rev | Report serial number; firmware version; filament size, electronics and nozzle type |
PRUSA Lang, Lz, FR | Reset the language; zero the active sheet’s Z offset; full factory reset |
PRUSA MBL V0 or 1 | Switch mesh levelling without changing the logical Z position |
PRUSA nozzle | Report the nozzle diameter; nozzle D0.4 checks it; nozzle set 0.4 stores it (farm mode) |
D codes
Debugging commands; most exist only in builds that enable them. Hexadecimal
addresses and data are written in lower case, as x1fff; counts are
decimal.
| Command | Meaning and parameters |
|---|---|
D-1 | Endless loop |
D0, D1 | Reset (B into the bootloader); clear EEPROM and reset |
D2, D3, D5 | Read or write RAM, EEPROM or flash: A address, C count, X data; D5 E erases |
D4 | Pin P: F direction 0 or 1, V value |
D6, D7 | Reserved (external flash, bootloader) |
D8 | PINDA table: ? read, ! reset, P temperature, Z offset |
D9 | Analogue inputs: I channel (0 heater 0, 1 heater 1, 2 bed, 3 PINDA, 4 supply voltage, 5 ambient, 6 bed voltage), V simulated value |
D10, D12 | Mark the XYZ calibration good; time |
D20, D21, D22 | Make an offline crash dump (E as an emergency, resetting); print it; clear it |
D23 | Request an emergency dump on the serial line: E do it now, R disable it |
D70 | S 0 or 1: thermal model logging |
D80, D81 | Bed check and analysis: E F size (40), G H points (40), I J offset (74, 34) |
D106 | Print measured fan speeds for different PWM values |
D2130 | Direct access to a stepper driver chosen by X Y Z E: current off or on, steps, reading and setting registers such as the microstep resolution and wave correction, and axis calibration |
D9125 | Filament sensor chip: ? and ! print values, X Y values, L logging |
Sources
- Marlin_main.cpp – Prusa-Firmware’s command handling and documentation comments, GNU General Public Licence version 3; this page is written in our own words