← index #17953Issue #18476
Related · high · value 4.731
QUERY · ISSUE

ESP32-C6: build error

openby smurfixopened 2025-08-18updated 2025-10-11
bug

Port, board and/or hardware

ESP32-C6

MicroPython version

v1.26.0-51-g020eeba41
esp-idf: 5.4.2 or 5.5

Reproduction

$ cd ports/esp32
$ make BOARD=ESP32_GENERIC_C6

Expected behaviour

no build error

Observed behaviour

[281/290] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/__/__/frozen_content.c.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/__/__/frozen_content.c.obj
/home/smurf/.espressif/tools/riscv32-esp-elf/esp-14.2.0_20241119/riscv32-esp-elf/bin/riscv32-esp-elf-gcc … -c /src/moat/ext/micropython/ports/esp32/build-ESP32_GENERIC_C6/frozen_content.c
/src/moat/ext/micropython/ports/esp32/build-ESP32_GENERIC_C6/frozen_content.c:375:5: error: redeclaration of enumerator 'MP_QSTR_put'
  375 |     MP_QSTR_put,
      |     ^~~~~~~~~~~
In file included from /src/moat/ext/micropython/py/obj.h:33,
                 from /src/moat/ext/micropython/py/objint.h:30,
                 from /src/moat/ext/micropython/ports/esp32/build-ESP32_GENERIC_C6/frozen_content.c:16:
/src/moat/ext/micropython/ports/esp32/build-ESP32_GENERIC_C6/genhdr/qstrdefs.generated.h:955:7: note: previous definition of 'MP_QSTR_put' with type 'enum <anonymous>'
  955 | QDEF1(MP_QSTR_put, 28788, 3, "put")
      |       ^~~~~~~~~~~
/src/moat/ext/micropython/py/qstr.h:52:35: note: in definition of macro 'QDEF1'
   52 | #define QDEF1(id, hash, len, str) id,
      |                                   ^~
[283/290] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/__/modespnow.c.obj
ninja: build stopped: subcommand failed.

Additional Information

This build should probably be included in the CI script. Apparently right now it is not.

I ran some test builds:

Fails on 1.25.0 (esp-idf v5.4.2) due to

/var/cache/smurf/dot-espressif/tools/riscv32-esp-elf/esp-14.2.0_20241119/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/main/libmain.a(panichandler.c.obj): in function `__wrap_esp_panic_handler':
/src/moat/ext/micropython/ports/esp32/panichandler.c:49:(.text.__wrap_esp_panic_handler+0xc): undefined reference to `esp_panic_handler_reconfigure_wdts'

Works on 1.25.0 (esp-idf v5.3.3).

Fails on 1.26.0 and master 020eeba41 (esp-idf 5.3.3) due to

/src/moat/ext/micropython/ports/esp32/machine_timer.c: In function 'machine_timer_enable':
/src/moat/ext/micropython/ports/esp32/machine_timer.c:183:5: error: implicit declaration of function 'esp_clk_tree_enable_src' [-Werror=implicit-function-declaration]
  183 |     esp_clk_tree_enable_src(TIMER_CLK_SRC, true);
      |     ^~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

but builds when I remove that line.

Fails on 1.26.0 (esp-idf 5.4.2) due to

-- Configuring done (11.4s)
CMake Error at /src/esp-idf/tools/cmake/ldgen.cmake:159 (file):
  Error evaluating generator expression:

    $<TARGET_FILE:micropy_extmod_btree>

  Target "micropy_extmod_btree" is not an executable or library.
Call Stack (most recent call first):
  /src/esp-idf/tools/cmake/build.cmake:734 (__ldgen_create_target)
  /src/esp-idf/tools/cmake/project.cmake:972 (idf_build_executable)
  CMakeLists.txt:65 (project)

then with the same error as master when I disable the btree module.

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

build to .bin failed

openby democraz20opened 2025-11-25updated 2025-11-26
bugport-esp32

Port, board and/or hardware

ESP32

MicroPython version

the issue is about building micropython
v1.26.0-450-g938e2c0f2-dirty

Reproduction

git clone --recursive https://github.com/micropython/micropython.git
cd ~/micropython/mpy-cross
make
cd ~/micropython/ports/esp32
make submodules
make

all this is used along esp-idf

Expected behaviour

it should compile successfully to a .bin file

Observed behaviour

the build error :
[ 97%] Building C object esp-idf/main/CMakeFiles/idf_main.dir//network_wlan.c.obj
/home/mozartwsl/micropython/ports/esp32/machine_timer.c: In function 'machine_timer_enable':
/home/mozartwsl/micropython/ports/esp32/machine_timer.c:183:5: error: implicit declaration of function 'esp_clk_tree_enable_src' [-Werror=implicit-function-declaration]
183 | esp_clk_tree_enable_src(TIMER_CLK_SRC, true);
| ^~~~~~~~~~~~~~~~~~~~~~~
[ 97%] Building C object esp-idf/main/CMakeFiles/idf_main.dir//mpnimbleport.c.obj
[ 97%] Building C object esp-idf/main/CMakeFiles/idf_main.dir//modsocket.c.obj
[ 97%] Building C object esp-idf/main/CMakeFiles/idf_main.dir//lwip_patch.c.obj
/home/mozartwsl/micropython/ports/esp32/network_wlan.c:801:1: error: static assertion failed: "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h"
801 | _Static_assert(WIFI_AUTH_MAX == 13, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h");
| ^~~~~~~~~~~~~~
make[3]: *** [esp-idf/main/CMakeFiles/__idf_main.dir/build.make:3599: esp-idf/main/CMakeFiles/idf_main.dir//network_wlan.c.obj] Error 1
make[3]: *** Waiting for unfinished jobs....
[ 97%] Building C object esp-idf/main/CMakeFiles/idf_main.dir//esp32_nvs.c.obj
cc1: some warnings being treated as errors
[ 97%] Building C object esp-idf/main/CMakeFiles/idf_main.dir//modesp.c.obj
make[3]: *** [esp-idf/main/CMakeFiles/__idf_main.dir/build.make:3487: esp-idf/main/CMakeFiles/idf_main.dir//machine_timer.c.obj] Error 1
make[3]: Leaving directory '/home/mozartwsl/micropython/ports/esp32/build-ESP32_GENERIC'
make[2]: *** [CMakeFiles/Makefile2:4680: esp-idf/main/CMakeFiles/__idf_main.dir/all] Error 2
make[2]: Leaving directory '/home/mozartwsl/micropython/ports/esp32/build-ESP32_GENERIC'
make[1]: *** [Makefile:136: all] Error 2
make[1]: Leaving directory '/home/mozartwsl/micropython/ports/esp32/build-ESP32_GENERIC'
make failed with exit code 2, output of the command is in the /home/mozartwsl/micropython/ports/esp32/build-ESP32_GENERIC/log/idf_py_stderr_output_46976 and /home/mozartwsl/micropython/ports/esp32/build-ESP32_GENERIC/log/idf_py_stdout_output_46976
-e See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
make: *** [Makefile:77: all] Error 1

Additional Information

the context is i was trying to build a micropython firmware with a python file freeze into the firmware
i have esp-idf (ESP-IDF v5.2.6-224-g72d06017df) and the latest micropython on my machine to build
esp-idf had no trouble building but micropython failed at the last step of make

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied