Build micropython for ESP32 ports & ESP-IDF v5.06. failed with static-assert
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
esp32 port, ESP32-boards, all variants
MicroPython version
MicroPython v1.22.2-dirty on 2024-04-18; Generic ESP32 module with ESP32; ESP-IDF v.5.0.6
Reproduction
make
Expected behaviour
Build micrpopython port for ESP32, simply make. ;))
Observed behaviour
Build process failed by the static assert with message:
"Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h"
Additional Information
I discover this trouble and detect, that Espressif upgrade it's code in all 5.x.y branches.
Now:
- location in file: - ports/esp32/network_common.c
- line: 171
- source code:
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 1, 1)
_Static_assert(WIFI_AUTH_MAX == 11, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h");
#else
_Static_assert(WIFI_AUTH_MAX == 10, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h");
#endif
- Solition: update code as below:
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 1, 1)
_Static_assert(WIFI_AUTH_MAX == 11, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h");
//-- Upd begin -----------------------------------------------------------------------
#elif ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0, 4)
_Static_assert(WIFI_AUTH_MAX == 11, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h");
//-- Upd end -------------------------------------------------------------------------
#else
_Static_assert(WIFI_AUTH_MAX == 10, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h");
#endif
Upd: I'm detect, that in ESP-IDF, branch v5.2.x - WIFI_AUTH_MAX == 13
ESP32 build failure with ESP-IDF `v5.0.2`
Building esp32 port of master branch with IDF v5.0.2 fails :
root@DESKTOP-IDMFUQC:~/micropython/ports/esp32# make BOARD=WROOM32_DEV
idf.py -D MICROPY_BOARD=WROOM32_DEV -D MICROPY_BOARD_DIR=/root/micropython/ports/esp32/boards/WROOM32_DEV -B build-WROOM32_DEV build || (echo -e "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m"; false)
Executing action: all (aliases: build)
Running cmake in directory /root/micropython/ports/esp32/build-WROOM32_DEV
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DMICROPY_BOARD=WROOM32_DEV -DMICROPY_BOARD_DIR=/root/micropython/ports/esp32/boards/WROOM32_DEV -DCCACHE_ENABLE=0 /root/micropython/ports/esp32"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: /usr/bin/git (found version "2.25.1")
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /root/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /root/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /root/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /root/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++
-- Check for working CXX compiler: /root/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
CMake Error at /root/esp-idf-v5.0.2/tools/cmake/build.cmake:245 (message):
Failed to resolve component 'esp_adc_cal'.
Call Stack (most recent call first):
/root/esp-idf-v5.0.2/tools/cmake/build.cmake:281 (__build_resolve_and_add_req)
/root/esp-idf-v5.0.2/tools/cmake/build.cmake:574 (__build_expand_requirements)
/root/esp-idf-v5.0.2/tools/cmake/project.cmake:447 (idf_build_process)
CMakeLists.txt:58 (project)
-- Configuring incomplete, errors occurred!
See also "/root/micropython/ports/esp32/build-WROOM32_DEV/CMakeFiles/CMakeOutput.log".
HINT: The component esp_adc_cal could not be found. This could be because: component name was misspelled, the component was not added to the build, the component has been moved to the IDF component manager or has been removed and refactored into some other component.
Please look out for component in 'https://components.espressif.com' and add using 'idf.py add-dependency' command.
Refer to the migration guide for more details about moved components.
Refer to the build-system guide for more details about how components are found and included in the build.
cmake failed with exit code 1, output of the command is in the /root/micropython/ports/esp32/build-WROOM32_DEV/log/idf_py_stderr_output_10431 and /root/micropython/ports/esp32/build-WROOM32_DEV/log/idf_py_stdout_output_10431
-e See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
make: *** [Makefile:52: all] Error 1
It seems ESPRESSIF has redesigned ADC calibration driver in IDF v5.