Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By igrr
#25836 This suggestion will most certainly not work (in the sense that you will not be able to put any code above 1M mark - linker will report an error).

The reason code space is limited to the first 1M is that only 1M of flash may be mapped into CPU address space at a time. Therefore for modules with flash chip size above 1M, we keep lower 1M for code and everything above that for file system.

So for 2M device the only layout which makes sense is 1M code + 1M FS, for 4M device it's 1M code + 3M FS.

Edit:
Also please note that values in boards.txt (like max. upload size, FS size and offset) do not affect compilation. They are only provided to be passed to other tools (like mkspiffs). Values which do affect compilation are defined in linker scripts.
User avatar
By martinayotte
#25842 Do you means the same values provided in the boards.txt are also somewhere located as #define in the code ?
For the code size, do you know if that limitation is in the ESP hardware, in the SDK, or in ArduinoIDE ?
If this limit is can't be workarounded, do you think we can at least have some kind of bank switching with a common part of the code duplicated in each banks ?
User avatar
By igrr
#25872 The values which are used for code generation are located in the linker script files:
https://github.com/esp8266/Arduino/tree ... ols/sdk/ld

Memory mapping limitation is a hardware one. You could work around it by switching 1M banks, but I have yet to see a real use case for this (anybody got sketch size above 500k?)
User avatar
By martinayotte
#25892 OK ! Thanks for explanations !

For bank switching, even if sketches are not reach the limit, that feature would be nice to switch between different firmware version. Currently, many OTA are splitting the 1M into to sub-blocks, which reduced even more this limit.