Build a esp32 firmware with version 1.22.2 meet a build issuse
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
MicroPython version
MicroPython 1.22.2
Reproduction
next is the build script:
#!/bin/bash
export BUILD_DIR=$(pwd)
echo "--- CLONING ULAB ---"
git clone --depth 1 https://github.com/v923z/micropython-ulab.git ulab
echo "--- CLONING MICROPYTHON ---"
git clone --depth 1 -b v1.22.2 https://github.com/micropython/micropython.git
echo "--- CLONING ESP-IDF ---"
cd $BUILD_DIR/micropython/
git clone --depth 1 -b v5.0.4 --recursive https://github.com/espressif/esp-idf.git
echo "--- INSTALL ESP-IDF ---"
cd $BUILD_DIR/micropython/esp-idf
./install.sh
. ./export.sh
echo "--- MPY-CROSS ---"
cd $BUILD_DIR/micropython/mpy-cross
make
echo "--- ESP32 SUBMODULES ---"
cd $BUILD_DIR/micropython/ports/esp32
make submodules
echo "--- PATCH MAKEFILE ---"
cp $BUILD_DIR/micropython/ports/esp32/Makefile $BUILD_DIR/micropython/ports/esp32/MakefileOld
echo "BOARD = ESP32_GENERIC" > $BUILD_DIR/micropython/ports/esp32/Makefile
cat $BUILD_DIR/micropython/ports/esp32/MakefileOld >> $BUILD_DIR/micropython/ports/esp32/Makefile
echo "move extmod file"
cp -r $BUILD_DIR/ext_mods/ $BUILD_DIR/micropython/ports/esp32/modules
echo "--- MAKE ---"
make
Expected behaviour
No response
Observed behaviour
build error:
[ 98%] Building C object esp-idf/main_esp32/CMakeFiles/idf_main_esp32.dir///pins.c.obj
[ 98%] Building C object esp-idf/main_esp32/CMakeFiles/idf_main_esp32.dir///frozen_content.c.obj
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36441:27: error: redefinition of 'const_qstr_table_data_urequests'
36441 | static const qstr_short_t const_qstr_table_data_urequests[70] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10122:27: note: previous definition of 'const_qstr_table_data_urequests' with type 'const qstr_short_t[70]' {aka 'const short unsigned int[70]'}
10122 | static const qstr_short_t const_qstr_table_data_urequests[70] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36515:27: error: redefinition of 'const_obj_urequests_1'
36515 | static const mp_obj_str_t const_obj_urequests_1 = {{&mp_type_bytes}, 47477, 17, (const byte*)"\x25\x73\x20\x2f\x25\x73\x20\x48\x54\x54\x50\x2f\x31\x2e\x30\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10196:27: note: previous definition of 'const_obj_urequests_1' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10196 | static const mp_obj_str_t const_obj_urequests_1 = {{&mp_type_bytes}, 47477, 17, (const byte*)"\x25\x73\x20\x2f\x25\x73\x20\x48\x54\x54\x50\x2f\x31\x2e\x30\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36516:27: error: redefinition of 'const_obj_urequests_2'
36516 | static const mp_obj_str_t const_obj_urequests_2 = {{&mp_type_bytes}, 35534, 10, (const byte*)"\x48\x6f\x73\x74\x3a\x20\x25\x73\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10197:27: note: previous definition of 'const_obj_urequests_2' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10197 | static const mp_obj_str_t const_obj_urequests_2 = {{&mp_type_bytes}, 35534, 10, (const byte*)"\x48\x6f\x73\x74\x3a\x20\x25\x73\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36517:27: error: redefinition of 'const_obj_urequests_3'
36517 | static const mp_obj_str_t const_obj_urequests_3 = {{&mp_type_bytes}, 26975, 2, (const byte*)"\x3a\x20"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10198:27: note: previous definition of 'const_obj_urequests_3' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10198 | static const mp_obj_str_t const_obj_urequests_3 = {{&mp_type_bytes}, 26975, 2, (const byte*)"\x3a\x20"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36518:27: error: redefinition of 'const_obj_urequests_4'
36518 | static const mp_obj_str_t const_obj_urequests_4 = {{&mp_type_bytes}, 27298, 2, (const byte*)"\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10199:27: note: previous definition of 'const_obj_urequests_4' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10199 | static const mp_obj_str_t const_obj_urequests_4 = {{&mp_type_bytes}, 27298, 2, (const byte*)"\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36519:27: error: redefinition of 'const_obj_urequests_5'
36519 | static const mp_obj_str_t const_obj_urequests_5 = {{&mp_type_bytes}, 14729, 32, (const byte*)"\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65\x3a\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6a\x73\x6f\x6e\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10200:27: note: previous definition of 'const_obj_urequests_5' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10200 | static const mp_obj_str_t const_obj_urequests_5 = {{&mp_type_bytes}, 14729, 32, (const byte*)"\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65\x3a\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6a\x73\x6f\x6e\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36520:27: error: redefinition of 'const_obj_urequests_6'
36520 | static const mp_obj_str_t const_obj_urequests_6 = {{&mp_type_bytes}, 8065, 20, (const byte*)"\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x4c\x65\x6e\x67\x74\x68\x3a\x20\x25\x64\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10201:27: note: previous definition of 'const_obj_urequests_6' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10201 | static const mp_obj_str_t const_obj_urequests_6 = {{&mp_type_bytes}, 8065, 20, (const byte*)"\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x4c\x65\x6e\x67\x74\x68\x3a\x20\x25\x64\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36521:27: error: redefinition of 'const_obj_urequests_7'
36521 | static const mp_obj_str_t const_obj_urequests_7 = {{&mp_type_bytes}, 54399, 21, (const byte*)"\x43\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e\x3a\x20\x63\x6c\x6f\x73\x65\x0d\x0a\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10202:27: note: previous definition of 'const_obj_urequests_7' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10202 | static const mp_obj_str_t const_obj_urequests_7 = {{&mp_type_bytes}, 54399, 21, (const byte*)"\x43\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e\x3a\x20\x63\x6c\x6f\x73\x65\x0d\x0a\x0d\x0a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36522:27: error: redefinition of 'const_obj_urequests_8'
36522 | static const mp_obj_str_t const_obj_urequests_8 = {{&mp_type_bytes}, 59642, 18, (const byte*)"\x54\x72\x61\x6e\x73\x66\x65\x72\x2d\x45\x6e\x63\x6f\x64\x69\x6e\x67\x3a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10203:27: note: previous definition of 'const_obj_urequests_8' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10203 | static const mp_obj_str_t const_obj_urequests_8 = {{&mp_type_bytes}, 59642, 18, (const byte*)"\x54\x72\x61\x6e\x73\x66\x65\x72\x2d\x45\x6e\x63\x6f\x64\x69\x6e\x67\x3a"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36523:27: error: redefinition of 'const_obj_urequests_9'
36523 | static const mp_obj_str_t const_obj_urequests_9 = {{&mp_type_bytes}, 3583, 7, (const byte*)"\x63\x68\x75\x6e\x6b\x65\x64"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10204:27: note: previous definition of 'const_obj_urequests_9' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10204 | static const mp_obj_str_t const_obj_urequests_9 = {{&mp_type_bytes}, 3583, 7, (const byte*)"\x63\x68\x75\x6e\x6b\x65\x64"};
| ^~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36524:27: error: redefinition of 'const_obj_urequests_11'
36524 | static const mp_obj_str_t const_obj_urequests_11 = {{&mp_type_bytes}, 1090, 9, (const byte*)"\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a"};
| ^~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10205:27: note: previous definition of 'const_obj_urequests_11' with type 'mp_obj_str_t' {aka 'const struct _mp_obj_str_t'}
10205 | static const mp_obj_str_t const_obj_urequests_11 = {{&mp_type_bytes}, 1090, 9, (const byte*)"\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3a"};
| ^~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36527:27: error: redefinition of 'const_obj_table_data_urequests'
36527 | static const mp_rom_obj_t const_obj_table_data_urequests[13] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10208:27: note: previous definition of 'const_obj_table_data_urequests' with type 'const void * const[13]'
10208 | static const mp_rom_obj_t const_obj_table_data_urequests[13] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:36543:33: error: redefinition of 'frozen_module_urequests'
36543 | static const mp_frozen_module_t frozen_module_urequests = {
| ^~~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10224:33: note: previous definition of 'frozen_module_urequests' with type 'mp_frozen_module_t' {aka 'const struct _mp_frozen_module_t'}
10224 | static const mp_frozen_module_t frozen_module_urequests = {
| ^~~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Projects/esp/build2/micropython/ports/esp32/build-ESP32_GENERIC/frozen_content.c:10224:33: error: 'frozen_module_urequests' defined but not used [-Werror=unused-const-variable=]
cc1: some warnings being treated as errors
make[3]: *** [esp-idf/main_esp32/CMakeFiles/idf_main_esp32.dir//__/frozen_content.c.obj] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [esp-idf/main_esp32/CMakeFiles/__idf_main_esp32.dir/all] Error 2
Additional Information
No, I've provided everything above.
Does not build for ESP32-S3 with IDF 5.2 despite claiming support
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-S3
MicroPython version
v1.22.2
Reproduction
I'm building Micropython for an ESP32. It works fine with micropython v1.22.2 and IDF v5.1.2. It does not work with IDF v5.2, despite claimed support here: https://github.com/micropython/micropython/tree/master/ports/esp32/#setting-up-esp-idf-and-the-build-environment
Here's my Dockerfile to reproduce:
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
# Set a working directory
WORKDIR /code
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libffi-dev \
git \
pkg-config \
python3.10-venv \
libusb-1.0-0-dev \
cmake \
&& rm -rf /var/lib/apt/lists/*
# Clone the micropython repository
RUN git clone https://github.com/micropython/micropython.git
WORKDIR /code/micropython
RUN git checkout -b v1.22.2 v1.22.2
# Clone ESP-IDF
WORKDIR /code
RUN git clone -b v5.2 --recursive https://github.com/espressif/esp-idf.git
WORKDIR /code/esp-idf
RUN git checkout v5.2
RUN git submodule update --init --recursive
SHELL ["/bin/bash", "-c"]
RUN ./install.sh
# Build MicroPython
WORKDIR /code/micropython/ports/esp32
RUN . /code/esp-idf/export.sh && \
make BOARD=ESP32_GENERIC_S3 submodules && \
make BOARD=ESP32_GENERIC_S3
ENTRYPOINT ["/bin/bash"]
Replace 'v5.2" with "v5.1.2" (twice) to have it run successfully.
The error is here:
32.51 /code/micropython/ports/esp32/network_common.c:172: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"
32.51 172 | _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");
32.51 | ^~~~~~~~~~~~~~
Expected behaviour
Expected a finished build
Observed behaviour
Build errors out due to a static assert.
Additional Information
No, I've provided everything above.