fix(gcode): M500 tells the user when persistence is disabled - #5305
Open
packerlschupfer wants to merge 1 commit into
Open
fix(gcode): M500 tells the user when persistence is disabled#5305packerlschupfer wants to merge 1 commit into
packerlschupfer wants to merge 1 commit into
Conversation
`MarlinSettings::save()` is stubbed on Buddy (returns `false` with a
debug-only `DEBUG_ERROR_MSG("EEPROM disabled")`). `DEBUG_ERROR_MSG` is
gated by `EEPROM_CHITCHAT` which is commented out in every Configuration
header in the tree, so the message is `NOOP`. M500 silently does nothing
and replies "ok" — users running it manually (during PID autotune,
calibration tweaks, etc.) think their settings were saved.
Persistence on Buddy actually goes through `config_store`, called by
specific M-codes (M301, M304, M92, M203, etc.). M500 has no equivalent
for these in the EEPROM-less codepath.
Make M500 explicitly tell the user when the underlying save did nothing:
echo:Persistent EEPROM disabled; settings are runtime-only.
echo:Use specific M-codes (M301/M304/M92/M203/etc.) — they persist via config_store.
No behavior change when EEPROM actually works (save() returns true).
M115's `Cap:EEPROM:0` still indicates the machine-readable state.
packerlschupfer
force-pushed
the
pr/m500-explicit-noop
branch
from
July 26, 2026 19:44
8c24b25 to
aaec1a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a user runs
M500over USB serial (or via PrusaLink g-code passthrough), it currently repliesokand silently does nothing. This PR makes M500 emit an explicit user-visible message in that case so the user isn't fooled into thinking their settings were saved.The current silent failure
MarlinSettings::save()inconfiguration_store.cppis stubbed:DEBUG_ERROR_MSGisNOOPunlessEEPROM_CHITCHATis defined. Checking the configs:It's commented out in every printer's Configuration header (MK3.5, MK4, MINI, XL, iX, COREONE, COREONEL, …). So
DEBUG_ERROR_MSGexpands to nothing, save() returns false, and the M500 G-code wrapper ignores the return value:The user sees
okand assumes the save worked.Why this matters
This is confusing during real workflows where users genuinely expect persistence:
M303PID autotune — Marlin's docs (and many tutorials) tell users to runM500to save. They follow the steps, seeok, and don't realize nothing happened.M92/M203/M204/M205tuning — same issue.M301PID set — actually persists via config_store, but only becauseM301's handler writes to the store directly, not viasettings.save().The machine-readable signal exists (
Cap:EEPROM:0inM115), but no normal user runsM115to check before everyM500.The fix
SERIAL_ECHO_MSGis unconditional and prefixes withecho:, which is the standard Marlin pattern for user-facing info.No behavior change when EEPROM actually works (
save()returns true). The existingCap:EEPROM:0inM115is unchanged.Test plan
coreone_release_emptyboot).save()works (Marlin without the stub): no output change —save()returns true, message skipped.M500now emits the twoecho:lines before the finalok.Notes / scope
load()is defined asreset(); report(); return true;— it reports success while actually just resetting to defaults). Decided to keep this PR focused on M500 since the M501 case has subtler semantics (load → reset is at least somewhat defensible at boot). Happy to add it here or in a follow-up.MarlinSettings::save()itself emit aSERIAL_ECHO_MSG(not gated byEEPROM_CHITCHAT) so all callers benefit. CurrentlyM500is the only caller, so a wrapper-level fix has the same effect with less surface.