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
build to .bin failed
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