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

User avatar
By eriksl
#23832
jcmvbkbc wrote:
eriksl wrote:Everything I write using esptool.py starting from 0x80000 ends up on 0x00000...

Kind of expected, given that 0x80000 is 512K, which is the size of your FLASH?

LOL of course you're right, BUT (and correct me if I'm wrong):

- iram contents are written to 0x00000 which would then end up at 0x40200000
- irom contents are written to 0x40000 which would end up at 0x40208000 I hope (= 0x40200000 + 32 k), very strange system
- following that addressing system, you'd expect the 256 kbyte boundary to be at 0x80000, although it seems silly
- anything written to 0x80000 would then hopefully end up at 0x40248000 (but apparently doesn't).

If you know a way to get *anything* written beyond the 256k boundary using esptool.py, I'd be very obliged ;)
User avatar
By jcmvbkbc
#23836
eriksl wrote:- irom contents are written to 0x40000 which would end up at 0x40208000 I hope (= 0x40200000 + 32 k), very strange system

- irom contents written to 0x40000 would end up at 0x40240000. FLASH mapping is purely linear.
User avatar
By eriksl
#23837
jcmvbkbc wrote:
eriksl wrote:- irom contents are written to 0x40000 which would end up at 0x40208000 I hope (= 0x40200000 + 32 k), very strange system

- irom contents written to 0x40000 would end up at 0x40240000. FLASH mapping is purely linear.

I'm getting more and more confused now, I hope you can clear things up.

My project produces two firmware files using esptool.py elf2image: fw-0x00000.bin and fw-0x40000.bin. The first contains everything except symbols from the .irom.text section, the second the irom.text section. In other words, the contents of the first file should be loaded into iram at start up, the second one is executed from flash itself. I guess you already knew that ;)

You say mapping is lineair, but can you explain then, why the first file is written to 0x00000.bin and the second one to 0x40000.bin, while the room (at that point still in flash) available for iram is only 32k (= 0x8000). It would be logical that the second file would be flashed to 0x8000, but it's not, it's flashed to 0x40000, leaving an unused gap of 224 k. I don't think it works that way. I think the addresses as seen from esptool have special meanings and are not linear at all. And that is why I'd expect the addresses beyond 256k to be starting from 0x80000 (= 0x40000 (irom) + 256k).