Welcome! Log In Create A New Profile


EEPROM question-Marlin

Posted by Rfster 
EEPROM question-Marlin
April 14, 2021 09:15PM
Hello Folks.

I realize this is a newbie question.
I thought I understood at first but I'm now getting confused about how EEPROM really works on a 32bit board (MKS Robin Nano - STM32F106...)
Could someone explain the exact function and the difference between these 4 commands in Marlin 2.X?

1) Store Settings
2) Load Settings
3) Restore Defaults
4) Initialize EEPROM

Thanks a lot for shedding some light on this for me.
Re: EEPROM question-Marlin
April 15, 2021 01:44PM
There are three locations where configuration information is stored in Marlin. First, there is the firmware itself which is configured using Configuration.h and Configuration_adv.h, next is the EEPROM, and finally is RAM when Marlin is running.

When Marlin boots up, it will copy the configuration from EEPROM to RAM. When you use any of the gcodes that change configuration settings, these will apply only to the copy of the configuration that is in RAM.
To save these for future boots of Marlin, you need to explicitly copy the RAM configuration to EEPROM. That is done with the "Store Settings" option (or the M500 gcode).
If you make a change in RAM that has not yet been saved to EEPROM, and you want to revert back to the previous setting, you can do that with "Load Settings" (or the M501 gcode) which will copy the values from EEPROM to RAM.

If you change Configuration.h and/or Configuration_adv.h, in most cases the new values in the firmware will not be automatically copied into EEPROM, so they will not take effect immediately. That's what the "Restore Defaults" (M502) and "Initialize EEPROM" options are for. "Restore Defaults" will overwrite the values in RAM with the values stored in the firmware. A "Store Settings" will then store these in EEPROM for future boots. "Initialize EEPROM" is the same as doing "Restore Defaults" followed by "Store Settings" so it's simply an easier way to do both at once.
Re: EEPROM question-Marlin
April 15, 2021 02:06PM
Now I get it !

Thank you so much.

This is the best explanation I have seen on this. Clear and to the point. Really appreciated.

Thanks again for taking the time and sharing the knowledge!

Sorry, only registered users may post in this forum.

Click here to login