hits counter

RepRap 101: Activating Marlin's EEPROM functions, and what that does for you.

I’ve been asked about this a few times, and it seemed appropriate to put together a quick post on the topic.

In my humble opinion, one of the most useful features of Marlin is the ability to save a bunch of settings to what is essentially a non-volatile area memory that exists on the Arduino board, which, of course, is the basis for nearly all the current generation of 3D printer controllers.

With Marlin’s EEPROM functions activated, a user can set, adjust, tweak or otherwise modify a printer’s settings until everything is just so, and then save them such that they will not only survive a reboot (or even a complete re-flash of the firmware), but they will also appear as the default settings every time the printer is turned on.

This, of course, is a whole lot faster, easier and more productive than making all these changes within the Configuration.h file.

In most cases, the EEPROM functions are disabled by default. The good news is that it is quite simple to activate them. Simply open up your Configuration.h file, and look for this section, which is going to be very near the “Additional Features” heading:

// The microcontroller can store settings in the EEPROM, e.g. max velocity...
// M500 - stores parameters in EEPROM
// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
//define this to enable EEPROM support
//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can.

Now, simply find these two lines:


And make them look like this:


Now save your changes and re-flash Marlin. Your EEPROM functions are now active, congratulations!

You can verify this via your LCD controller by entering the menu, then selecting Control. Inside the Control menu, you should see two new options:

Store Memory and
Load Memory

What they both do is fairly self-explanatory:

Store Memory stores the printer’s current values to EEPROM, which also effectively makes them the default settings at boot.

Load Memory retrieves the stored settings from EEPROM, and overwrites whatever is currently in the printer’s SRAM (working memory). Be careful with this: if you’ve been making adjustments and select this option, they will be lost in favor of whatever is already in storage.

There is also a third option, which has been there all along, which is related to the other two:

Restore failsafe will overwrite whatever is in SRAM with whatever values are specified in the Configuration.h file

What settings can be stored in EEPROM? Specifically:

  • Steps per unit (usually steps per mm) for X,Y,and Z axes, as well as Extruder steps/mm,
  • Maximum Feedrates (in mm/s) for X,Y,Z and Extruder
  • Maximum Acceleration (in mm/s2) for X,Y,Z and Extruder
  • Acceleration and Retraction Acceleration
  • “Advanced Variables”: Min Feedrate(mm/s), Min Travel Feedrate(mm/s), Min Segment Time (ms), Max X,Y,Z Jerk (mm/s)
  • Home Offset (mm)
  • PID Values
  • In addition to setting these values via the LCD, you can save and load settings to/from the EEPROM using M-codes through a print control application such as Pronterface.

    Back in your Configuration.h file, in the comments in the code segment where you activated your EEPROM functions, there is some good information explaining what M500, M501 and M502 do (just scroll up in this post, I’ve already quoted it). These commands correspond exactly to the Save Memory, Load Memory, and Restore Failsafe options on the LCD menu.

    As an added bonus, the M501 command will also echo all of the settings stored in EEPROM, and as a nice extra touch, it also tells you what M-codes you would need to use in order to manually change any of the settings. Pretty cool, if you ask me!

    5 comments to RepRap 101: Activating Marlin’s EEPROM functions, and what that does for you.

    • […] Eintrag zu Marlin im RepRap Wiki Sehr guter englischer ARtikel zu dem Thema […]

    • Hi Zennmaster!

      I really enjoy your videos, which are both professional and to the point. I do have a couple of questions regarding this topic and auto-leveling.

      1. Is it possible to read the changes made on the LCD back to the computer? Say I do alot of small changes to tune the printer via the LCD, and then when I’m satisfied, I store it to Eeprom.. But I’d like to also store the changes made in my Configuration.h file. That way when I do other changes later to the file, I won’t overwrite the changes I made on the LCD after uploading..

      2. I successfully added autoleveling to my reprap, and it’s working fine. I have one issue tho.. For each probe point, the servo will retract the probe without raizing the Z. It will move to a probe point, probe the point, retract and then raize Z to move to the next point.. Is it a way to adjust this? It is very annoying that the probe “scrathes” the surface of the bed each time it probes..

      The perfect way should be: Move to point, probe point, raize Z, Retract, move to next point..

      Thanks for all your input.

      Best regards,

      dexus – Norway.

      • Hi! Sorry it’s taken me so long to reply. Life and stuff… Anyway, unfortunately, no, there is no way in the current generation Arduino boards to offload any data from the firmware back to a computer.

        As for your second question, make sure you’ve got this line in your Configuration.h, and that it’s not commented:

        #define Z_RAISE_BETWEEN_PROBINGS 5

    • Should be raising of course.. not Raizing.. My printer does not shave 😉

    • Alex

      Hey Zennmaster,
      For those of us who are new to the 3D printing world, could you explain where to find and how to open the configuration.h file for the marlin firmware?

    Leave a Reply

    You can use these HTML tags

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>