3D printer G-code · Marlin
M502: Factory reset (firmware defaults) (Marlin)
Factory reset (firmware defaults) — Loads the default values that were compiled into the firmware. It changes RAM only; M500 afterwards writes them to EEPROM. Always do M502 + M500 after flashing a new…
On this page
| Property | Value |
|---|---|
| Command | M502 |
| Function | Factory reset (firmware defaults) |
| Firmware | Marlin |
| Group | Settings |
| Syntax | M502 |
What does M502 do?
Loads the default values that were compiled into the firmware. It changes RAM only; M500 afterwards writes them to EEPROM. Always do M502 + M500 after flashing a new firmware.
Example
M502
M500Tips from practice
- Write down your calibrated values (M503) before.
Marlin. Many Marlin commands only exist when the feature is enabled in the firmware build. If the printer answers "Unknown command", the feature is missing. Klipper does not understand most of these settings codes; it uses printer.cfg instead.
Related commands
More settings commands
| Command | Function | Firmware |
|---|---|---|
M500 | Save settings to EEPROM | Marlin |
M501 | Load settings from EEPROM | Marlin |
M503 | Report settings | Marlin |
M201 | Max acceleration per axis | Marlin |
M203 | Max feed rate per axis | Marlin |
M204 | Set acceleration | Marlin and Klipper |
M205 | Jerk and junction deviation | Marlin |
M906 | Stepper motor current (TMC) | Marlin |
SAVE_CONFIG | Save calibration to printer.cfg | Klipper |
SET_VELOCITY_LIMIT | Speed, acceleration and corner limits | Klipper |
FIRMWARE_RESTART | Restart (RESTART / FIRMWARE_RESTART) | Klipper |
Test it before you print
Paste your start code or a whole file into the 3D printer simulator. It plans every move, shows the time and finds missing waits, cold extrusion and moves outside the bed.
Open the simulator