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

scargill
Posts: 70
Joined: Sun Nov 02, 2014 8:09 pm

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

Postby scargill » Wed Oct 25, 2017 4:07 pm

Hi
At version 2.0 of the SDK I was sailing along with hundreds of bytes of RAM left for code.... and yes I put all my functions into FLASH and have taken all the usual precautions..

However, by 2.1 of the SDK I am back to square one with the old "section `.text' will not fit in region `iram1_0_seg'".

There is nothing more I can do with my code to save space.

I note however that at the bottom of the README file is something about removing RAM-using functions - as they are already in ROM....

instructions are simple enough.

cp $(TOOLCHAIN)/lib/gcc/xtensa-lx106-elf/<version>/libgcc.a .
xtensa-lx106-elf-ar -M < strip_libgcc_funcs.txt

cp $(TOOLCHAIN)/xtensa-lx106-elf/lib/libc.a .
xtensa-lx106-elf-ar -M < strip_libc_funcs.txt

However they ASSUME knowledge of MAKEFILE - and presumably a particular variety of MAKEFILE

I am using a MAKEFILE in Windows 10 using the Eclipse-based environment and haven't a CLUE where to put that info - ( also have no reference in my MAKEFILE to "TOOLCHAIN". Can anyone help.

I would include my MAKEFILE here with the attachments tool but it neither wants to accept a textfile or just the makefile itself. Here's a link to a renamed makefile (makefile.txt) if anyone has a moment to take a look... https://www.dropbox.com/s/ooaw7i2cyg3fo ... e.txt?dl=0

I'm pretty good at C but pretty poor at Makefiles unfortunately.

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

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

Postby Her Mary » Thu Oct 26, 2017 2:01 pm

Cannot open your link, maybe due to the GFW :?

If you are using any user-defined lib,when generating those libs, you can add the flags below which marked red in the makefile to save some RAM.

CCFLAGS += \
-g \
-Wpointer-arith \
-Wundef \
-Werror \
-Wl,-EL \
-fno-inline-functions \
-nostdlib \
-mlongcalls \
-mtext-section-literals \
-ffunction-sections \
-fdata-sections \

-fno-builtin-printf \
-fno-jump-tables
# -Wall

blubb
Posts: 116
Joined: Mon Jun 22, 2015 5:35 am

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

Postby blubb » Thu Oct 26, 2017 5:42 pm

Also add

-Wl,-gc-sections

to the LDFLAGS.

Who is online

Users browsing this forum: No registered users and 302 guests