Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By nicoverduin
#5701 I know that when I build a program I get 2 binfiles (usually at 0x00000 and 0x40000) and sometimes even a third (esphttpd server with the webpages at 0x12000). But is there a specific reason why they are set at those addresses? Or even why have 2 bin files? In other words why is it not possible to just create one single BIN file where consequetive Flash memory is used?
User avatar
By brucehvn
#5887 I have that question too. I'm trying to understand more in depth what we are compiling and what the output is. When I flash the official firmware from the Google code page, it is just one file about 520K in size and I flash it at 0x00000.
User avatar
By nicoverduin
#5903 From what I understand is that the SDK libraries are loaded at 0x40000. The user program is loaded at 0x00000. However is you are using the OTA (over the air) upload function, the full code is either loaded at 0x00000 or 0x40000. Every time a new version is flashed, the start addresses are switched thus if it fails there is still an original version available. It also means that user code is limited to only about 64K.
User avatar
By brucehvn
#5912
nicoverduin wrote:From what I understand is that the SDK libraries are loaded at 0x40000. The user program is loaded at 0x00000.


Yes, that's my understanding of the addresses as well. But that's why I'm confused when manually loading an official firmware. The size is around 520K, which is 0x7EF40. Loading it at 0x00000 would make it extend into the 0x40000 range. So, I'm not sure what it's putting into that user program space. As an experiment, I've tried manually loading the official firmware at 0x40000, but that didn't work.

But I guess that answers your question about whether the firmware could be just one big file instead of 2 or 3. That appears to be what they do with the official firmware.