Marlin Firmware and EEPROM

Yes, I watched many YT vids associated to the following but am uncertain as to whether I’m doing this correctly or not! Yes, I’ve done many firmware updates to many devices but for some reason or another doing these updates to 3D printers seem to have so many caveats it’s confusing.
I installed the latest Marlin firmware on my MB.
Am using a new MB BTT SKR1.4Turbo with TMC2209 drivers, a BTT TFT35 screen, MS Direct Drive extruder, BLTouch. All this stuff is NEW equipment. It all works well now and have completed some prints created while calibrating the printer. No problems there.

  • Did all the calibrations per the Teaching Tech website https://teachingtechyt.github.io/calibration.html
  • Since then I made some minor changes in Marlin
  • Now I want to update those changes to the MB but want the following cleared up before proceeding.

My understanding of the process is to place the .bin file on a properly formatted small capacity microsd card.
Insert the card into the MB.
Turn on the printer. Wait.
Reset’ the EEPROM then ‘Save to EEPROM’.
Turn off the printer, remove the card, observe if the .bin file extension has been renamed .cur which is suppose to tell you that your update worked. Then turned on the printer, check the ‘Info’ button which shows you the version of Marlin installed. All great and dandy BUT here’s my concern.

  • Don’t we lose ALL the calibration settings by doing a "Reset’?
  • Do we have to do a ‘Reset’ when updating firmware to the MB or can we just ‘Save’ then shutdown?
  • I’m not clear on this what would seem to be an easy procedure.
  • I’m not even sure what happens when we do a ‘Reset’. Okay it resets the MB to ‘defaults’ BUT what defaults are those?? Why or when would I do a reset?
  • What does a ‘load EEPROM’ do? Why or when would I use it?

These questions are difficult to find CLEAR answers to on YT or the Marlin site.

Any help you can offer would be appreciated. I just don’t want to update my firmware and lose all my calibration settings.

OK, first a disclaimer: I’ve only ever updated the firmware on my printer once so some of what I say may somehow not apply, however, I am an Electronics Technologist and have updated many a PROM, EPROM, EEPROM over my career, so here are some generic answers that should apply to 3D printers as they do with any other microcontroller based system.

Second, let’s clarify some terminology. There are fundamentally two types of memory: volatile and non-volatile. Volatile is commonly referred to as “RAM” while non-Volatile is commonly referred to as ROM. ROM is useful for something you never, ever want to change, like a boot loader, without which a microcontroller becomes dedicated to one and only one task. Your microwave oven, for example, would not have a boot loader since it will only ever do one thing. On the other hand, a generic printer controller could be applied to 3D printing, 2D laser engraving, 4-Axis CNC, etc. so it must have a boot loader so an appropriate firmware can be installed depending on the application the controller is being put to.

Note, though , that in order for the firmware to still be there when you restart the machine, it actually has to be installed in some sort of EPROM (usually EEPROM). The ROM for boot-loader storage, EEPROM for program storage and RAM for variable storage are usually located on the microcontroller chip. In my experience, when a microcontroller application says it’s storing/loading from EEPROM it usually refers to an EEPROM chip that is external to the microcontroller. It is usually accessed via a serial port (Serial Peripheral Interface (SPI)) and as such, access to and from is fairly slow and is generally only used to store or retrieve settings.

That would depend on what the existing firmware is actually doing behind the scenes when you select the “reset” command.A “factory reset” should wipe out all custom configurations in both internal and external EEPROM. A more general “reset” could just mean wiping the volatile memory (RAM) which can then be modified by whatever is currently running or the volatile memory could be refreshed by loading settings from the external EEPROM.

Definitely YES. Let’s say your old firmware is using the external EEPROM to store such settings as: X-axis steps per mm, Y-axis steps per mm, Z-axis steps per mm, Extruder steps per mm, PID settings for the hot-end, PID settings for the bed, max X-value for the bed, max Y-value for the bed, max Z-value for the bed. Now you load an new firmware, and it stores settings like: X-axis steps per mm, Y-axis steps per mm, Z-axis steps per mm, Extruder steps per mm, BL-touch enabled/disabled, PID settings for the hot-end, PID settings for the bed, max X-value for the bed, max Y-value for the bed, max Z-value for the bed, other BL-touch related settings…

