I have an ESP8266 in a project. It's specifically this ESP8266 SMT Module - ESP-12F item. It's been working great with OTA, but I realized belatedly that I didn't change the flash settings when I started compiling through the Arduino IDE several versions ago. I had been using the setting "1 MB (FS:64KB OTA:~470KB)", and I've updated OTA over multiple versions with the same basic structure of firmware and using the same server-side set-up.
I can no longer update with that setting because my compiled sketch is now over the OTA size limit. My chip actually has 4 MB, however, so this limit is artificial. I tried changing to "4 MB (FS:2 MB OTA:~1019KB)", and that works under the following test conditions:
- I compile the "old" program with the 4-MB settings and I re-upload the old program via wired connection.
- I compile the "new" program that's to come via OTA with those same 4-MB settings.
That's fine for a test, but I already have one of these chips "deployed" in a location where it's hard to access it. I'd like to update that deployed chip OTA while also changing the flash partition. I'm willing to lose any files stored outside of the program itself. So I'd like instead to have:
- A deployed, OTA-enabled chip with firmware running on the 1-MB partition structure noted above:
- (Any intermediate step needed)
- OTA update to new firmware that has been compiled with the 4-MB partition structure.
I'm willing to upload a dummy sketch at "Any intermediate step needed" to work around the current size of the sketch, but, after some experimentation, OTA seems to fail when the partition structure is different regardless of the size of the binary.
That's consistent with #2 in the answer here: esp8266 OTA issue, but that older question took a different direction with the OP and the #2 point there is stated without any detail. I understand that in a broad sense, the prior answer covers my case, but I'm looking for more detail on the specific aspect of the flash partition settings. Especially for these related questions:
- Is there any work-around strategy available to change the flash partitioning between different versions served OTA?
- If no, is the limitation determined by the software in the current OTA framework in the public libraries, or is it somehow fundamental to how the program is laid out in the hardware memory?
In theory at least, it seems like I ought to be able to force the new program to be written OTA at the same location that it would have been written had the old program also had the 4-MB partition. (Again noting that I'm willing to lose any other data in the flash to make this update work.)