diff --git a/ports/esp32/README.md b/ports/esp32/README.md index a7531b6eaa447..0f1c15a8cff21 100644 --- a/ports/esp32/README.md +++ b/ports/esp32/README.md @@ -28,7 +28,7 @@ manage the ESP32 microcontroller, as well as a way to manage the required build environment and toolchains needed to build the firmware. The ESP-IDF changes quickly and MicroPython only supports certain versions. -Currently MicroPython supports v5.0.4, v5.1.2. +Currently MicroPython supports v5.0.5, v5.1.2. To install the ESP-IDF the full instructions can be found at the [Espressif Getting Started guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#installation-step-by-step). @@ -46,10 +46,10 @@ The steps to take are summarised below. To check out a copy of the IDF use git clone: ```bash -$ git clone -b v5.0.4 --recursive https://github.com/espressif/esp-idf.git +$ git clone -b v5.0.5 --recursive https://github.com/espressif/esp-idf.git ``` -You can replace `v5.0.4` with any other supported version. +You can replace `v5.0.5` with any other supported version. (You don't need a full recursive clone; see the `ci_esp32_setup` function in `tools/ci.sh` in this repository for more detailed set-up commands.) @@ -58,7 +58,7 @@ MicroPython and update the submodules using: ```bash $ cd esp-idf -$ git checkout v5.0.4 +$ git checkout v5.0.5 $ git submodule update --init --recursive ``` diff --git a/ports/esp32/machine_uart.c b/ports/esp32/machine_uart.c index 0e384dc07a2d7..295c74185a8a1 100644 --- a/ports/esp32/machine_uart.c +++ b/ports/esp32/machine_uart.c @@ -27,6 +27,7 @@ // This file is never compiled standalone, it's included directly from // extmod/machine_uart.c via MICROPY_PY_MACHINE_UART_INCLUDEFILE. +#include "soc/uart_periph.h" #include "driver/uart.h" #include "freertos/FreeRTOS.h" @@ -306,7 +307,11 @@ STATIC void mp_machine_uart_init_helper(machine_uart_obj_t *self, size_t n_args, } self->flowcontrol = args[ARG_flow].u_int; } + #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 0) check_esp_err(uart_set_hw_flow_ctrl(self->uart_num, self->flowcontrol, UART_FIFO_LEN - UART_FIFO_LEN / 4)); + #else + check_esp_err(uart_set_hw_flow_ctrl(self->uart_num, self->flowcontrol, UART_HW_FIFO_LEN(self->uart_num) - UART_HW_FIFO_LEN(self->uart_num) / 4)); + #endif } STATIC mp_obj_t mp_machine_uart_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { diff --git a/ports/esp32/main_esp32/idf_component.yml b/ports/esp32/main_esp32/idf_component.yml index 5dabbc00ba735..dae49c4e37ab5 100644 --- a/ports/esp32/main_esp32/idf_component.yml +++ b/ports/esp32/main_esp32/idf_component.yml @@ -2,4 +2,4 @@ dependencies: espressif/mdns: "~1.1.0" idf: - version: ">=5.0.4" + version: ">=5.0.5" diff --git a/ports/esp32/main_esp32c3/idf_component.yml b/ports/esp32/main_esp32c3/idf_component.yml index 5dabbc00ba735..dae49c4e37ab5 100644 --- a/ports/esp32/main_esp32c3/idf_component.yml +++ b/ports/esp32/main_esp32c3/idf_component.yml @@ -2,4 +2,4 @@ dependencies: espressif/mdns: "~1.1.0" idf: - version: ">=5.0.4" + version: ">=5.0.5" diff --git a/ports/esp32/main_esp32s2/idf_component.yml b/ports/esp32/main_esp32s2/idf_component.yml index 05ab2f29a8d31..ebf311d3b310e 100644 --- a/ports/esp32/main_esp32s2/idf_component.yml +++ b/ports/esp32/main_esp32s2/idf_component.yml @@ -3,4 +3,4 @@ dependencies: espressif/mdns: "~1.1.0" espressif/esp_tinyusb: "~1.0.0" idf: - version: ">=5.0.4" + version: ">=5.0.5" diff --git a/ports/esp32/main_esp32s3/idf_component.yml b/ports/esp32/main_esp32s3/idf_component.yml index 05ab2f29a8d31..ebf311d3b310e 100644 --- a/ports/esp32/main_esp32s3/idf_component.yml +++ b/ports/esp32/main_esp32s3/idf_component.yml @@ -3,4 +3,4 @@ dependencies: espressif/mdns: "~1.1.0" espressif/esp_tinyusb: "~1.0.0" idf: - version: ">=5.0.4" + version: ">=5.0.5" diff --git a/ports/esp32/modnetwork_globals.h b/ports/esp32/modnetwork_globals.h index c6369ab9a79aa..b7fa45dfcbed1 100644 --- a/ports/esp32/modnetwork_globals.h +++ b/ports/esp32/modnetwork_globals.h @@ -29,9 +29,12 @@ { MP_ROM_QSTR(MP_QSTR_AUTH_WPA2_WPA3_PSK), MP_ROM_INT(WIFI_AUTH_WPA2_WPA3_PSK) }, { MP_ROM_QSTR(MP_QSTR_AUTH_WAPI_PSK), MP_ROM_INT(WIFI_AUTH_WAPI_PSK) }, { MP_ROM_QSTR(MP_QSTR_AUTH_OWE), MP_ROM_INT(WIFI_AUTH_OWE) }, -#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 1, 1) +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 5) { MP_ROM_QSTR(MP_QSTR_AUTH_WPA3_ENT_192), MP_ROM_INT(WIFI_AUTH_WPA3_ENT_192) }, #endif +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0) +{ MP_ROM_QSTR(MP_QSTR_AUTH_WPA3_EXT_PSK), MP_ROM_INT(WIFI_AUTH_WPA3_EXT_PSK) }, +#endif { MP_ROM_QSTR(MP_QSTR_AUTH_MAX), MP_ROM_INT(WIFI_AUTH_MAX) }, #endif diff --git a/ports/esp32/network_common.c b/ports/esp32/network_common.c index 1c5979175d0a1..b0e7d20497d4e 100644 --- a/ports/esp32/network_common.c +++ b/ports/esp32/network_common.c @@ -168,7 +168,9 @@ STATIC mp_obj_t esp_phy_mode(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp_network_phy_mode_obj, 0, 1, esp_phy_mode); -#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 1, 1) +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0) +_Static_assert(WIFI_AUTH_MAX == 12, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h"); +#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 5) _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"); diff --git a/ports/esp32/uart.c b/ports/esp32/uart.c index b82a638a5b27a..4da59445dc675 100644 --- a/ports/esp32/uart.c +++ b/ports/esp32/uart.c @@ -34,6 +34,7 @@ #if MICROPY_HW_ENABLE_UART_REPL #include +#include "soc/uart_periph.h" #include "driver/uart.h" // For uart_get_sclk_freq() #include "hal/uart_hal.h" @@ -50,7 +51,7 @@ STATIC void uart_irq_handler(void *arg); void uart_stdout_init(void) { uart_hal_context_t repl_hal = REPL_HAL_DEFN(); - #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 0) + #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 2, 0) uart_sclk_t sclk; #else soc_module_clk_t sclk; diff --git a/tools/ci.sh b/tools/ci.sh index 95b1f19ffc4a6..ccf4753561661 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -122,7 +122,7 @@ function ci_cc3200_build { # ports/esp32 # GitHub tag of ESP-IDF to use for CI (note: must be a tag or a branch) -IDF_VER=v5.0.4 +IDF_VER=v5.0.5 export IDF_CCACHE_ENABLE=1