DId you note the difference? PID settings are no longer the 5th and 6th entries. They’ve been bumped to 6th and 7th. If you installed the new firmware but don’t wipe the EEPROM, the PID values will be completely wrong. EEPROM is like the pages in a book. Each page will contain different information, but when the second edition of a book comes out, there’s absolutely no guarantee that information won’t be added, deleted, or shuffled around.

As mentioned, it depends on what the firmware means by “Reset”. It certainly means internal RAM but may or may not include external EEPROM. The motherboard only generally reads it’s own RAM and (internal) EEPROM, accessing the external EEPROM only when a “Save” or “Load” settings command is issued. “Factory Reset” can generally be assumed to be wiping external EEPROM as well. You do a reset whenever things are going haywire or you’ve made so many changes that you can’t remember what you’ve changed and what you haven’t. It provides you with a clean slate from which to start over.

Ideally, you would only save to EEPROM when the printer is configured in a known-good state. That is to say, you have everything tuned properly and you’re happy with it’s performance. Then you save the current state to EEPROM. At some point you’ll want to tweak something here and there, or replace some equipment, and things will start to become less reliable. Let’s say, for example, you try out a new hot-end. That means changing the PID tuning, the acceleration to account for the change in mass, the Z-offset. As I say, ideally, you don’t save anything to EEPROM until you’re happy with it. Maybe with all the tweaking, you just can’t get it to be as reliable as the previous setup. This is where you go back to your original configuration (hardware wise) and load the settings from EEPROM.

LEGOManiac, so what you are saying is if you’ve made ALL your calibrations, which can take several hours to perform and then make minor changes in Marlin (same version as what’s currently installed in the printer) and update those to the MB I will LOSE all my calibrations??? That’s ridiculous!! No wonder they don’t tell you that in the videos. There’s NO WAY to update changes in Marlin to the MB without losing all your calibration settings…nuts!!!

@Rotorfreak it depends on the firmware and printer. I never change any calibration settings on my prusa it does not require it. It uses Marlin mostly anyway. On my X1 because I have a Mac I cannot write the firmware unless I borrow a PC. I do all settings and changes with slicer and send them with the gcode. It is a pita but it will not be effected. 3D printers are not really hi tech they use simple code and basic switches to run.

Technically speaking, you could keep your settings if you could guarantee that a new version of firmware stored all of its settings in exactly the same format and in exactly the same order.

There is a sane alternative.

On Linux systems there is an entire sub-directory called /etc (Editable Text Configuration) which contains various system configuration files, all in human-readable format. Here’s an excerpt from my smb.conf file:
#

All the lines beginning with # are ignored by the system. Most of them are just comments telling a human what they settings do. The settings themselves take the form of
[standardised setting name] = [setting value]
So in the example above, you see there are only four actual settings:
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
wins support = no
dns proxy = no

