Skip to content

Commit 5564f30

Browse files
pi-anldpgeorge
authored andcommitted
esp32: Add basic espressif IDF v5.3 compatibility.
Signed-off-by: Andrew Leech <[email protected]> Signed-off-by: Damien George <[email protected]>
1 parent b20687d commit 5564f30

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

ports/esp32/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ manage the ESP32 microcontroller, as well as a way to manage the required
2828
build environment and toolchains needed to build the firmware.
2929

3030
The ESP-IDF changes quickly and MicroPython only supports certain versions.
31-
Currently MicroPython supports v5.0.4, v5.0.5, v5.1.2, v5.2.0, v5.2.2.
31+
Currently MicroPython supports v5.0.4, v5.0.5, v5.1.2, v5.2.0, v5.2.2, v5.3.
3232

3333
To install the ESP-IDF the full instructions can be found at the
3434
[Espressif Getting Started guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#installation-step-by-step).

ports/esp32/network_wlan.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,14 +768,19 @@ static const mp_rom_map_elem_t wlan_if_locals_dict_table[] = {
768768
{ MP_ROM_QSTR(MP_QSTR_SEC_WPA3_EXT_PSK), MP_ROM_INT(WIFI_AUTH_WPA3_EXT_PSK) },
769769
{ MP_ROM_QSTR(MP_QSTR_SEC_WPA3_EXT_PSK_MIXED_MODE), MP_ROM_INT(WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE) },
770770
#endif
771+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
772+
{ MP_ROM_QSTR(MP_QSTR_SEC_DPP), MP_ROM_INT(WIFI_AUTH_DPP) },
773+
#endif
771774

772775
{ MP_ROM_QSTR(MP_QSTR_PM_NONE), MP_ROM_INT(WIFI_PS_NONE) },
773776
{ MP_ROM_QSTR(MP_QSTR_PM_PERFORMANCE), MP_ROM_INT(WIFI_PS_MIN_MODEM) },
774777
{ MP_ROM_QSTR(MP_QSTR_PM_POWERSAVE), MP_ROM_INT(WIFI_PS_MAX_MODEM) },
775778
};
776779
static MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table);
777780

778-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
781+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
782+
_Static_assert(WIFI_AUTH_MAX == 14, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types_generic.h");
783+
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
779784
_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");
780785
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 5) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 1, 0) || ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 2)
781786
_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");

ports/esp32/usb_serial_jtag.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@
3535
#include "soc/periph_defs.h"
3636
#include "freertos/portmacro.h"
3737

38-
#define USB_SERIAL_JTAG_BUF_SIZE (64)
38+
// Number of bytes in the input buffer, and number of bytes for output chunking.
39+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
40+
#define USB_SERIAL_JTAG_PACKET_SZ_BYTES (64)
41+
#endif
3942

4043
static DRAM_ATTR portMUX_TYPE rx_mux = portMUX_INITIALIZER_UNLOCKED;
41-
static uint8_t rx_buf[USB_SERIAL_JTAG_BUF_SIZE];
44+
static uint8_t rx_buf[USB_SERIAL_JTAG_PACKET_SZ_BYTES];
4245
static volatile bool terminal_connected = false;
4346

4447
static void usb_serial_jtag_handle_rx(void) {
@@ -48,8 +51,8 @@ static void usb_serial_jtag_handle_rx(void) {
4851
portENTER_CRITICAL(&rx_mux);
4952
}
5053
size_t req_len = ringbuf_free(&stdin_ringbuf);
51-
if (req_len > USB_SERIAL_JTAG_BUF_SIZE) {
52-
req_len = USB_SERIAL_JTAG_BUF_SIZE;
54+
if (req_len > USB_SERIAL_JTAG_PACKET_SZ_BYTES) {
55+
req_len = USB_SERIAL_JTAG_PACKET_SZ_BYTES;
5356
}
5457
size_t len = usb_serial_jtag_ll_read_rxfifo(rx_buf, req_len);
5558
for (size_t i = 0; i < len; ++i) {

0 commit comments

Comments
 (0)