#include <stdio.h>
codee
sprintf(buffer_str,"sprintf test\n");
uart0_sendStr(buffer_str);
the complie ok!
but sprintf(buffer_str,"sprintf test=%d\n",chip_id); compile fail??? so bad !!!O(∩_∩)O
uint32 chip_id=system_get_chip_id();
char buffer_str[20]={0};
//sprintf(buffer_str,"chip_id=%d");
sprintf(buffer_str,"sprintf test\n");
sprintf(buffer_str,"sprintf test=%d\n",chip_id);
uart0_sendStr(buffer_str);
the info blew:
DICACHE_FLASH -I include -I ./ -I ../../rom/include -I ../../include/ets -I ../include -I ./ -I ../../include -I ../../include/eagle user_main.c
make[1]: Leaving directory `/mnt/Share/esp8266/v093/esp_iot_sdk_v0.9.3/app_at/user'
make[1]: Entering directory `/mnt/Share/esp8266/v093/esp_iot_sdk_v0.9.3/app_at/user'
xt-xcc -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH -I include -I ./ -I ../../rom/include -I ../../include/ets -I ../include -I ./ -I ../../include -I ../../include/eagle -o .output/eagle/debug/obj/user_main.o -c user_main.c
xt-ar ru .output/eagle/debug/lib/libuser.a .output/eagle/debug/obj/user_main.o
make[1]: Leaving directory `/mnt/Share/esp8266/v093/esp_iot_sdk_v0.9.3/app_at/user'
make[1]: Entering directory `/mnt/Share/esp8266/v093/esp_iot_sdk_v0.9.3/app_at/driver'
make[1]: Leaving directory `/mnt/Share/esp8266/v093/esp_iot_sdk_v0.9.3/app_at/driver'
xt-xcc -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 -llwip -lwpa -lmain -ljson -lupgrade 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
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .output/eagle/debug/image/eagle.app.v6.out section `.text' will not fit in region `iram1_0_seg'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(freer.o):(.literal+0x1c): undefined reference to `_sbrk_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(freer.o): In function `_malloc_trim_r':
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdlib/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdlib/mallocr.c:3309: undefined reference to `_sbrk_r'
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdlib/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdlib/mallocr.c:3351: undefined reference to `_sbrk_r'
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdlib/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdlib/mallocr.c:3327: undefined reference to `_sbrk_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(makebuf.o):(.literal+0x8): undefined reference to `_fstat_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(makebuf.o): In function `__smakebuf':
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdio/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdio/makebuf.c:52: undefined reference to `_fstat_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(mallocr.o): In function `_malloc_r':
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdlib/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdlib/mallocr.c:2152: undefined reference to `_sbrk_r'
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdlib/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdlib/mallocr.c:2189: undefined reference to `_sbrk_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(stdio.o):(.literal+0x0): undefined reference to `_read_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(stdio.o):(.literal+0x4): undefined reference to `_write_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(stdio.o):(.literal+0x8): undefined reference to `_lseek_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(stdio.o):(.literal+0xc): undefined reference to `_close_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(stdio.o): In function `__sread':
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdio/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdio/stdio.c:47: undefined reference to `_read_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(stdio.o): In function `__swrite':
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdio/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdio/stdio.c:84: undefined reference to `_write_r'
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdio/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdio/stdio.c:76: undefined reference to `_lseek_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(stdio.o): In function `__sseek':
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdio/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdio/stdio.c:103: undefined reference to `_lseek_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(stdio.o): In function `__sclose':
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\stdio/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\stdio/stdio.c:120: undefined reference to `_close_r'
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/libc.a(sysfstat.o): In function `fstat':
C:\build\build\RC-2010.1\lxinnovation\delivery\lx106\104196\xbuild\Target-libs\newlib\xtensa-elf\newlib\libc\syscalls/\build\tree\RC-2010.1_kuma\p4root\Xtensa\Target-libs\newlib\newlib\libc\syscalls/sysfstat.c:12: undefined reference to `_fstat_r'
collect2: error: ld returned 1 exit status
make: *** [.output/eagle/debug/image/eagle.app.v6.out] Error 1
+ '[' 2 == 0 ']'
+ echo 'make error'
make errorStatistics: Posted by jyesp — Tue Jan 27, 2015 11:49 am
]]>