- Mon Jan 18, 2016 5:59 am
#39138
To sum it up, in case someone else needs this info; this applies to the 4MBit flash modules (512 Kb), but I guess others will behave in the same manner; however, one should not reach the flash size limit as easily as with the 512 Kb module.
1. According to the "Flash Map" section in the document
2A-ESP8266__IOT_SDK_User_Manual__EN_v1.5.pdf, for a 512 Kb module, the max size for a userX.bin file is 236 Kb
2. the userX.bin files are built from flash.bin and irom0text.bin
3. irom0text.bin is limited to 172 Kb according to the eagle.app.v6.new.512.appX.ld files
4. flash.bin is expected to be max 64 Kb, but in my case it was about 32 Kb
5. this leads to a userX.bin of a maximum 204 Kb, which wastes about 32 Kb of valuable memory space
6. didn't dig too deep into the compiling and linking procedure, but it looks to me that flash.bin and irom0text.bin are both combined into an assembler text file that is then processed to get get the userX.bin file. One can conclude that as long as the "concatenation" of flash.bin and irom0text.bin stays below the 236 Kb limit, the module will behave correctly.
So ...
Once my irom0text.bin file passed the 172 Kb limit, I tried to extend it to 192 Kb by modifying the eagle.app.v6.new.512.appX.ld files (there's a "len = 0x2B0000" parameter at the beginning of the file that I changed to "len = 0x30000")
The compiler didn't complain, and the userX.bin files went past the 204 Kb limit (see [5] above).
Sucessfully flashed those to the module using both the ESP Flash Download Tool and my own custom OTA updater. The module works as expected so far.
Conclusion : One can safely increase the irom0text.bin size as long as the userX.bin stays below the 236 Kb limit (which was also stated in
this post)