236 kbyte limit on 4M flash?
236 kbyte limit on 4M flash?
Postby eriksl » Tue Jul 21, 2015 5:36 pm
Hello,
I am running into the problem that apparently my firmware is getting too large. There are no linker warnings, but the esp8266 simply won't start. No UART output as well, nothing. If I reduce the total firmware size (iram+irom) to exactly 236 kbyte, it works normally. Add a few bytes above the 236 kbyte, it fails.
Is this a know problem or is it normal behaviour, can it be fixed?
I do realise that at the point of flashing/storing the firmware all of the .text, .text_irom0, .rodata and .data sections must be stored into the flash. Is that the reason? My iram firmware file is 43 k (which apparently can fit in 32 k when run, no problems there, metadata?) and my irom firmware is 192 k now.
Thanks.
I am running into the problem that apparently my firmware is getting too large. There are no linker warnings, but the esp8266 simply won't start. No UART output as well, nothing. If I reduce the total firmware size (iram+irom) to exactly 236 kbyte, it works normally. Add a few bytes above the 236 kbyte, it fails.
Is this a know problem or is it normal behaviour, can it be fixed?
I do realise that at the point of flashing/storing the firmware all of the .text, .text_irom0, .rodata and .data sections must be stored into the flash. Is that the reason? My iram firmware file is 43 k (which apparently can fit in 32 k when run, no problems there, metadata?) and my irom firmware is 192 k now.
Thanks.
Re: 236 kbyte limit on 4M flash?
Postby ESP_Faye » Tue Jul 21, 2015 5:51 pm
Hi,
1. What are your bin files, eagle.flash.bin + eagle.irom0text.bin , or user1.bin ?
Did you choose 4096KB in STEP5 while compiling ?
2. Do you add ICACHE_FLASH_ATTR before your functions ?
1. What are your bin files, eagle.flash.bin + eagle.irom0text.bin , or user1.bin ?
Did you choose 4096KB in STEP5 while compiling ?
2. Do you add ICACHE_FLASH_ATTR before your functions ?
Code: Select all
void ICACHE_FLASH_ATTR
user_esp_platform_init(void)
{
... ...
}
Re: 236 kbyte limit on 4M flash?
Postby eriksl » Tue Jul 21, 2015 6:02 pm
Espressif_Faye wrote:1. What are your bin files, eagle.flash.bin + eagle.irom0text.bin , or user1.bin ?
Did you choose 4096KB in STEP5 while compiling ?
The firmware files are "eagle.flash.bin + eagle.irom0text.bin" style.
The firmwares are made for 4M (256+256) layout, if you mean that.
2. Do you add ICACHE_FLASH_ATTR before your functions ?
If I would have forgotten that, I would have run out or iram very long ago. Almost every code is section .irom0.text. That is why this section/firmware ("eagle.irom0text.bin") is so large. This is NOT the problem. The problem is the .irom0.text (irom) section getting large, not the .text (iram) section. The linker script I can use 0x3c000 bytes (about 224 kbytes) and therefore it doesn't give an error. Still I can't make irom firmware files that are larger than 192 kbytes -> crash.
Re: 236 kbyte limit on 4M flash?
Postby eriksl » Wed Jul 22, 2015 2:27 pm
I already solved the problem. I managed to use almost all of the 4 Mbits (c.q. 512 Mbyte) by adjusting the irom.text region to from 0x40000 to 0x10000. It's not at all clear to me why the supplied loader scripts have the irom.text region at 0x40000 which is halfway the memory.
My original problem was that during flashing the address wrapped around so the last bytes of the image would end up at the very start of the memory.
My original problem was that during flashing the address wrapped around so the last bytes of the image would end up at the very start of the memory.
Who is online
Users browsing this forum: No registered users and 81 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.