- Wed Dec 30, 2015 1:25 pm
#37493
When browsing through your examples, I spotted a "weird" address for irom0_0_seg. This probably means I've missed something somewhere
For my "normal" (non-bootloader) images, I have the irom0_0_seg start at 0x40210000. The rationale is that 0x40200000 would be virtually subtracted when flashing over the UART. The layout of the image would then be, if I understand correctly,
1: header of unknown size
2: contents of the iram segment, consisting of 32 kbytes
3: 32 kbyte of padding over an area apparently designated as cache
4: the contents of the irom section
I was assuming that means you can't use the first 64 kbytes (0x10000) for irom and you need to pad over them in this way. This seems to work
But your starting the irom segment at 0x40202010, which is only 8kb+10b above "zero". Does this mean:
- we could start the irom segment actually at 0x4020000 (without boot loader) and the code would neatly end up at the first flash address instead of iram?
- the 8kb+10 mentioned above is the size of the boot loader we need to skip over
I was under the impression that the 64k of the "flash image" would always end up at 0x40100000 and the rest would end up at 0x40200000, which is nonsense of course, because you cannot flash to iram, it is copied there by the boot loader on startup.
So what is really happening? The boot loader just copies the first 32k from the SPI to iram and the first address above that (which would be 0x40208000 then) could be used for the first symbol in the irom segment, right? Which would mean I am now "wasting" 32kb by padding up to 0x10000 (which isn't a big deal anyway).
But still then, I don't understand the irom segment address of 0x40202010 you're using, I would expect it to be at 0x40208000 or higher. Are you using only 8208 bytes of iram? (after some thinking) I remember having read somewhere that you reversed the layout of the image. Irom0 first, then at the final 32k the iram segment right? So the 8208 bytes at the start are really the boot loader + config and not iram, right?
You see, I'd like to be prepared before starting on something
Thanks for your help!