<p>Technically, the description as "factory settings" is misguiding, as the settings called up are much better described as "firmware defined settings". But since Firmware upgrades usually are rare and far between, these settings can be considered "factory" for the usual user, even as we always urge users to test if their firmware <a href="https://3dprinting.stackexchange.com/questions/8466/what-is-thermal-runaway-protection">has TRP enabled</a> and upgrade if not so. </p>

<p>Depending on the firmware, this usually means the settings described in <a href="https://3dprinting.stackexchange.com/a/11439/8884">this answer</a>, but it could also be more narrow or extend to different and custom settings inside the firmware. Marlin, when it uses <a href="https://sebastian.expert/enable-disable-eeprom-commands-marlin/" rel="nofollow noreferrer">EEPROM_SETTINGS</a>, uses <code>Configurations.h</code> and the additional <code>Configurations_adv.h</code> to define what the factory settings are.</p>

<p>For example in <a href="https://3dprinting.stackexchange.com/q/11410/8884">this question</a> the firmware defined the additional settings in <code>Configuration_adv.h</code>. Installing firmware does not by itself alter the EEPROM, so these settings needed to be <em>seeded into SRAM</em> via <a href="http://marlinfw.org/docs/gcode/M500.html" rel="nofollow noreferrer"><code>M502</code></a> and then <em>saved into EEPROM</em> via <a href="http://marlinfw.org/docs/gcode/M500.html" rel="nofollow noreferrer"><code>M500</code></a>. </p>

<p>The remaining commands in the <code>M50X</code> series are obviously <a href="http://marlinfw.org/docs/gcode/M500.html" rel="nofollow noreferrer"><code>M501</code></a> and <a href="http://marlinfw.org/docs/gcode/M500.html" rel="nofollow noreferrer"><code>M503</code></a>. <code>M501</code> overwrites the SRAM settings with those from the EEPROM, useful if you toy with the SRAM settings to troubleshoot or play with offsets in a somewhat safe manner. <code>M503</code> in turn reports all settings currently in the SRAM, which can be changed during running. Most of these settings can be stored into the EEPROM, if EEPROM_SETTINGS is enabled, but they don't necessarily have to come from the EEPROM at the moment, as they can be altered due to a lot of reasons. Your G-code to print could call for example <code>G20</code> and <code>M149 K</code> just to mess with you by swapping to Inches and Kelvin, but that would be easily fixable by recalling <code>M501</code>. This following <code>M503</code> output was given as an example by <a href="https://sebastian.expert/marlin-g-codes-m500-m501-m502-m503/" rel="nofollow noreferrer">Sebastian.expert</a>:</p>

<pre><code>G21    ; Units in mm
M149 C ; Units in Celsius
Filament settings: Disabled
M200 D1.75
M200 D0
Steps per unit:
M92 X100.00 Y100.00 Z398.70 E100.00
Maximum feedrates (units/s):
M203 X400.00 Y400.00 Z8.00 E50.00
Maximum Acceleration (units/s2):
M201 X1000 Y1000 Z100 E10000
Acceleration (units/s2): P R T
M204 P400.00 R1000.00 T1000.00
Advanced: S T B X Z E
M205 S0.00 T0.00 B20000 X10.00 Y10.00 Z0.30 E5.00
Home offset:
M206 X0.00 Y0.00 Z0.00
Auto Bed Leveling:
M420 S1 Z0.00
Material heatup parameters:
M145 S0 H195 B55 F0
M145 S1 H205 B60 F0
PID settings:
M301 P52.25 I5.60 D122.00
Z-Probe Offset (mm):
M851 Z-2.41
</code></pre>

<p>Note that with a <a href="https://3dprinting.stackexchange.com/questions/10573/what-is-a-printer-console-terminal">console or terminal</a>, you could sometimes alter EEPROM settings directly via a UI. Among the terminals I know to have this ability is Repetier Host.</p>

CC BY-SA 4.0
2019-11-27T14:09:07.027Z
I totally agree on the "factory" nomenclature! But that is what the documentation states, hence the phrasing in the question!
0scar
CC BY-SA 4.0
2019-11-27T13:51:47.973Z
2019-11-27T14:12:56.547Z
2019-11-27T14:12:56.547Z
Trish
<p>What Marlin does when <code>M502</code> is called is defined in the <a href="https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/Marlin/src/module/configuration_store.cpp" rel="noreferrer"><code>configuration_store.cpp</code></a> file.</p>

