Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Patriko
#23059 Hi!

After updating SDK from 1.0 to 1.2 I got:

Code: Select allc:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc  -L../lib -nostdlib -T../ld/eagle.app.v6.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -llwip -lmain -ljson  -o .output/eagle/debug/image/eagle.app.v6.out
../lib\libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x324): undefined reference to `user_rf_pre_init'
../lib\libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x344): undefined reference to `user_init'
../lib\libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x447): undefined reference to `user_rf_pre_init'
../lib\libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x4fb): undefined reference to `user_init'
collect2.exe: error: ld returned 1 exit status
../Makefile:206: recipe for target '.output/eagle/debug/image/eagle.app.v6.out' failed
mingw32-make[1]: *** [.output/eagle/debug/image/eagle.app.v6.out] Error 1



The user_main.c file is still at the same place as before and both function are there:

Code: Select allvoid user_rf_pre_init(void)
{
}
/******************************************************************************
 * FunctionName : user_init
 * Description  : entry of user application, init user function here
 * Parameters   : none
 * Returns      : none
*******************************************************************************/
extern void user_init(void)
{   


    uart_init(BIT_RATE_115200,BIT_RATE_115200);

    //wifi_status_led_uninstall ();

    NODE_DBG("User Init");
(...)

}


what can be wrong?

Thanks!!:)
User avatar
By jcmvbkbc
#23062
Patriko wrote:
Code: Select allc:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc  -L../lib -nostdlib -T../ld/eagle.app.v6.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -llwip -lmain -ljson  -o .output/eagle/debug/image/eagle.app.v6.out


The link command is missing the library with your user code and trailing -Wl,--end-group. Looks like broken Makefile.
User avatar
By Patriko
#23063 Thanks!

Ok, I'd fixed mistake. There was a "#" on LINKFLAGS_eagle list. Now I got even stranger error.

Code: Select allc:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc  -L../lib -nostdlib -T../ld/eagle.app.v6.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -llwip -lmain -ljson -lssl user/.output/eagle/debug/lib/libuser.a http/.output/eagle/debug/lib/http.a dns/.output/eagle/debug/lib/dns.a driver/.output/eagle/debug/lib/libdriver.a json/.output/eagle/debug/lib/libjson.a platform/.output/eagle/debug/lib/libplatform.a libc/.output/eagle/debug/lib/liblibc.a util/.output/eagle/debug/lib/util.a spiffs/.output/eagle/debug/lib/spiffs.a -Wl,--end-group -o .output/eagle/debug/image/eagle.app.v6.out
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: .output/eagle/debug/image/eagle.app.v6.out section `.text' will not fit in region `iram1_0_seg'
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: .output/eagle/debug/image/eagle.app.v6.out section `.irom0.text' will not fit in region `irom0_0_seg'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [.output/eagle/debug/image/eagle.app.v6.out] Error 1
../Makefile:206: recipe for target '.output/eagle/debug/image/eagle.app.v6.out' failed
mingw32-make[1]: Leaving directory 'C:/Espressif/examples/wSwitchBox/app'
C:/Espressif/examples/wSwitchBox/Makefile:151: recipe for target '.subdirs' failed
mingw32-make.exe: *** [.subdirs] Error 2


Before it fit's without any problem on 4M version. Now I use even 32M and it does not fit. Is it a problem with a linker files? How could I solve it?

thanks!