colorchord icon indicating copy to clipboard operation
colorchord copied to clipboard

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

Open brik2k opened this issue 8 years ago • 4 comments

Hi, I'm a newb trying to get colorchord embedded running on an esp8266. When I try to build the project I get the following errors. I'm using sdk 1.5.4.1.

../esp8266/esp-open-sdk/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: image.elf section .text' will not fit in regioniram1_0_seg' Makefile:72: recipe for target 'image.elf' failed ../esp8266/esp-open-sdk/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: region `iram1_0_seg' overflowed by 1956 bytes

Any thoughts? Thanks

brik2k avatar Jul 18 '16 18:07 brik2k

Haha, I was literally writing out this same issue, but checked again before hitting submit, and this appeared.

SDK's 1.5.2 and higher are a bit too big for the IRAM segment. Quick answer is to download SDK 1.5.1 and build against that. http://bbs.espressif.com/viewtopic.php?f=46&t=1609

pelrun avatar Jul 18 '16 18:07 pelrun

Using 1.5.1 did the trick. Thanks for the suggestion!

brik2k avatar Jul 19 '16 18:07 brik2k

this is really annoying. I don't know many places to keep cutting bytes, I don't know why Espressif thinks its okay to keep growing their SDK without a mechanism of cutting out features.

cnlohr avatar Jul 20 '16 19:07 cnlohr

Actually, I think there's a problem with how you're including the SDK libraries - since there's a bunch of circular references present, you're including some libs multiple times, but that's likely to be including multiple copies into the final binary!

Instead, ld lets you specify a group of libs that are repeatedly scanned until all the references are resolved. I managed to build against 1.5.4 without errors (although I haven't tested it on my board yet) by using the following in the LDFLAGS_CORE variable:

-nostdlib -Wl,--start-group -lmain -lnet80211 -lcrypto -lssl -lwpa -llwip -lpp -lphy -Wl,--end-group -lgcc

pelrun avatar Aug 02 '16 17:08 pelrun