-->
Page 1 of 3

`.text' will not fit in region `iram1_0_seg' - what to do?

PostPosted: Thu Dec 01, 2016 5:25 pm
by CARPP
If i try to build my project, i get this output:
xtensa-lx106-elf-gcc -Teagle.app.v6.ld segmentled.o -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -lc -Wl,--end-group -lgcc -o segmentled
/home/test/Desktop/opt/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: segmentled section `.text' will not fit in region `iram1_0_seg'
/home/test/Desktop/opt/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: region `iram1_0_seg' overflowed by 1000 bytes
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'segmentled' failed
make: *** [segmentled] Error 1



does anyone know what i do wrong or what causes this error? Any help would be very much appreciated! :)

Re: `.text' will not fit in region `iram1_0_seg' - what to d

PostPosted: Thu Dec 01, 2016 11:22 pm
by davydnorris
Have a look at my thread on building the ESP toolchain - it could be that you are using the libgcc that is built with the tools rather than the one in the SDK, and this contains functions that are in the ESP ROM. I have created a script to remove them from the library, or you can use the supplied SDK libgcc

Re: `.text' will not fit in region `iram1_0_seg' - what to d

PostPosted: Fri Dec 02, 2016 2:28 am
by CARPP
Thanks alot for your reply. I found your thread and i think that i would rather use the libgcc provided with the SDK than changing some stuff in files i am not familiar with. Could you tell me how i select the libgcc from the SDK, please?

Re: `.text' will not fit in region `iram1_0_seg' - what to d

PostPosted: Fri Dec 02, 2016 3:03 pm
by CARPP
Okay, the solution was to copy the libgcc.a file from:

esp-open-sdk/ESP8266_NONOS/lib/

to

esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5

Now everything is working fine! I can't believe it... :D