EEPROM datasize error on stock firmware

I’m trying to flash my MPCNC back to stock. I downloaded the file at https://github.com/V1EngineeringInc/MarlinBuilder/releases/download/515/V1CNC_SkrPro_Dual_2209-2.1.1.zip, copied the .bin file in the ZIP to my microSD card, ejected the card, inserted it in the microSD slot in my SKR Pro 1.2, and powered it up. After booting, I get two beeps and an error: “EEPROM datasize error”.

The issue recurs if I reformat the card to FAT32, copy the bin file fresh, and repeat the process.

Do I need to compile the stock firmware via Platformio into its own bin file to get this to work?

You may need to unzip the bin file to your computer, rather than just copying it from the zip file.

Also, what size is your SD card? (must be < 32GB)

Dumb q but I’m unzipping the file to my computer, then copying just the bin to the card. Did I get something wrong in that?

The card is 32gb on the nose, should I track down a smaller one?

The eeprom probably just needs to be reset to defaults. The eeprom layout probably changed between versions.

M502 will fill the settings from the code.
M500 will save the current settings to the eeprom.

Doing those two things and rebooting will clear the error. You will lose any custom settings you have chosen differently than the stock code. But I think that’s what you want anyway.

1 Like

So I should run M502 and M500, then reboot and reflash with the bin file? Or just run the commands and reboot?

No, that is the right way. Sometimes the OS may let you explore the zip file without unzipping it, and then copy and paste one or more of the contained files, which may or may not be usable.

Sounds like that is not the issue here.

Just the commands and reboot. I think the reflash worked fine. You can confirm the firmware version with M115

Because I have a minute and it is interesting to me, I will go into more detail.

The code gets compiled into the .bin. that is the firmware. There are settings like the default max feedrate that are set in the code and baked into the firmware.

But there are a bunch of settings you can change. Like max feedrate. When the machine shuts down and reboots, it needs to get a copy from persistent storage. The only storage on these chips is in the EEPROM. They are like a hard drive. The EEPROM doesn’t get rewritten when you reflash the .bin.

When the firmware boots up, it reads from the EEPROM into the running program (the memory). When you change a setting with gcode, it changes this running copy of the settings.

So there are three copies of the settings. A hard copy in the firmware. That only changes when you recompile the code. A copy that is in the eeprom that is saved when you cut power. And a third copy in the running program that gets deleted whenever you power it off.

The EEPROM error is saying that the firmware tried to read the settings from EEPROM, but they were not in the right format. Probably because they were written by a different firmware.

M502 copies the hard copy settings from firmware into running program. M500 writes the settings into the EEPROM. When you reboot, they will be the right size for the firmware you have.

3 Likes

Sounds similar to a car eeprom when you alter it and don’t checksum the file.
Thanks for explaining.

1 Like

Ran M502, then M500, and rebooted. When I run M115 from Settings → Machine → Terminal, nothing happens. I inserted the microSD with the firmware.bin and powered on, no beeps or anything. The MPCNC does move, so it at least responds, so I’m hoping that the datasize issue at least got cleared.

I’ll have my hands on a 4gb microSD card in the next day or so and will redo everything with it, just to be sure.