<p>It resets:</p>

<ul>
<li>Max acceleration</li>
<li>Steps per mm</li>
<li>Max feedrate / speed</li>
<li>Min segment time</li>
<li>Acceleration (Normal, Retract, Travel)</li>
<li>Min feedrate</li>
<li>Min travel feedrate</li>
<li>Jerk settings</li>
<li>Junction deviation</li>
<li>Home and SCARA offsets</li>
<li>Hot end offsets</li>
<li>Filament runout sensor distance</li>
<li>Tool change parameters (Swap length, extra prime, prime speed, retract speed, Park 
positions, Z raise)</li>
<li>Backlash correction distances and smoothing parameters</li>
<li>Extensible UI</li>
<li>Magnetic parking extruder settings</li>
<li>ABL (fade height, stored points, nozzle offset, servo angles</li>
<li>Delta calibration data (Height, Endstop offset, radius, rod length, segments per 
second, calibration radius, trim angle)</li>
<li>Dual / triple endstop adjustments</li>
<li>Preheat parameters</li>
<li>PID parameters</li>
<li>self-defined thermistors</li>
<li>LCD contrast</li>
<li>Power loss recovery</li>
<li>Firmware retraction</li>
<li>Filament diameter (for volumetric extrusion)</li>
<li>Endstops (if disabled)</li>
<li>Stepper drivers</li>
<li>Linear advance parameters</li>
<li>Motor currents (digipot)</li>
<li>CNC coordinate system (if selected)</li>
<li>Skew correction parameters</li>
<li>Advance pause filament change lengths</li>
</ul>

CC BY-SA 4.0
2019-11-27T12:33:27.040Z
Any comment on the `M503` part of the question?
0scar
CC BY-SA 4.0
2019-11-27T13:57:26.357Z
Note that you can increase what is stored without altering configuracion_store.cpp by just altering the configuration.h and configuration_adv.h
Trish
CC BY-SA 4.0
2019-11-27T10:36:56.577Z
2019-11-27T10:36:56.577Z
towe
<p>From the <a href="http://marlinfw.org/docs/gcode/M502.html" rel="nofollow noreferrer"><code>M502</code> documentation page</a> can be read that <code>M502</code>:</p>

<blockquote>
  <p>Reset all configurable settings to their factory defaults.</p>
</blockquote>

<p><sub><em>Please note that this phrasing from the manual has been used in the question title!</em></sub></p>

<blockquote>
  <p>To also reset settings in EEPROM, follow with M500.</p>
</blockquote>

<p>Note that:</p>

<blockquote>
  <p>This command can be used even if EEPROM_SETTINGS is disabled.</p>
</blockquote>

<p>The question is what is the definition of <em>"all configurable settings"</em>?</p>

<p>Are these the settings that are displayed with <a href="http://marlinfw.org/docs/gcode/M503.html" rel="nofollow noreferrer"><code>M503</code></a>, or are there hidden settings?</p>

<marlin><g-code><knowledgebase><reset>
M502 will reset all configurable settings to their "factory defaults", which settings are those?
0scar
# M502 will reset all configurable settings to their "factory defaults", which settings are those?

(Asked by: username_0 on 2019-11-27)

From the [`M502` documentation page](http://marlinfw.org/docs/gcode/M502.html) can be read that `M502`:

> Reset all configurable settings to their factory defaults.

*Please note that this phrasing from the manual has been used in the question title!*

> To also reset settings in EEPROM, follow with M500.

Note that:

> This command can be used even if EEPROM\_SETTINGS is disabled.

The question is what is the definition of *"all configurable settings"*?

Are these the settings that are displayed with [`M503`](http://marlinfw.org/docs/gcode/M503.html), or are there hidden settings?

**Tags:** marlin, g-code, knowledgebase, reset

---

## 2 answers

### Answer by username_2 on 2019-11-27. Score: 5 | Accepted answer

What Marlin does when `M502` is called is defined in the [`configuration_store.cpp`](https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/Marlin/src/module/configuration_store.cpp) file.

It resets:

* Max acceleration
* Steps per mm
* Max feedrate / speed
* Min segment time
* Acceleration (Normal, Retract, Travel)
* Min feedrate
* Min travel feedrate
* Jerk settings
* Junction deviation
* Home and SCARA offsets
* Hot end offsets
* Filament runout sensor distance
* Tool change parameters (Swap length, extra prime, prime speed, retract speed, Park
  positions, Z raise)
* Backlash correction distances and smoothing parameters
* Extensible UI
* Magnetic parking extruder settings
* ABL (fade height, stored points, nozzle offset, servo angles
* Delta calibration data (Height, Endstop offset, radius, rod length, segments per
  second, calibration radius, trim angle)
* Dual / triple endstop adjustments
* Preheat parameters
* PID parameters
* self-defined thermistors
* LCD contrast
* Power loss recovery
* Firmware retraction
* Filament diameter (for volumetric extrusion)
* Endstops (if disabled)
* Stepper drivers
* Linear advance parameters
* Motor currents (digipot)
* CNC coordinate system (if selected)
* Skew correction parameters
* Advance pause filament change lengths

> **Comments:**
> **username_0**: Any comment on the `M503` part of the question?  
> **username_1**: Note that you can increase what is stored without altering configuracion_store.cpp by just altering the configuration.h and configuration_adv.h  

---

### Answer by username_1 on 2019-11-27. Score: 3

Technically, the description as "factory settings" is misguiding, as the settings called up are much better described as "firmware defined settings". But since Firmware upgrades usually are rare and far between, these settings can be considered "factory" for the usual user, even as we always urge users to test if their firmware has TRP enabled and upgrade if not so. 
Depending on the firmware, this usually means the settings described in this answer, but it could also be more narrow or extend to different and custom settings inside the firmware. Marlin, when it uses EEPROM_SETTINGS, uses Configurations.h and the additional Configurations_adv.h to define what the factory settings are.
For example in this question the firmware defined the additional settings in Configuration_adv.h. Installing firmware does not by itself alter the EEPROM, so these settings needed to be seeded into SRAM via M502 and then saved into EEPROM via M500. 
The remaining commands in the M50X series are obviously M501 and M503. M501 overwrites the SRAM settings with those from the EEPROM, useful if you toy with the SRAM settings to troubleshoot or play with offsets in a somewhat safe manner. M503 in turn reports all settings currently in the SRAM, which can be changed during running. Most of these settings can be stored into the EEPROM, if EEPROM_SETTINGS is enabled, but they don't necessarily have to come from the EEPROM at the moment, as they can be altered due to a lot of reasons. Your G-code to print could call for example G20 and M149 K just to mess with you by swapping to Inches and Kelvin, but that would be easily fixable by recalling M501. This following M503 output was given as an example by Sebastian.expert:
G21    ; Units in mm
M149 C ; Units in Celsius
Filament settings: Disabled
M200 D1.75
M200 D0
Steps per unit:
M92 X100.00 Y100.00 Z398.70 E100.00
Maximum feedrates (units/s):
M203 X400.00 Y400.00 Z8.00 E50.00
Maximum Acceleration (units/s2):
M201 X1000 Y1000 Z100 E10000
Acceleration (units/s2): P R T
M204 P400.00 R1000.00 T1000.00
Advanced: S T B X Z E
M205 S0.00 T0.00 B20000 X10.00 Y10.00 Z0.30 E5.00
Home offset:
M206 X0.00 Y0.00 Z0.00
Auto Bed Leveling:
M420 S1 Z0.00
Material heatup parameters:
M145 S0 H195 B55 F0
M145 S1 H205 B60 F0
PID settings:
M301 P52.25 I5.60 D122.00
Z-Probe Offset (mm):
M851 Z-2.41

Note that with a console or terminal, you could sometimes alter EEPROM settings directly via a UI. Among the terminals I know to have this ability is Repetier Host.

> **Comments:**
> **username_0**: I totally agree on the "factory" nomenclature! But that is what the documentation states, hence the phrasing in the question!  

---

