So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By siwinter
#79482 I use Arduino IDE and the library ESP8266HTTPUpdateServer to upload new firmware via OTA, what normally works perfect for me.
But once I got the error output: "Update error: ERROR[8]: Flash config wrong real: 4194304 IDE: 16777216"
After that error had occurred I was not able to upload any new firmware regardless of IDE settings. I used "Generic ESP8266 module" and tried all flash sizes.

Obviously the error code is set in the begin-method of the UpdaterClass, where ESP.checkFlashConfig() is called to compare a "magicFlashChipSize" with the "FlashChipRealSize". I suppose the intention is to find out out whether the new firmware fits into the flash. But it seems to me, that this "magicFlashChipSize" is calculated from one byte the old, already running firmware, instead of the new one.
And indeed after I could successfully upload a firmware, compiled with wrong settings (flash size to big for the device), via serial port, I was able reproduce the issue. The bootloader seems to be more tolerant to wrong configured sketches.

I do not know how the disturbing byte came to my device's flash, but imho calling ESP.checkFlashConfig() is at least unnecessary at the begin of the upload.
If anybody with more experience would verify my observation the call may be could be deleted to prevent the disturbing behavior I had to deal with.