[esp8266] builder tools CheckUploadSize ignores board_upload.maximum_size override in platformio.ini

:dizzy_face:

The more I dig, the deeper down the rabbit hole I go…

Unbeknownst to me, while the ESP has 4MB of flash, it is only capable of running a 1MB program due to

a hardware limitation in the ESP because it is the max size of code mem that can be mapped from the flash. [1]

My efforts to extend the maximum size in the Memory Usage report are for naught, as the current linker scripts for the ESP8266 correctly report a 1MB-4kB size limit, and on a ESP8266 with 4MB of flash, there’s an unsused 1MB section to be found for either serial/OTA updates.

So ends this session of nerd sniping.

[1]: Investigate breaking the max sketch size limit · Issue #6681 · esp8266/Arduino · GitHub