Compile problem
Compile problem
Postby alexchang » Mon Apr 27, 2015 12:15 am
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: build/app.out section `.text' will not fit in region `iram1_0_seg'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-mallocr.o):(.literal+0x24): undefined reference to `_sbrk_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-mallocr.o): In function `malloc_extend_top':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:2165: undefined reference to `_sbrk_r'
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:2202: undefined reference to `_sbrk_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-abort.o):(.literal+0x0): undefined reference to `_exit'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-abort.o): In function `abort':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/abort.c:63: undefined reference to `_exit'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-freer.o): In function `_malloc_trim_r':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:3325: undefined reference to `_sbrk_r'
C:/Espressif/examples/eco_plug/Makefile:227: recipe for target 'build/app.out' failed
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:3332: undefined reference to `_sbrk_r'
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:3340: undefined reference to `_sbrk_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-makebuf.o):(.literal+0x8): undefined reference to `_fstat_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-makebuf.o): In function `__smakebuf_r':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdio/../../../../../newlib/libc/stdio/makebuf.c:59: undefined reference to `_fstat_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-signal.o):(.literal+0x0): undefined reference to `_getpid_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-signal.o):(.literal+0x4): undefined reference to `_kill_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-signal.o): In function `_raise_r':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\signal/../../../../../newlib/libc/signal/signal.c:163: undefined reference to `_getpid_r'
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\signal/../../../../../newlib/libc/signal/signal.c:163: undefined reference to `_kill_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-stdio.o):(.literal+0x0): undefined reference to `_read_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-stdio.o):(.literal+0x4): undefined reference to `_lseek_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-stdio.o):(.literal+0x8): undefined reference to `_write_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-stdio.o):(.literal+0xc): undefined reference to `_close_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-stdio.o): In function `__sread':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdio/../../../../../newlib/libc/stdio/stdio.c:48: undefined reference to `_read_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-stdio.o): In function `__swrite':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdio/../../../../../newlib/libc/stdio/stdio.c:89: undefined reference to `_lseek_r'
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdio/../../../../../newlib/libc/stdio/stdio.c:97: undefined reference to `_write_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-stdio.o): In function `__sseek':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdio/../../../../../newlib/libc/stdio/stdio.c:117: undefined reference to `_lseek_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-stdio.o): In function `__sclose':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdio/../../../../../newlib/libc/stdio/stdio.c:135: undefined reference to `_close_r'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(isatty.o): In function `_isatty_r':
d:\Neo\Project\ESP8266\DevKit\build\compiler\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\sys\xtensa/../../../../../../newlib/libc/sys/xtensa/isatty.c:13: undefined reference to `_fstat_r'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe: *** [build/app.out] Error 1
00:08:25 Build Finished (took 10s.196ms)
Re: Compile problem
Postby mculibrk » Mon Apr 27, 2015 1:09 am
Maybe your code is too big so some variables/functions cannot be linked in and so "missing" and generating a lot of errors.
Code: Select all
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: build/app.out section `.text' will not fit in region `iram1_0_seg
Re: Compile problem
Postby grantgao » Mon Apr 27, 2015 10:17 am
firstly,you need a bigger size flash ,
secondly,extensa compile can not support some std c function yet,such as file read/write/seek operation,so you need remove this function call from your code,or you can reconstruct them yourself.
hope these infomation can help you.
ps:find out all keywords like "seek" "open" "close" from your code
PS:hope espressif can resolve this complie issue asap,and explain why...
Re: Compile problem
Postby grantgao » Mon Apr 27, 2015 10:20 am
grantgao wrote:this problem can be resolved by two ways,
firstly,you need a bigger size flash ,
secondly,extensa compile can not support some std c function yet,such as file read/write/seek operation,so you need remove this function call from your code,or you can reconstruct them yourself.
hope these infomation can help you.
ps:find out all keywords like "seek" "open" "close" from your code
PS:hope espressif can resolve this complie issue asap,and explain why...
forgot one most important infomation,remove std c header include file from your code,such as "#include <stdio.h>"
Re: Compile problem
Postby alexchang » Mon Apr 27, 2015 10:45 am
enum wsFrameType { // errors starting from 0xF0
WS_EMPTY_FRAME = 0xF0,
WS_ERROR_FRAME = 0xF1,
WS_INCOMPLETE_FRAME = 0xF2,
WS_TEXT_FRAME = 0x01,
WS_BINARY_FRAME = 0x02,
WS_PING_FRAME = 0x09,
WS_PONG_FRAME = 0x0A,
WS_OPENING_FRAME = 0xF3,
WS_CLOSING_FRAME = 0x08
};
void ICACHE_FLASH_ATTR wsMakeFrame(const uint8_t *data, size_t dataLength, uint8_t *outFrame, size_t *outLength, enum wsFrameType frameType)
{
assert(outFrame && *outLength);
assert(frameType < 0x10);
if (dataLength > 0)
assert(data);
outFrame[0] = 0x80 | frameType;
if (dataLength <= 125) {
outFrame[1] = dataLength;
*outLength = 2;
//} else if (dataLength <= 0xFFFF) {
// outFrame[1] = 126;
// uint16_t payloadLength16b = (uint16_t) dataLength; //htons(dataLength);
// memcpy(&outFrame[2], &payloadLength16b, 2);
// *outLength = 4;
} else {
//assert(dataLength <= 0xFFFF);
assert(dataLength <= 125);
// implementation for 64bit systems
//outFrame[1] = 127;
//dataLength = htonll(dataLength);
//memcpy(&outFrame[2], &dataLength, 8);
//*outLength = 10;
}
memcpy(&outFrame[*outLength], data, dataLength);
*outLength+= dataLength;
}
but after comment this function, not much left:
Section info:
build/app.out: file format elf32-xtensa-le
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000db4 3ffe8000 3ffe8000 000000e0 2**4
CONTENTS, ALLOC, LOAD, DATA
1 .rodata 0000174c 3ffe8dc0 3ffe8dc0 00000ea0 2**4
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .bss 000095b0 3ffea510 3ffea510 000025f0 2**4
ALLOC
3 .text 000077be 40100000 40100000 000025ec 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
4 .irom0.text 0002b254 40201010 40201010 00009db0 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
------------------------------------------------------------------------------
Section info:
Section| Description| Start (hex)| End (hex)|Used space
------------------------------------------------------------------------------
data| Initialized Data (RAM)| 3FFE8000| 3FFE8DB4| 3508
rodata| ReadOnly Data (RAM)| 3FFE8DC0| 3FFEA50C| 5964
bss| Uninitialized Data (RAM)| 3FFEA510| 3FFF3AC0| 38320
text| Cached Code (IRAM)| 40100000| 401077BE| 30654
irom0_text| Uncached Code (SPI)| 40201010| 4022C264| 176724
Total Used RAM : 47792
Free RAM : 34128
Free IRam : 2132
------------------------------------------------------------------------------
Re: Compile problem
Postby alexchang » Mon Apr 27, 2015 3:30 pm
Who is online
Users browsing this forum: No registered users and 148 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.