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

User avatar
By eriksl
#23848 Yes, confirmed (nodemcu). I only think they got the size wrong, you're never going to have the whole 512 kb for yourself, if I understand correctly, you should subtract the 0x00000 firmware size and also some room for non-volatile storage. I am going to try it with a more conservative size.

/* This linker script generated from xt-genldscripts.tpp for LSP . */
/* Linker Script for ld -N */
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40210000, len = 0x80000
}
User avatar
By eriksl
#23852 On the other hand, they seem to have made special provisions:

ENTRY(call_user_start) -> ENTRY(user_start_trampoline)

The trampoline is for correctly handling constants that they moved from iram to irom, so no concern, I just learn from their git log.
User avatar
By eriksl
#23854 Yes!!!! I've done it!

The confusion was all in the sdk loader script always loading the irom region in the upper half of the SPI flash. Now it makes perfect sense.

I now load to 0x10000, I store my nv settings to 0x7a000 and it works just fine. Let's see if it keeps that way...

I had some trouble at first. Appears I still had some non volatile storage at 0x3c(000). Strange crashes. I moved that to 0x7a(000) and that seems to help. AFAIK the system nv is at 0x7c(000), so I should be fine I guess.

I set the start of the region to 0x10000 and the length to 0x7c000 - 0x10000, which afaik should exactly cover the size this way and is still a whopping 424 kilobytes!

Both of you thanks for sharing and helping me!