Welcome! Log In Create A New Profile

Advanced

EEPROM Simpl/ish Use Case?

Posted by carvedblock 
EEPROM Simpl/ish Use Case?
April 17, 2019 06:07AM
Hi,


I'm implementing some custom gcodes, and I would like to to use the EEPROM.
I have not worked with EEPROM before. I looked over the configuration_store h and cpp, but I find it confusing.

Would someone please give me a pointer on which feature/s use EEPROM in a simple manner?
Something that would help me understand the necessities of using it.

I am interesting in saving
1. a boolean flag
2. a string (another use case)

Thanks!
Re: EEPROM Simpl/ish Use Case?
April 17, 2019 08:29AM
there is only one EEPROM so you must use it the same way the firmware does... or you will break it for the rest of the firmware

EEPROM is for mostly storing data between reboots. (often configuration data)

It is limited to 100,000 writes and then it will just not work any more. (It literally wears out)
(if your wanting to store lots of changes, you will need to look at wear leaving algorithms etc, which is a huge topic in itself)

The EEPROM space is very limited 4096 bytes total.

There are 4 things to change
1) increment the version number
2) SettingsDataStruct , you add your data structures you want to save to this (is only used in calculating EEPROM size)
3) modify MarlinSettings::save to save your data
4) modify MarlinSettings::_load to load your data
Re: EEPROM Simpl/ish Use Case?
April 17, 2019 08:41AM
Thanks Dust!
I think that's actually all I needed: a high level overview of how this works in Marlin.
Sorry, only registered users may post in this forum.

Click here to login