On startup, as the system goes to configure each possible setting, it parses the SMB.conf text tile, ignoring all comment lines (#), and looks for pre-defined lines like “dns proxy”. If it finds it, it gives it the assigned value. This is easily editable by a human and completely portable from system to system, even with different operating systems.

I do not know enough about firmware for 3D printers to know if such a system is in use, but I do seem to recall seeing some discussion about configuration files being stored on an SD card. I’ll admit that since I wasn’t interested in changing the firmware, I simply glossed over the messages that mentioned this, so I may have it completely out of context.

I’ll leave it for those more familiar with it to comment on if and how this is being done and if there’s a way for an end-user to make use of it.

LEGOManiac and kitedemon, thanks so much for your feedback/opinions on this.
We all know to use Marlin or whichever software to place settings into and operate our 3D printers. We configure the settings in Marlin, ‘compile’, then, place the successfully ‘compiled’ file onto a microsd card, place the card in the MB, bootup the printer, wait a few minutes, do an EEPROM ‘reset’ (lose ALL our calibration settings), then, ‘Save’ to EEPROM. Turn off the printer, remove the card, delete the .cur file (was .bin) from the card, then, put the card back in the MB. Turn on the printer which now has the latest updates from Marlin.
My understanding is the card is being placed into the MB in case the firmware needs to use it temporarily. From what I understand we must remove the .cur file from the card or the printer will try to upload the file everytime you turn the printer ‘on’. Makes no sense because the printer should be looking for a .bin file to update, NOT a .cur file. Anyway, I do that just in case. That’s all fine a dandy.
Now we watch YT vids by Teaching Tech, Chris’s Basement and all those other wonderful contributors to our hobby. They teach us how to directly change calibration settings to the firmware (Marlin) now on our MB, via USB cable, using PRONTERFACE. An example of this is when you want to use ‘linear advance’ (LA), but to use LA you MUST do some changes in Marlin such as ‘uncomment’ LA and other changes in your Slicer.
What they DON’T tell you is YOU MUST REFLECT these changes in Marlin, because if you don’t you’ll lose all your calibrations settings with your next firmware (Marlin) update.
What I did this morning was via Pronterface sent an M503, got all my settings, opened Marlin and made all those changes in Marlin, compiled, updated my MB by ‘resetting and saving’.
So it’s beyond me as to ‘why’ these experienced users would should us how to make changes using Pronterface BUT they don’t tell you that you should reflect those changes in Marlin?
Hopefully, my calibrations are all good but I’ll have to check them to be sure.

Many, if not most, configuration settings can be set with GCode commands. One strategy would be to customise your settings using GCode via the USB port rather than the printer’s control panel. As you make your tweaks, copy the gcode to a text file on your computer. Somthing like Config_E5Pro_June.27.2010.gcode. If you ever need to update the firmware, just run the entire gcode file (which could end with M500 to automatically save). You’ll still have to run it every time the firmware changes, but at least the process will be automated. The tedious part is learning the GCodes that correspond to control panel settings.

Absolutely! I saw a similar example of that being used on YT. The fellow uses ‘M211 S0’ to disable endstops via the sd card. If he has to disable the endstops when calibrating ‘home’ or whatever, he runs that print and the endstops are effectively disabled. I tried it and it works, so there are different ways to get GCodes to the printer. Pronterface is good for this. I placed a gcode in my slicer ‘Start GCode’ window which will allow me to change linear advance if need be when changing filament types. I’ll see how that goes as I try different filaments and check their attributes. So for now the solution to my problem is any changes made to printer calibrations should also be reflected in Marlin so future Marlin updates to the printer won’t affect any adjustments performed since the last update. I hope you get the gist of my meaning?

For firmware, personally I never update anything unless there’s something critical or something I want it to do that it couldn’t before. The printer is far too busy to have the rug pulled out from under it every time there’s an update. I only just learned there is an ini file for the screen on my printer that also has settings that modify what the printer does.

I always do the updates to the Prusa, they usually are useful and always quick and painless. Download the update connect the printer and using Prusaslicer update firmware. It takes 5 mins and then it is good to go. The sidewinder I just include what I want in start / end gcode and leaver the firmware on the printer alone.

I don’t normally update firmware unless there’s something so substantially amazing that it would be silly not to. The reason behind my updates is basically because I upgraded the guts to the point that the firmware had to be changed. I had to learn all about how to use Marlin, motherboard connections, funny wiring of the old MB, drivers, updating firmware, etc. Yeah, that screen firmware screwed me up too but once I knew it was there things were fine. Note how easy it is to make changes and update the screen firmware.

Im in the learning process of fine tuning ny firmware. Ibe got a working version for my MB, (robin lite) but even though ive double checked my eeprom is enabled, it dosent want to save if i reset the printer.

So im now recompiling 2.0.9 to see if i had a random issue with 2.0.8

If you run into any bugs keep us posted and ill be happy to try and see if i can help you through it aswell :slight_smile:

Hi Dr. Marvin, make sure the EEPROM is ‘uncommented’ in Marlin. During the upgrade of my 3D printer I installed the latest version of Marlin 2.0 ‘bugfix’ at the time. I used ‘bugfix’ as recommended by respectable YouTubers (Chris Basement, Teaching Tech, Dr.Vax, Makers Muze, etc). I ran into problems because I didn’t know the EEPROM wasn’t ‘active’ in Marlin by default, nor did I know about the TFT firmware. Once I lost time researching all this stuff and noticed new versions of Marlin 2.0.9.1 and TFT firmware were available I installed those. Things seem to settle down and I’ve finally my printer working again. The only thing that bothers me is I’d get a ‘beep’ when ‘save to EEPROM’, and now I don’t. Again, I must ‘assume’ the “save” succeeded. Thanks for being there for me and I’ll try to help also those who may face the same frustrations I had.

1 Like