← index #14350Issue #14492
Duplicate · high · value 3.789
QUERY · ISSUE

Build micropython for ESP32 ports & ESP-IDF v5.06. failed with static-assert

openby aso-copened 2024-04-22updated 2024-04-29
bugport-esp32

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

CANDIDATE · ISSUE

Does not build for ESP32-S3 with IDF 5.2 despite claiming support

closedby vladkvitopened 2024-05-15updated 2024-05-16
bug

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.

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