# SnapMaker 2 Marlin 2 gCode Support

**URL:** <https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155>\
**Category:** Snapmaker 2.0 (3-in-1)\
**Created:** [February 6, 2020, 8:35am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155 "2020-02-06T08:35:47Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TrekLurker](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@TrekLurker](https://forum.snapmaker.com/u/TrekLurker)\
**Post date:** [February 6, 2020, 8:35am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/1 "2020-02-06T08:35:48Z")

</div>

As the title suggests, I’m hoping Jade, et. al., can provide at least the brief doc that was under development over the past year, indicating current gcode support for the SM1/SM2 series. I’d like to provide support for third-party multi-color functionality as well as some other projects under development that will expand the audience for the SM2 as its rolled out.

I know I can brute-force every command (G/M) from a terminal line; I still wont have positive confirmation for those commands with multiple optional parameters.

Any help here would be most appreciated!

---

<div class="post-metadata">

**Author:** ![JKC20](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/jkc20/32/5208_2.png) [@JKC20](https://forum.snapmaker.com/u/JKC20)\
**Post date:** [February 7, 2020, 2:00am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/2 "2020-02-07T02:00:12Z")

</div>

Hi Trek, thank you for your suggestions and we appreciate your input and here is the g-code reference file we have ready as of now for SM1. The g-code reference file for SM2 will be released in a month or two according to the plan. Sorry if the g-code reference file we have now is a bit bare boned, but we will refine it with time. Here is the link to the g-code reference file for SM1.

> **[G-code Reference for Snapmaker](https://docs.google.com/spreadsheets/d/1qDBZTEdHPO59p7PcCulKvBOAjFI-U3O2RyzXJf3Rx6Q/edit#gid=0)**
>
> Sheet1
> 
> G-code ,Format,Reply (example),Function,Parameters,Note
> G0, G1,G0 \[E\] \[F\] \[X\] \[Y\] \[Z\],ok,Linear Move,E: The length of filament to feed into the extruder between the start and end point
> F: The maximum...

---

<div class="post-metadata">

**Author:** ![DroneOn](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@DroneOn](https://forum.snapmaker.com/u/DroneOn)\
**Post date:** [February 7, 2020, 3:53am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/3 "2020-02-07T03:53:13Z")

</div>

Any timeline on releasing the Marlin 2.0 source for SM2 as required by the GPL v3 license?

Thanks

---

<div class="post-metadata">

**Author:** ![achampion](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/achampion/32/9282_2.png) [@achampion](https://forum.snapmaker.com/u/achampion)\
**Post date:** [January 29, 2021, 3:19pm UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/4 "2021-01-29T15:19:56Z")

</div>

Any update on this, looking for a Snapmaker 2 gcode reference?

---

<div class="post-metadata">

**Author:** ![xchrisd](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/xchrisd/32/1503_2.png) [@xchrisd](https://forum.snapmaker.com/u/xchrisd)\
**Post date:** [January 29, 2021, 5:55pm UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/5 "2021-01-29T17:55:50Z")

</div>

You can have a look at the source code of the firmware,

> [@FYI:Source code of Snapmaker Firmware](https://forum.snapmaker.com/t/fyi-source-code-of-snapmaker-firmware/5680/56):
>
> Snapmaker2-Modules is an all-in-one firmware for Modules of Snapmaker 2.0 3-in-1 3D Printers, it gets the Device Id of the current module from flash and then performs different business logic accordingly. Open source for modules: [GitHub - Snapmaker/Snapmaker2-Modules](https://github.com/Snapmaker/Snapmaker2-Modules) Open source for Controller: [GitHub - Snapmaker/Snapmaker2-Controller: Snapmaker2-Controller is the firmware for Snapmaker 2.0 3-in-1 3D Printers.](https://github.com/Snapmaker/Snapmaker2-Controller)

---

<div class="post-metadata">

**Author:** ![tyeth](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/tyeth/32/19314_2.png) [@tyeth](https://forum.snapmaker.com/u/tyeth)\
**Post date:** [September 16, 2021, 8:15am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/6 "2021-09-16T08:15:11Z")

</div>

@JKC20 Any update on the snapmaker2 custom gcodes, if possible can you put them in this thread as it leads here from the custom snapmaker1 gcodes via a link to your post.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Artezio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/artezio/32/15834_2.png) [@Artezio](https://forum.snapmaker.com/u/Artezio)\
**Post date:** [September 16, 2021, 9:45am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/7 "2021-09-16T09:45:28Z")

</div>

@tyeth

```auto

* "G" Codes
 *
 * G0 -> G1
 * G1 - Coordinated Movement X Y Z E
 * G2 - CW ARC
 * G3 - CCW ARC
 * G4 - Dwell S<seconds> or P<milliseconds>
 * G5 - Cubic B-spline with XYZE destination and IJPQ offsets
 * G10 - Retract filament according to settings of M207 (Requires FWRETRACT)
 * G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT)
 * G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE)
 * G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES)
 * G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES)
 * G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES)
 * G20 - Set input units to inches (Requires INCH_MODE_SUPPORT)
 * G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT)
 * G26 - Mesh Validation Pattern (Requires G26_MESH_VALIDATION)
 * G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE)
 * G28 - Home one or more axes
 * G29 - Start or continue the bed leveling probe procedure (Requires bed leveling)
 * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
 * G31 - Dock sled (Z_PROBE_SLED only)
 * G32 - Undock sled (Z_PROBE_SLED only)
 * G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
 * G34 - Z Stepper automatic alignment using probe: I<iterations> T<accuracy> A<amplification> (Requires Z_STEPPER_AUTO_ALIGN)
 * G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET)
 * G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL)
 * G80 - Cancel current motion mode (Requires GCODE_MOTION_MODES)
 * G90 - Use Absolute Coordinates
 * G91 - Use Relative Coordinates
 * G92 - Set current position to coordinates given
 *
 * "M" Codes
 *
 * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
 * M1 -> M0
 * M3 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to clockwise
 * M4 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to counter-clockwise
 * M5 - Turn laser/spindle off
 * M12 - Set up closed loop control system. (Requires EXTERNAL_CLOSED_LOOP_CONTROLLER)
 * M17 - Enable/Power all stepper motors
 * M18 - Disable all stepper motors; same as M84
 * M20 - List SD card. (Requires SDSUPPORT)
 * M21 - Init SD card. (Requires SDSUPPORT)
 * M22 - Release SD card. (Requires SDSUPPORT)
 * M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT)
 * M24 - Start/resume SD print. (Requires SDSUPPORT)
 * M25 - Pause SD print. (Requires SDSUPPORT)
 * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT)
 * M27 - Report SD print status. (Requires SDSUPPORT)
 * OR, with 'S<seconds>' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS)
 * OR, with 'C' get the current filename.
 * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
 * M29 - Stop SD write. (Requires SDSUPPORT)
 * M30 - Delete file from SD: "M30 /path/file.gco"
 * M31 - Report time since last M109 or SD card start to serial.
 * M32 - Select file and start SD print: "M32 [S<bytepos>] !/path/file.gco#". (Requires SDSUPPORT)
 * Use P to run other files as sub-programs: "M32 P !filename#"
 * The '#' is necessary when calling from within sd files, as it stops buffer prereading
 * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT)
 * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA)
 * M42 - Change pin status via gcode: M42 P<pin> S<value>. LED pin assumed if P is omitted.
 * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
 * M48 - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
 * M75 - Start the print job timer.
 * M76 - Pause the print job timer.
 * M77 - Stop the print job timer.
 * M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER)
 * M80 - Turn on Power Supply. (Requires POWER_SUPPLY > 0)
 * M81 - Turn off Power Supply. (Requires POWER_SUPPLY > 0)
 * M82 - Set E codes absolute (default).
 * M83 - Set E codes relative while in Absolute (G90) mode.
 * M84 - Disable steppers until next move, or use S<seconds> to specify an idle
 * duration after which steppers should turn off. S0 disables the timeout.
 * M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
 * M92 - Set planner.settings.axis_steps_per_mm for one or more axes.
 * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
 * M104 - Set extruder target temp.
 * M105 - Report current temperatures.
 * M106 - Set print fan speed.
 * M107 - Print fan off.
 * M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER)
 * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
 * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
 * If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
 * M110 - Set the current line number. (Used by host printing)
 * M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
 * M112 - Emergency stop.
 * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
 * M114 - Report current position.
 * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
 * M117 - Display a message on the controller screen. (Requires an LCD)
 * M118 - Display a message in the host console.
 * M119 - Report endstops status.
 * M120 - Enable endstops detection.
 * M121 - Disable endstops detection.
 * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
 * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
 * M126 - Solenoid Air Valve Open. (Requires BARICUDA)
 * M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
 * M128 - EtoP Open. (Requires BARICUDA)
 * M129 - EtoP Closed. (Requires BARICUDA)
 * M140 - Set bed target temp. S<temp>
 * M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
 * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
 * M150 - Set Status LED Color as R<red> U<green> B<blue> P<bright>. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, PCA9533, or PCA9632).
 * M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
 * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
 * M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)
 * M165 - Set the mix for the mixing extruder (and current virtual tool) with parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1)
 * M166 - Set the Gradient Mix for the mixing extruder. (Requires GRADIENT_MIX)
 * M190 - Sxxx Wait for bed current temp to reach target temp. **Waits only when heating!**
 * Rxxx Wait for bed current temp to reach target temp. **Waits for heating or cooling.**
 * M200 - Set filament diameter, D<diameter>, setting E axis units to cubic. (Use S0 to revert to linear units.)
 * M201 - Set max acceleration in units/s^2 for print moves: "M201 X<accel> Y<accel> Z<accel> E<accel>"
 * M202 - Set max acceleration in units/s^2 for travel moves: "M202 X<accel> Y<accel> Z<accel> E<accel>" **UNUSED IN MARLIN!**
 * M203 - Set maximum feedrate: "M203 X<fr> Y<fr> Z<fr> E<fr>" in units/sec.
 * M204 - Set default acceleration in units/sec^2: P<printing> R<extruder_only> T<travel>
 * M205 - Set advanced settings. Current units apply:
            S<print> T<travel> minimum speeds
            B<minimum segment time>
            X<max X jerk>, Y<max Y jerk>, Z<max Z jerk>, E<max E jerk>
 * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
 * M207 - Set Retract Length: S<length>, Feedrate: F<units/min>, and Z lift: Z<distance>. (Requires FWRETRACT)
 * M208 - Set Recover (unretract) Additional (!) Length: S<length> and Feedrate: F<units/min>. (Requires FWRETRACT)
 * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT_AUTORETRACT)
          Every normal extrude-only move will be classified as retract depending on the direction.
 * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS)
 * M217 - Set filament swap parameters: "M217 S<length> P<feedrate> R<feedrate>". (Requires SINGLENOZZLE)
 * M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
 * M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
 * M221 - Set Flow Percentage: "M221 S<percent>"
 * M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>"
 * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)
 * M250 - Set LCD contrast: "M250 C<contrast>" (0-63). (Requires LCD support)
 * M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS)
 * M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS)
 * M280 - Set servo position absolute: "M280 P<index> S<angle|µs>". (Requires servos)
 * M281 - Set servo min|max position: "M281 P<index> L<min> U<max>". (Requires EDITABLE_SERVO_ANGLES)
 * M290 - Babystepping (Requires BABYSTEPPING)
 * M300 - Play beep sound S<frequency Hz> P<duration ms>
 * M301 - Set PID parameters P I and D. (Requires PIDTEMP)
 * M302 - Allow cold extrudes, or set the minimum extrude S<temperature>. (Requires PREVENT_COLD_EXTRUSION)
 * M303 - PID relay autotune S<temperature> sets the target temperature. Default 150C. (Requires PIDTEMP)
 * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED)
 * M350 - Set microstepping mode. (Requires digital microstepping pins.)
 * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.)
 * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN)
 * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID)
 * M381 - Disable all solenoids. (Requires EXT_SOLENOID)
 * M400 - Finish all moves.
 * M401 - Deploy and activate Z probe. (Requires a probe)
 * M402 - Deactivate and stow Z probe. (Requires a probe)
 * M403 - Set filament type for PRUSA MMU2
 * M404 - Display or set the Nominal Filament Width: "W<diameter>". (Requires FILAMENT_WIDTH_SENSOR)
 * M405 - Enable Filament Sensor flow control. "M405 D<delay_cm>". (Requires FILAMENT_WIDTH_SENSOR)
 * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
 * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
 * M410 - Quickstop. Abort all planned moves.
 * M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
 * M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY)
 * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
 * M421 - Set a single Z coordinate in the Mesh Leveling grid. X<units> Y<units> Z<units> (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL)
 * M422 - Set Z Stepper automatic alignment position using probe. X<units> Y<units> A<axis> (Requires Z_STEPPER_AUTO_ALIGN)
 * M425 - Enable/Disable and tune backlash correction. (Requires BACKLASH_COMPENSATION and BACKLASH_GCODE)
 * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
 * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
 * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
 * M502 - Revert to the default "factory settings". **Does not write them to EEPROM!**
 * M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
 * M524 - Abort the current SD print job (started with M24)
 * M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
 * M569 - Enable stealthChop on an axis. (Requires at least one #_X_DRIVER_TYPE to be TMC2130 or TMC2208)
 * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
 * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
 * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
 * M665 - Set delta configurations: "M665 H<delta height> L<diagonal rod> R<delta radius> S<segments/s> B<calibration radius> X<Alpha angle trim> Y<Beta angle trim> Z<Gamma angle trim> (Requires DELTA)
 * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS).
 * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
 * M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
 * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS)
 * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.)
 * M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ)
 * M860 - Report the position of position encoder modules.
 * M861 - Report the status of position encoder modules.
 * M862 - Perform an axis continuity test for position encoder modules.
 * M863 - Perform steps-per-mm calibration for position encoder modules.
 * M864 - Change position encoder module I2C address.
 * M865 - Check position encoder module firmware version.
 * M866 - Report or reset position encoder module error count.
 * M867 - Enable/disable or toggle error correction for position encoder modules.
 * M868 - Report or set position encoder module error correction threshold.
 * M869 - Report position encoder module error.
 * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
 * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
 * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
 * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN)
 * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT)
 * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT)
 * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
 * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
 * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD)
 * M914 - Set StallGuard sensitivity. (Requires SENSORLESS_HOMING or SENSORLESS_PROBING)
 * M917 - L6470 tuning: Find minimum current thresholds
 * M918 - L6470 tuning: Increase speed until max or error
 * M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER)
 *
 * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
 * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
 * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
 * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
 * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
 *
 * ************ Custom codes - This can change to suit future G-code regulations
 * M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT)
 * M997 - Perform in-application firmware update
 * M999 - Restart after being stopped by error
 *
 * "T" Codes
 *
 * T0-T3 - Select an extruder (tool) by index: "T<n> F<units/min>"
 *

```

---

<div class="post-metadata">

**Author:** ![scyto](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/scyto/32/13938_2.png) [@scyto](https://forum.snapmaker.com/u/scyto)\
**Post date:** [September 17, 2021, 12:41am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/8 "2021-09-17T00:41:12Z")

</div>

except don’t use G29 and use the undocumented G1029 instead, lol - i just bugged the fact that G29 S0 does nasty things… i also bugged how incomplete the snapmaker  
gcode docs are ☹

snapmaker should update this or remove it IMHO [https://snapmaker.github.io/Documentation/gcode/G000-G001](https://snapmaker.github.io/Documentation/gcode/G000-G001)

---

<div class="post-metadata">

**Author:** ![Artezio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/artezio/32/15834_2.png) [@Artezio](https://forum.snapmaker.com/u/Artezio)\
**Post date:** [September 17, 2021, 12:48am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/9 "2021-09-17T00:48:10Z")

</div>

@scyto I just took it from the GitHub, because for some reason the official thread here on the forum somehow no longer exists.

---

<div class="post-metadata">

**Author:** ![scyto](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/scyto/32/13938_2.png) [@scyto](https://forum.snapmaker.com/u/scyto)\
**Post date:** [September 17, 2021, 12:55am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/10 "2021-09-17T00:55:23Z")

</div>

yeah good call, wasn’t criticizing, just moaning as usual about snapmaker 🙂

---

<div class="post-metadata">

**Author:** ![Artezio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/artezio/32/15834_2.png) [@Artezio](https://forum.snapmaker.com/u/Artezio)\
**Post date:** [September 17, 2021, 12:56am UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/11 "2021-09-17T00:56:18Z")

</div>

@scyto I did my share of moaning about Snapmaker for the day earlier LOL

---

<div class="post-metadata">

**Author:** ![Tgunr](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/tgunr/32/16188_2.png) [@Tgunr](https://forum.snapmaker.com/u/Tgunr)\
**Post date:** [December 27, 2021, 2:08pm UTC](https://forum.snapmaker.com/t/snapmaker-2-marlin-2-gcode-support/5155/12 "2021-12-27T14:08:39Z")

</div>

Update to [quote=“Artezio, post:7, topic:5155”]

Just went thru the code and added what I found, namely:  
M1000  
M1005  
M1007  
M1010  
M1011  
M1028  
M1029

```auto
/**
 * -----------------
 * G-Codes in Marlin
 * -----------------
 *
 * Helpful G-code references:
 * - http://linuxcnc.org/handbook/gcode/g-code.html
 * - http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes
 *
 * Help to document Marlin's G-codes online:
 * - http://reprap.org/wiki/G-code
 * - https://github.com/MarlinFirmware/MarlinDocumentation
 *
 * -----------------
 *
 * "G" Codes
 *
 * G0 -> G1
 * G1 - Coordinated Movement X Y Z E
 * G2 - CW ARC
 * G3 - CCW ARC
 * G4 - Dwell S<seconds> or P<milliseconds>
 * G5 - Cubic B-spline with XYZE destination and IJPQ offsets
 * G10 - Retract filament according to settings of M207 (Requires FWRETRACT)
 * G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT)
 * G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE)
 * G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES)
 * G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES)
 * G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES)
 * G20 - Set input units to inches (Requires INCH_MODE_SUPPORT)
 * G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT)
 * G26 - Mesh Validation Pattern (Requires G26_MESH_VALIDATION)
 * G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE)
 * G28 - Home one or more axes
 * G29 - Start or continue the bed leveling probe procedure (Requires bed leveling)
 * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
 * G31 - Dock sled (Z_PROBE_SLED only)
 * G32 - Undock sled (Z_PROBE_SLED only)
 * G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
 * G34 - Z Stepper automatic alignment using probe: I<iterations> T<accuracy> A<amplification> (Requires Z_STEPPER_AUTO_ALIGN)
 * G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET)
 * G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL)
 * G80 - Cancel current motion mode (Requires GCODE_MOTION_MODES)
 * G90 - Use Absolute Coordinates
 * G91 - Use Relative Coordinates
 * G92 - Set current position to coordinates given
 *
 * "M" Codes
 *
 * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
 * M1 -> M0
 * M3 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to clockwise
 * M4 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to counter-clockwise
 * M5 - Turn laser/spindle off
 * M12 - Set up closed loop control system. (Requires EXTERNAL_CLOSED_LOOP_CONTROLLER)
 * M17 - Enable/Power all stepper motors
 * M18 - Disable all stepper motors; same as M84
 * M20 - List SD card. (Requires SDSUPPORT)
 * M21 - Init SD card. (Requires SDSUPPORT)
 * M22 - Release SD card. (Requires SDSUPPORT)
 * M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT)
 * M24 - Start/resume SD print. (Requires SDSUPPORT)
 * M25 - Pause SD print. (Requires SDSUPPORT)
 * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT)
 * M27 - Report SD print status. (Requires SDSUPPORT)
 * OR, with 'S<seconds>' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS)
 * OR, with 'C' get the current filename.
 * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
 * M29 - Stop SD write. (Requires SDSUPPORT)
 * M30 - Delete file from SD: "M30 /path/file.gco"
 * M31 - Report time since last M109 or SD card start to serial.
 * M32 - Select file and start SD print: "M32 [S<bytepos>] !/path/file.gco#". (Requires SDSUPPORT)
 * Use P to run other files as sub-programs: "M32 P !filename#"
 * The '#' is necessary when calling from within sd files, as it stops buffer prereading
 * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT)
 * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA)
 * M42 - Change pin status via gcode: M42 P<pin> S<value>. LED pin assumed if P is omitted.
 * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
 * M48 - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
 * M75 - Start the print job timer.
 * M76 - Pause the print job timer.
 * M77 - Stop the print job timer.
 * M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER)
 * M80 - Turn on Power Supply. (Requires POWER_SUPPLY > 0)
 * M81 - Turn off Power Supply. (Requires POWER_SUPPLY > 0)
 * M82 - Set E codes absolute (default).
 * M83 - Set E codes relative while in Absolute (G90) mode.
 * M84 - Disable steppers until next move, or use S<seconds> to specify an idle
 * duration after which steppers should turn off. S0 disables the timeout.
 * M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
 * M92 - Set planner.settings.axis_steps_per_mm for one or more axes.
 * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
 * M104 - Set extruder target temp.
 * M105 - Report current temperatures.
 * M106 - Set print fan speed.
 * M107 - Print fan off.
 * M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER)
 * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
 * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
 * If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
 * M110 - Set the current line number. (Used by host printing)
 * M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
 * M112 - Emergency stop.
 * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
 * M114 - Report current position.
 * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
 * M117 - Display a message on the controller screen. (Requires an LCD)
 * M118 - Display a message in the host console.
 * M119 - Report endstops status.
 * M120 - Enable endstops detection.
 * M121 - Disable endstops detection.
 * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
 * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
 * M126 - Solenoid Air Valve Open. (Requires BARICUDA)
 * M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
 * M128 - EtoP Open. (Requires BARICUDA)
 * M129 - EtoP Closed. (Requires BARICUDA)
 * M140 - Set bed target temp. S<temp>
 * M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
 * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
 * M150 - Set Status LED Color as R<red> U<green> B<blue> P<bright>. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, PCA9533, or PCA9632).
 * M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
 * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
 * M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)
 * M165 - Set the mix for the mixing extruder (and current virtual tool) with parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1)
 * M166 - Set the Gradient Mix for the mixing extruder. (Requires GRADIENT_MIX)
 * M190 - Sxxx Wait for bed current temp to reach target temp. **Waits only when heating!**
 * Rxxx Wait for bed current temp to reach target temp. **Waits for heating or cooling.**
 * M200 - Set filament diameter, D<diameter>, setting E axis units to cubic. (Use S0 to revert to linear units.)
 * M201 - Set max acceleration in units/s^2 for print moves: "M201 X<accel> Y<accel> Z<accel> E<accel>"
 * M202 - Set max acceleration in units/s^2 for travel moves: "M202 X<accel> Y<accel> Z<accel> E<accel>" **UNUSED IN MARLIN!**
 * M203 - Set maximum feedrate: "M203 X<fr> Y<fr> Z<fr> E<fr>" in units/sec.
 * M204 - Set default acceleration in units/sec^2: P<printing> R<extruder_only> T<travel>
 * M205 - Set advanced settings. Current units apply:
            S<print> T<travel> minimum speeds
            B<minimum segment time>
            X<max X jerk>, Y<max Y jerk>, Z<max Z jerk>, E<max E jerk>
 * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
 * M207 - Set Retract Length: S<length>, Feedrate: F<units/min>, and Z lift: Z<distance>. (Requires FWRETRACT)
 * M208 - Set Recover (unretract) Additional (!) Length: S<length> and Feedrate: F<units/min>. (Requires FWRETRACT)
 * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT_AUTORETRACT)
          Every normal extrude-only move will be classified as retract depending on the direction.
 * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS)
 * M217 - Set filament swap parameters: "M217 S<length> P<feedrate> R<feedrate>". (Requires SINGLENOZZLE)
 * M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
 * M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
 * M221 - Set Flow Percentage: "M221 S<percent>"
 * M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>"
 * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)
 * M250 - Set LCD contrast: "M250 C<contrast>" (0-63). (Requires LCD support)
 * M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS)
 * M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS)
 * M280 - Set servo position absolute: "M280 P<index> S<angle|µs>". (Requires servos)
 * M281 - Set servo min|max position: "M281 P<index> L<min> U<max>". (Requires EDITABLE_SERVO_ANGLES)
 * M290 - Babystepping (Requires BABYSTEPPING)
 * M300 - Play beep sound S<frequency Hz> P<duration ms>
 * M301 - Set PID parameters P I and D. (Requires PIDTEMP)
 * M302 - Allow cold extrudes, or set the minimum extrude S<temperature>. (Requires PREVENT_COLD_EXTRUSION)
 * M303 - PID relay autotune S<temperature> sets the target temperature. Default 150C. (Requires PIDTEMP)
 * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED)
 * M350 - Set microstepping mode. (Requires digital microstepping pins.)
 * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.)
 * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN)
 * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID)
 * M381 - Disable all solenoids. (Requires EXT_SOLENOID)
 * M400 - Finish all moves.
 * M401 - Deploy and activate Z probe. (Requires a probe)
 * M402 - Deactivate and stow Z probe. (Requires a probe)
 * M403 - Set filament type for PRUSA MMU2
 * M404 - Display or set the Nominal Filament Width: "W<diameter>". (Requires FILAMENT_WIDTH_SENSOR)
 * M405 - Enable Filament Sensor flow control. "M405 D<delay_cm>". (Requires FILAMENT_WIDTH_SENSOR)
 * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
 * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
 * M410 - Quickstop. Abort all planned moves.
 * M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
 * M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY)
 * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
 * M421 - Set a single Z coordinate in the Mesh Leveling grid. X<units> Y<units> Z<units> (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL)
 * M422 - Set Z Stepper automatic alignment position using probe. X<units> Y<units> A<axis> (Requires Z_STEPPER_AUTO_ALIGN)
 * M425 - Enable/Disable and tune backlash correction. (Requires BACKLASH_COMPENSATION and BACKLASH_GCODE)
 * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
 * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
 * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
 * M502 - Revert to the default "factory settings". **Does not write them to EEPROM!**
 * M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
 * M524 - Abort the current SD print job (started with M24)
 * M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
 * M569 - Enable stealthChop on an axis. (Requires at least one #_X_DRIVER_TYPE to be TMC2130 or TMC2208)
 * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
 * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
 * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
 * M665 - Set delta configurations: "M665 H<delta height> L<diagonal rod> R<delta radius> S<segments/s> B<calibration radius> X<Alpha angle trim> Y<Beta angle trim> Z<Gamma angle trim> (Requires DELTA)
 * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS).
 * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
 * M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
 * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS)
 * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.)
 * M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ)
 * M860 - Report the position of position encoder modules.
 * M861 - Report the status of position encoder modules.
 * M862 - Perform an axis continuity test for position encoder modules.
 * M863 - Perform steps-per-mm calibration for position encoder modules.
 * M864 - Change position encoder module I2C address.
 * M865 - Check position encoder module firmware version.
 * M866 - Report or reset position encoder module error count.
 * M867 - Enable/disable or toggle error correction for position encoder modules.
 * M868 - Report or set position encoder module error correction threshold.
 * M869 - Report position encoder module error.
 * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
 * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
 * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
 * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN)
 * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT)
 * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT)
 * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
 * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
 * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD)
 * M914 - Set StallGuard sensitivity. (Requires SENSORLESS_HOMING or SENSORLESS_PROBING)
 * M917 - L6470 tuning: Find minimum current thresholds
 * M918 - L6470 tuning: Increase speed until max or error
 * M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER)
 *
 * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
 * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
 * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
 * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
 * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
 *
 * ************ Custom codes - This can change to suit future G-code regulations
 * M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT)
 * M997 - Perform in-application firmware update
 * M999 - Restart after being stopped by error
 *
 * M1000: Resume from power-loss (undocumented) 
   * With 'S' go to the Resume/Cancel menu
   * With no parameters, run recovery commands
 * M1005 - Firmware version
 * M1007 - Query active_coordinate_system
 * M1010 - Control/query chamber status, compatible with Snapmaker1
 * M1011 - Control/query purifier status
 * M1028 Configure the customize parameters of snapmaker
	* S:
	* 0: show current parameters
	* 1: home feedrate, X<X speed> Y<Y speed> Z<Z speed>
	* 2: home bump speed divisor
	* 3: max feedrate in calibration, X<X speed> Y<Y speed> Z<Z speed>
	* 4: feedrate in calibration, X<X speed> Y<Y speed> Z<Z speed>
	* 5: Z postions in calibration, details please see comments above
	* 6: laser power in calibration
	* 7: z limit in calibration
	* 8: speed in drawing ruler
 * M1029 - Remap the 8 pin port to any axis 8 pin number: 1 - 6 eg. M1029 X2 Y3 Z4 B5 E6
 *
 * "T" Codes
 *
 * T0-T3 - Select an extruder (tool) by index: "T<n> F<units/min>"
 *
 */

```

[/quote]
