HomeACcessoryKid / ESP8266-HomeKit-Demo

User part of the ESP8266-HomeKit foundation
https://www.youtube.com/watch?v=Xnr-utWDIR8
Apache License 2.0
125 stars 27 forks source link

section `.irom0.text' will not fit in region `irom0_0_seg' #25

Closed supersjimmie closed 7 years ago

supersjimmie commented 7 years ago

I tried to prepare my environment to build this Demo. Since I am not very experienced with linux compiling, I hope my problem is easy for somebody else...

I start with:

jimmy@LTJimmy:~/ESP8266_RTOS_SDK/ESP8266-HomeKit-Demo/Demo$ ./gen_misc.sh
based on gen_misc.sh version 20150911

SDK_PATH:
/home/jimmy/ESP8266_RTOS_SDK

BIN_PATH:
/home/jimmy/ESP8266_BIN

Please check SDK_PATH & BIN_PATH, enter (Y/y) to continue:
y

Please follow below steps(1-5) to generate specific bin(s):
STEP 1: use boot_v1.2+ by default
boot mode: new

STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
enter (0/1/2, default 0):

ignore boot
generate bin: eagle.flash.bin+eagle.irom0text.bin

STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
enter (0/1/2/3, default 2):

spi speed: 40 MHz

STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
enter (0/1/2/3, default 0):

spi mode: QIO

STEP 5: choose spi size and map
    0= 512KB( 256KB+ 256KB)
    2=1024KB( 512KB+ 512KB)
    3=2048KB( 512KB+ 512KB)
    4=4096KB( 512KB+ 512KB)
    5=2048KB(1024KB+1024KB)
    6=4096KB(1024KB+1024KB)
enter (0/2/3/4/5/6, default 0):
4
spi size: 4096KB
spi ota map:  512KB + 512KB

start...

The error is:

xtensa-lx106-elf-gcc  -L/home/jimmy/ESP8266_RTOS_SDK/lib -Wl,--gc-sections -nostdlib -T/home/jimmy/ESP8266_RTOS_SDK/ld/eagle.app.v6.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lcirom -lcrypto -lespconn -lespnow -lfreertos -lgcc -lhal -ljson -llwip -lmain -lmesh -lmirom -lnet80211 -lnopoll -lphy -lpp -lpwm -lsmartconfig -lspiffs -lssl -lwpa -lwps -lhkc user/.output/eagle/debug/lib/libuser.a driver/.output/eagle/debug/lib/libdriver.a -Wl,--end-group -o .output/eagle/debug/image/eagle.app.v6.out
/home/jimmy/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: .output/eagle/debug/image/eagle.app.v6.out section `.irom0.text' will not fit in region `irom0_0_seg'
collect2: error: ld returned 1 exit status
/home/jimmy/ESP8266_RTOS_SDK/Makefile:403: recept voor doel '.output/eagle/debug/image/eagle.app.v6.out' is mislukt
make: *** [.output/eagle/debug/image/eagle.app.v6.out] Fout 1

My appologies for the messages being parially in Dutch. I think in English it's like:

/home/jimmy/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: .output/eagle/debug/image/eagle.app.v6.out section `.irom0.text' will not fit in region `irom0_0_seg'
collect2: error: ld returned 1 exit status
/home/jimmy/ESP8266_RTOS_SDK/Makefile:403: recipy for target '.output/eagle/debug/image/eagle.app.v6.out' has failed
make: *** [.output/eagle/debug/image/eagle.app.v6.out] Error 1
supersjimmie commented 7 years ago

Hmm, issue #9 gave me a clue, and then I found a line saying:

Note that additional src files should be removed to prevent excess irom size

I guess I have to figure out what is meant by the 4 lines regarding WolfSSL...

supersjimmie commented 7 years ago

I am sorry but I really tried to understand this part:

wolfSSL

Included (src,hdr) is a subsection of the wolfSSL 3.9.8 distribution for convenience.
We had to change 3 files which will be documented below the file tree.
Please download your own copy and verify the equality of the files (*.0 is original)
Note that additional src files should be removed to prevent excess irom size.

When I try the gen_misc.sh, I get:

user_main.c:59:17: fatal error: hkc.h: No such file or directory
 #include "hkc.h"
                 ^
compilation terminated.

There must be missing something around that Wolf thing, right? Normally I should have to make the wolf stuff, what do I have to do with the included files? Things like

./configure
make
sudo make install

Don't seem to work. :(

What am I expected to do with the line saying additional src files should be removed? And what else is needed to get wolfssl working?

supersjimmie commented 7 years ago

Continuing my search for a solution, but not found yet.

I see that ESP8266-HomeKit$ ./deploy.sh creates the files: deployed lib/libhkc.a and include/hkc.h. This seems to be working fine. But then I go to the ESP8266-HomeKit-Demo/Demo and run ./gen_misc.sh, which fails because it cannot find hkc.h

user_main.c:59:17: fatal error: hkc.h: No such file or directory
 #include "hkc.h"
supersjimmie commented 7 years ago

Oh boy... Now I found that I had the export SDK_PATH= set wrong, that seems to solve the hkc.h issue. But then I am back to the will not fit issue.

supersjimmie commented 7 years ago

And then I found another missing part (for me). Since I was not able to find it in the other issue #9 I think it may be nice for others who run into this, you need to do this before compiling, while it is mentioned after the compiling: To address this it is needed to change the ESP8266_RTOS_SDK/ld/eagle.app.v6.ld file