Arduino: Compiler error: section `.text' will not fit in region `iram1_0_seg'

Created on 5 Feb 2016  Â·  22Comments  Â·  Source: esp8266/Arduino

Using latest commit (b5684b4). Getting this error:

../hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe:
../ESPEasy.cpp.elf section .text' will not fit in regioniram1_0_seg'
collect2.exe: error: ld returned 1 exit status

(It was still ok with the commit from jan 30st and the sketch is unchanged)

What could be wrong?

Most helpful comment

Im sorry, I dont understand anything you talk about, what is eagle.app.v6.common.ld?? And how to "revert" to it, or what does that even mean?

All 22 comments

Which sketch produces this error?
Text section grew a bit when umm_malloc was added, but all the example
sketches can still be built successfully.

On Fri, Feb 5, 2016, 16:15 mvdbro [email protected] wrote:

Using latest commit (b5684b4
https://github.com/esp8266/Arduino/commit/b5684b464166a3c024729bfb8697d2cbfd79b249)
Getting this error:

/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin//lib/gcc/xtensa-lx106-elf/482/////xtensa-lx106-elf/bin/ldexe:
/ESPEasycppelf section text' will not fit in regioniram1_0_seg'
collect2exe: error: ld returned 1 exit status

(It was still ok with the commit from jan 30st and the sketch is unchanged)

What could be wrong?

—
Reply to this email directly or view it on GitHub
https://github.com/esp8266/Arduino/issues/1582.

hey guys, just bought my MAC 2 days ago, installed all from scratch (git + IDE 1.6.7) and got the same error with my "big" sketches

On windows ouput is

Sketch uses 367,586 bytes (35%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 47,284 bytes (57%) of dynamic memory, leaving 34,636 bytes for local variables. Maximum is 81,920 bytes.

on MAC same error

section text' will not fit in regioniram1_0_seg'  collect2exe: error: ld returned 1 exit status

Compiling sample sketch on MAC works fine

jup. I get it as well... interestingly same esp8266 folder used in platformio doesn't seem to generate the error

I changed linker script when umm_malloc was added. Platformio stores linker
scripts separately from the core, which means you are probably using the
old linker script when building with platformio.
These changes place all functions from umm_malloc.c into IRAM. If you don't
have these changes, umm_malloc goes to flash, and IRAM has more room.

On Fri, Feb 5, 2016, 17:57 sticilface [email protected] wrote:

jup. I get it as well... interestingly same esp8266 folder used in
platformio doesn't seem to generate the error

—
Reply to this email directly or view it on GitHub
https://github.com/esp8266/Arduino/issues/1582#issuecomment-180389164.

Ah, that might explain that. I'm trying to fine the culprit lib, as the examples build, but my sketch does not

Sorry, even on Windows with latest git (I was not up to date on this PC) throw this error also

Is there any quick & dirty fix we can do to be able get it working until fixed ?

Revert the change to the linker script, I guess.

On Fri, Feb 5, 2016, 20:02 Charles [email protected] wrote:

Sorry, even on Windows with latest git (I was not up to date on this PC)

Is there any quick & dirty fix we can do to be able get it working until
fixed ?

—
Reply to this email directly or view it on GitHub
https://github.com/esp8266/Arduino/issues/1582#issuecomment-180441809.

humm, that's what I thought, no incidence with new libc_replacements.c and heap.c ?

Could you guys drop me an .elf of one of your "large" sketches compiled
before these changes? I want to figure out how much space we need to free
up and what contributes to IRAM usage. Thanks.

On Fri, Feb 5, 2016, 21:07 Charles [email protected] wrote:

humm, that's what I thought, no incidence with new libc_replacements.c and
heap.c ?

—
Reply to this email directly or view it on GitHub
https://github.com/esp8266/Arduino/issues/1582#issuecomment-180474438.

You happy with one compiled with the linker changes reverted?

Yes, that one will do.

On Fri, Feb 5, 2016, 22:11 sticilface [email protected] wrote:

ah sorry i didn't see 'before the error' you happy with one compiled with
the linker changes reverted?

—
Reply to this email directly or view it on GitHub
https://github.com/esp8266/Arduino/issues/1582#issuecomment-180505388.

Sure, this one compiled with revert changes
http://hallard.me/download/sensor.ino.elf.gz

As @igrr said, I confirm that reverting back only eagle.app.v6.common.ld solved this problem

I have the very same problem right now and it started after I've switched from the boards manager installation to git installation. I wanted to play with https://github.com/Links2004/arduinoWebSockets and it needed the git version to be installed. Now my older scripts which worked with the boards manager installation are giving "section .text' will not fit in regioniram1_0_seg'" error.

Confirmed too, reverted agle.app.v6.common.ld.

I encountered an unfortunate boot loop when running 04c6609 with reverted eagle.app.v6.common.ld on one of my ESP-12:

...
Fatal exception (28):

epc1=0x40202548, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000001, depc=0x00000000
...

Two ways to fix it: choose a smaller flash size (originally at 4M (1M SPIFFS)), or roll back to 2e1be32 just before umm_malloc was added. Note, the code was running fine for a while until it suddenly started crashing on boot.

I disassembled the .elf and found that 0x40202548 is somewhere in umm_info, which gave me a clue that the crash is umm_malloc related. Not sure why umm_malloc was called if my eagle.app.v6.common.ld was reverted.

Same here : Can't compile big sketches anymore, and reverting eagle.app.v6.common.ld allows compilation, but gives Fatal exception (28): :'(

The change in 707c87f freed up approximately 520 bytes of IRAM, please give it a try.

Yes, that made the trick ! My big sketch now compiles again ! Thx a lot.

Compiles fine again. Thanks!

Im sorry, I dont understand anything you talk about, what is eagle.app.v6.common.ld?? And how to "revert" to it, or what does that even mean?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SmartSouth picture SmartSouth  Â·  3Comments

mechanic98 picture mechanic98  Â·  3Comments

Geend picture Geend  Â·  3Comments

hoacvxd picture hoacvxd  Â·  3Comments

hulkco picture hulkco  Â·  3Comments