ESP-IDF 4.4 例程hello_world编译失败

hongji
Posts: 1
Joined: Fri Mar 25, 2022 4:30 am

ESP-IDF 4.4 例程hello_world编译失败

Postby hongji » Fri Mar 25, 2022 4:43 am

头一次接触硬件,跟着官方的快速入门一步步走到build这里开始报错,

Code: Select all

idf.py menuconfig
步的菜单和之前的步骤都没问题,但是到编译这里开始报错,一开始好像是内存问题,把内存设置成16MB之后就变成下面这样,求大神指点一下

Code: Select all

D:\Espressif\esp\hello_world>idf.py build
Executing action: all (aliases: build)
Running ninja in directory d:\espressif\esp\hello_world\build
Executing "ninja all"...
[1/6] Linking CXX executable hello_world.elf
FAILED: hello_world.elf
cmd.exe /C "cd . && D:\Espressif\tools\riscv32-esp-elf\esp-2021r2-patch2-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-g++.exe -march=rv32imc -nostartfiles -march=rv32imc --specs=nosys.specs @CMakeFiles\hello_world.elf.rsp -o hello_world.elf  && cd ."
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: cannot find @C:\WINDOWS\TEMP\ccgE4d6l: Invalid argument
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-stdio.o): in function `__sclose':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:130: warning: _close_r is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-makebuf.o): in function `__swhatbuf_r':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/makebuf.c:96: warning: _fstat_r is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-raise.o): in function `_raise_r':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/signal/raise.c:66: warning: _getpid_r is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-makebuf.o): in function `__smakebuf_r':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/makebuf.c:68: warning: _isatty_r is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-raise.o): in function `_raise_r':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/signal/raise.c:66: warning: _kill_r is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-stdio.o): in function `__swrite':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:86: warning: _lseek_r is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-stdio.o): in function `__sread':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:47: warning: _read_r is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-stdio.o): in function `__swrite':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:94: warning: _write_r is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-vfiprintf.o): in function `_vfiprintf_r':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/vfprintf.c:853: warning: pthread_setcancelstate is not implemented and will always fail
d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch2-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/lib/rv32imc/ilp32\libc.a(lib_a-assert.o): in function `__assert_func':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdlib/assert.c:58: warning: __getreent is not implemented and will always fail
collect2.exe: error: ld returned 1 exit status
[2/6] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D D:\Espressif\esp\hello_world\build\bootloader\esp-idf\esptool_py && D:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe D:/Espressif/frameworks/esp-idf-v4.4/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 D:/Espressif/esp/hello_world/build/bootloader/bootloader.bin"
Bootloader binary size 0x4d80 bytes. 0x3280 bytes (39%) free.
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

esp32c3
Posts: 3
Joined: Fri Apr 29, 2022 1:16 pm

Re: ESP-IDF 4.4 例程hello_world编译失败

Postby esp32c3 » Wed May 18, 2022 3:59 am

Code: Select all

remote Thread 1070149892 In: printf                                                       L52   PC: 0x420119ec
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
[New Thread 1070149892]
[Switching to Thread 1070149892]

Thread 4 hit Breakpoint 2, loop () at C:\test\ESP32\hello_world\main\hello_world_main/hello_world_main.ino:20
(gdb) n
(gdb) s
printf (fmt=fmt@entry=0x3c020120 "printf loop %i.\n")
    at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/print
f.c:52
/builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/printf.c: No
 such file or directory.
(gdb)

Who is online

Users browsing this forum: Google [Bot] and 61 guests