-->
Page 1 of 1

Section `.text' will not fit in region `iram1_0_seg'

PostPosted: Tue Dec 29, 2015 12:00 pm
by dubbaluga
Hi,

when linking an application for the ESP8266 using the xtensa toolchain (GCC) I get the following error message:

Code: Select all/home/user/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: src/ARTApp/ARTApp.out section `.text' will not fit in region `iram1_0_seg'


What can I do to solve this problem?

Please do not get confused because of the "arduino" in the given path. I am just using the toolchain, but not the framework. However, the code I am compiling/linking here is some existing code that does not state any specific linkage. My glue code has the typical entry point:

Code: Select allvoid ICACHE_FLASH_ATTR user_init()
{
    /* calling my code here */
}


Do I have to provide the ICACHE_FLASH_ATTR to all my functions in oder to make them go into flash memory?

Thanks for any hints and your help in advance!
Rainer

Re: Section `.text' will not fit in region `iram1_0_seg'

PostPosted: Thu Dec 31, 2015 10:49 am
by dkinzer
dubbaluga wrote:Do I have to provide the ICACHE_FLASH_ATTR to all my functions in oder to make them go into flash memory?
If you are going to use the Arduino code then you must fully understand the Arduino build process including the specialized linker scripts that they use. The Arduino functions aren't adorned with ICACHE_FLASH_ATTR so, without other steps taken, all of the functions are destined for iram1_0_seg.

You may be able to fix the issue by copying parts of the Arduino linker scripts to your linker script.

Re: Section `.text' will not fit in region `iram1_0_seg'

PostPosted: Thu Dec 31, 2015 5:14 pm
by mianos
In particular check the .ld file you have to make sure you have the .irom0.text blocks
If you know the symbols you can also get them out of the .ram and into the irom with something like this:


Code: Select all  .irom0.text : ALIGN(4)
    {
        _irom0_text_start = ABSOLUTE(.);
        *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)

        *mylib/*.o*(.literal* .text*)
        *blahnewmodule.o(.literal*, .text*)