Skip to content

Commit dd253d0

Browse files
authored
Merge branch 'adafruit:main' into issue-10298
2 parents e35b1e9 + 054c0c1 commit dd253d0

File tree

34 files changed

+879
-181
lines changed

34 files changed

+879
-181
lines changed

.github/actions/deps/ports/espressif/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ runs:
77
run: |
88
echo >> $GITHUB_ENV "IDF_PATH=$GITHUB_WORKSPACE/ports/espressif/esp-idf"
99
echo >> $GITHUB_ENV "IDF_TOOLS_PATH=$GITHUB_WORKSPACE/.idf_tools"
10+
echo >> $GITHUB_ENV "ESP_ROM_ELF_DIR=$GITHUB_WORKSPACE/.idf_tools"
1011
shell: bash
1112

1213
- name: Get IDF commit

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
[submodule "ports/espressif/esp-idf"]
144144
path = ports/espressif/esp-idf
145145
url = https://github.com/adafruit/esp-idf.git
146-
branch = circuitpython-v5.3.2
146+
branch = circuitpython-v5.4.1
147147
[submodule "ports/espressif/esp-protocols"]
148148
path = ports/espressif/esp-protocols
149149
url = https://github.com/adafruit/esp-protocols.git

lib/mbedtls_config/mbedtls_config_port.h

-67
This file was deleted.

ports/espressif/Makefile

+16-12
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ INC += \
8383
-isystem esp-idf/components/esp_psram/include \
8484
-isystem esp-idf/components/esp_ringbuf/include \
8585
-isystem esp-idf/components/esp_rom/include \
86+
-isystem esp-idf/components/esp_rom/$(IDF_TARGET)/include \
87+
-isystem esp-idf/components/esp_rom/$(IDF_TARGET)/include/$(IDF_TARGET) \
88+
-isystem esp-idf/components/esp_security/include \
8689
-isystem esp-idf/components/esp_system/include \
8790
-isystem esp-idf/components/esp_timer/include \
8891
-isystem esp-idf/components/esp_wifi/include \
@@ -115,6 +118,7 @@ INC += \
115118
-isystem esp-idf/components/sdmmc/include \
116119
-isystem esp-idf/components/soc/include \
117120
-isystem esp-idf/components/soc/$(IDF_TARGET)/include \
121+
-isystem esp-idf/components/soc/$(IDF_TARGET)/register \
118122
-isystem esp-idf/components/spi_flash/include \
119123
-isystem esp-idf/components/usb/include \
120124
-isystem esp-idf/components/ulp/ulp_fsm/include \
@@ -171,12 +175,12 @@ ifeq ($(DEBUG), 1)
171175
OPTIMIZATION_FLAGS ?= -Og
172176
CFLAGS += -DDEBUG
173177
endif
174-
# You may want to enable these flags to make setting breakpoints easier.
175-
# CFLAGS += -fno-inline -fno-ipa-sra
178+
# You may want to enable these flags to make setting breakpoints easier.
179+
# CFLAGS += -fno-inline -fno-ipa-sra
176180
else
177181
CFLAGS += -DNDEBUG
178-
# RISC-V is larger than xtensa
179-
# Use -Os for RISC-V when it overflows
182+
# RISC-V is larger than xtensa
183+
# Use -Os for RISC-V when it overflows
180184
ifeq ($(IDF_TARGET_ARCH),riscv)
181185
OPTIMIZATION_FLAGS ?= -Os
182186
else
@@ -238,7 +242,6 @@ ifeq ($(IDF_TARGET),esp32)
238242
LDFLAGS += \
239243
-Tesp32.rom.newlib-data.ld \
240244
-Tesp32.rom.newlib-funcs.ld \
241-
-Tesp32.rom.newlib-time.ld \
242245
-Tesp32.rom.spiflash_legacy.ld
243246

244247
CHIP_COMPONENTS = \
@@ -261,7 +264,6 @@ CHIP_COMPONENTS = \
261264
else ifeq ($(IDF_TARGET),esp32c3)
262265
LDFLAGS += \
263266
-Tesp32c3.rom.newlib.ld \
264-
-Tesp32c3.rom.newlib-time.ld \
265267
-Tesp32c3.rom.version.ld \
266268
-Tesp32c3.rom.eco3.ld \
267269
-Tesp32c3.rom.bt_funcs.ld
@@ -308,7 +310,6 @@ else ifeq ($(IDF_TARGET),esp32s2)
308310
LDFLAGS += \
309311
-Tesp32s2.rom.newlib-data.ld \
310312
-Tesp32s2.rom.newlib-funcs.ld \
311-
-Tesp32s2.rom.newlib-time.ld \
312313
-Tesp32s2.rom.spiflash_legacy.ld
313314

314315
CHIP_COMPONENTS = \
@@ -392,7 +393,7 @@ SRC_C += \
392393
peripherals/$(IDF_TARGET)/pins.c
393394

394395
ifeq ($(CIRCUITPY_SSL),1)
395-
SRC_C += lib/mbedtls_config/crt_bundle.c
396+
SRC_C += common-hal/ssl/crt_bundle.c
396397
endif
397398

398399
SRC_C += $(wildcard common-hal/espidf/*.c)
@@ -603,7 +604,7 @@ endif
603604

604605
ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) $(CHIP_COMPONENTS) app_update bootloader_support driver esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_ledc esp_driver_spi esp_driver_uart efuse esp_adc esp_app_format esp_common esp_event esp_hw_support esp_mm esp_partition esp_pm esp_ringbuf esp_rom esp_system esp_timer freertos hal heap log newlib nvs_flash pthread soc spi_flash vfs esp_vfs_console
605606
ifneq ($(CIRCUITPY_WIFI),0)
606-
ESP_IDF_COMPONENTS_LINK += esp_coex esp_netif esp-tls esp_wifi lwip mbedtls mdns wpa_supplicant esp_phy
607+
ESP_IDF_COMPONENTS_LINK += esp_coex esp_netif esp_security esp-tls esp_wifi lwip mbedtls mdns wpa_supplicant esp_phy
607608
endif
608609
ifneq ($(CIRCUITPY_BLEIO_NATIVE),0)
609610
BLE_IMPL_esp32 := esp32
@@ -614,10 +615,10 @@ ifneq ($(CIRCUITPY_BLEIO_NATIVE),0)
614615
BLE_IMPL_esp32h2 := libble
615616
BLE_IMPL = $(BLE_IMPL_$(IDF_TARGET))
616617

617-
ESP_IDF_COMPONENTS_LINK += bt esp_phy
618+
ESP_IDF_COMPONENTS_LINK += bt esp_phy esp_security
618619
ifeq ($(BLE_IMPL),esp32)
619-
# BLE will hang the ESP32 and trigger an interrupt watchdog without this undefined symbol at
620-
# link because a weak version of the interrupt that BLE uses will be linked incorrectly.
620+
# BLE will hang the ESP32 and trigger an interrupt watchdog without this undefined symbol at
621+
# link because a weak version of the interrupt that BLE uses will be linked incorrectly.
621622
REGISTRATION_FUNCTIONS += -u ld_include_hli_vectors_bt
622623
BINARY_BLOBS += esp-idf/components/bt/controller/lib_esp32/$(IDF_TARGET)/libbtdm_app.a
623624
endif
@@ -636,6 +637,9 @@ ifneq ($(CIRCUITPY_BLEIO_NATIVE),0)
636637
endif
637638
endif
638639
endif
640+
ifeq ($(IDF_TARGET),esp32p4)
641+
ESP_IDF_COMPONENTS_LINK += esp_security
642+
endif
639643
ifneq ($(CIRCUITPY_ESPULP),0)
640644
ESP_IDF_COMPONENTS_LINK += ulp
641645
endif

ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CIRCUITPY_ESP_FLASH_FREQ = 80m
1010
CIRCUITPY_ESP_FLASH_SIZE = 4MB
1111

1212
CIRCUITPY_AESIO = 0
13+
CIRCUITPY_CANIO = 0
1314
CIRCUITPY_CODEOP = 0
1415
CIRCUITPY_ESPCAMERA = 0
1516

ports/espressif/boards/oxocard_artwork/board.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void display_init(void) {
6060
240, // width (after rotation)
6161
240, // height (after rotation)
6262
0, // column start
63-
80, // row start
63+
0, // row start
6464
0, // rotation
6565
16, // color depth
6666
false, // grayscale

ports/espressif/boards/oxocard_galaxy/board.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void display_init(void) {
6060
240, // width (after rotation)
6161
240, // height (after rotation)
6262
0, // column start
63-
80, // row start
63+
0, // row start
6464
0, // rotation
6565
16, // color depth
6666
false, // grayscale

ports/espressif/boards/oxocard_science/board.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void display_init(void) {
6060
240, // width (after rotation)
6161
240, // height (after rotation)
6262
0, // column start
63-
80, // row start
63+
0, // row start
6464
0, // rotation
6565
16, // color depth
6666
false, // grayscale
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2025 Dan Halbert for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
// In ESP-IDF v5.4, Espressif changed the format of the in-flash cert bundle, which
8+
// made lib/mbedtls_config/crt_bundle.c no longer work. Rather than update that,
9+
// just wrap those functions and use the ESP-IDF versions.
10+
11+
#include "py/mperrno.h"
12+
#include "mbedtls/x509_crt.h"
13+
#include "lib/mbedtls_config/crt_bundle.h"
14+
#include "esp_crt_bundle.h"
15+
16+
static int convert_esp_err(esp_err_t ret) {
17+
switch (ret) {
18+
case ESP_OK:
19+
return 0;
20+
default:
21+
// Right now esp_crt_bundle.c doesn't return very specific errors.
22+
case ESP_ERR_INVALID_ARG:
23+
return -MP_EINVAL;
24+
}
25+
}
26+
27+
int crt_bundle_attach(mbedtls_ssl_config *ssl_conf) {
28+
return convert_esp_err(esp_crt_bundle_attach(ssl_conf));
29+
}
30+
31+
void crt_bundle_detach(mbedtls_ssl_config *conf) {
32+
esp_crt_bundle_detach(conf);
33+
}
34+
35+
int crt_bundle_set(const uint8_t *x509_bundle, size_t bundle_size) {
36+
return convert_esp_err(esp_crt_bundle_set(x509_bundle, bundle_size));
37+
}

ports/espressif/esp-idf

Submodule esp-idf updated 6990 files

ports/espressif/esp-idf-config/sdkconfig-esp32s2.defaults

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ CONFIG_ULP_COPROC_TYPE_RISCV=y # Note: enabling both ULPs simultaneously only w
5858
CONFIG_ULP_COPROC_RESERVE_MEM=8176
5959
# end of Ultra Low Power (ULP) Co-processor
6060

61+
#
62+
# FreeRTOS
63+
#
64+
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
65+
# end of FreeRTOS
66+
6167
# end of Component config
6268

6369
# end of Espressif IoT Development Framework Configuration
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
11
CONFIG_ESPTOOLPY_FLASHFREQ_120M=y
2-
# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set
3-
# CONFIG_ESPTOOLPY_FLASHFREQ_64M is not set
4-
# CONFIG_ESPTOOLPY_FLASHFREQ_60M is not set
5-
# CONFIG_ESPTOOLPY_FLASHFREQ_48M is not set
6-
# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set
7-
# CONFIG_ESPTOOLPY_FLASHFREQ_32M is not set
8-
# CONFIG_ESPTOOLPY_FLASHFREQ_30M is not set
9-
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
10-
# CONFIG_ESPTOOLPY_FLASHFREQ_24M is not set
11-
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
12-
# CONFIG_ESPTOOLPY_FLASHFREQ_16M is not set
13-
# CONFIG_ESPTOOLPY_FLASHFREQ_15M is not set
14-
CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y
152
CONFIG_SPI_FLASH_UNDER_HIGH_FREQ=y
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set
2-
# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set
3-
# CONFIG_ESPTOOLPY_FLASHFREQ_64M is not set
4-
# CONFIG_ESPTOOLPY_FLASHFREQ_60M is not set
5-
# CONFIG_ESPTOOLPY_FLASHFREQ_48M is not set
61
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
7-
# CONFIG_ESPTOOLPY_FLASHFREQ_32M is not set
8-
# CONFIG_ESPTOOLPY_FLASHFREQ_30M is not set
9-
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
10-
# CONFIG_ESPTOOLPY_FLASHFREQ_24M is not set
11-
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
12-
# CONFIG_ESPTOOLPY_FLASHFREQ_16M is not set
13-
# CONFIG_ESPTOOLPY_FLASHFREQ_15M is not set
14-
# CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT is not set
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set
2-
# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set
3-
# CONFIG_ESPTOOLPY_FLASHFREQ_64M is not set
4-
# CONFIG_ESPTOOLPY_FLASHFREQ_60M is not set
51
CONFIG_ESPTOOLPY_FLASHFREQ_48M=y
6-
# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set
7-
# CONFIG_ESPTOOLPY_FLASHFREQ_32M is not set
8-
# CONFIG_ESPTOOLPY_FLASHFREQ_30M is not set
9-
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
10-
# CONFIG_ESPTOOLPY_FLASHFREQ_24M is not set
11-
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
12-
# CONFIG_ESPTOOLPY_FLASHFREQ_16M is not set
13-
# CONFIG_ESPTOOLPY_FLASHFREQ_15M is not set
14-
CONFIG_ESPTOOLPY_FLASHFREQ_48M_DEFAULT=y
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set
2-
# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set
3-
# CONFIG_ESPTOOLPY_FLASHFREQ_64M is not set
41
CONFIG_ESPTOOLPY_FLASHFREQ_60M=y
5-
# CONFIG_ESPTOOLPY_FLASHFREQ_48M is not set
6-
# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set
7-
# CONFIG_ESPTOOLPY_FLASHFREQ_32M is not set
8-
# CONFIG_ESPTOOLPY_FLASHFREQ_30M is not set
9-
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
10-
# CONFIG_ESPTOOLPY_FLASHFREQ_24M is not set
11-
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
12-
# CONFIG_ESPTOOLPY_FLASHFREQ_16M is not set
13-
# CONFIG_ESPTOOLPY_FLASHFREQ_15M is not set
14-
# CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT is not set
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set
21
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
# CONFIG_ESPTOOLPY_FLASHFREQ_64M is not set
4-
# CONFIG_ESPTOOLPY_FLASHFREQ_60M is not set
5-
# CONFIG_ESPTOOLPY_FLASHFREQ_48M is not set
6-
# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set
7-
# CONFIG_ESPTOOLPY_FLASHFREQ_32M is not set
8-
# CONFIG_ESPTOOLPY_FLASHFREQ_30M is not set
9-
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
10-
# CONFIG_ESPTOOLPY_FLASHFREQ_24M is not set
11-
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
12-
# CONFIG_ESPTOOLPY_FLASHFREQ_16M is not set
13-
# CONFIG_ESPTOOLPY_FLASHFREQ_15M is not set
14-
CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y

ports/espressif/mpconfigport.mk

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ CIRCUITPY_TOUCHIO_USE_NATIVE = 0
181181
CIRCUITPY_USB_DEVICE = 0
182182
CIRCUITPY_ESP_USB_SERIAL_JTAG ?= 1
183183

184+
# Remove temporarily until 10265 is merged
185+
CIRCUITPY_ULAB = 0
186+
184187
else ifeq ($(IDF_TARGET),esp32h2)
185188
# Modules
186189
CIRCUITPY_ESPCAMERA = 0

ports/espressif/mphalport.c

+1-19
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,7 @@
88
#include "py/mphal.h"
99
#include "supervisor/cpu.h"
1010

11-
#if defined(CONFIG_IDF_TARGET_ESP32)
12-
#include "components/esp_rom/include/esp32/rom/ets_sys.h"
13-
#elif defined(CONFIG_IDF_TARGET_ESP32C2)
14-
#include "components/esp_rom/include/esp32c2/rom/ets_sys.h"
15-
#elif defined(CONFIG_IDF_TARGET_ESP32P4)
16-
#include "components/esp_rom/include/esp32p4/rom/ets_sys.h"
17-
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
18-
#include "components/esp_rom/include/esp32c3/rom/ets_sys.h"
19-
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
20-
#include "components/esp_rom/include/esp32c6/rom/ets_sys.h"
21-
#elif defined(CONFIG_IDF_TARGET_ESP32H2)
22-
#include "components/esp_rom/include/esp32h2/rom/ets_sys.h"
23-
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
24-
#include "components/esp_rom/include/esp32s2/rom/ets_sys.h"
25-
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
26-
#include "components/esp_rom/include/esp32s3/rom/ets_sys.h"
27-
#else
28-
#error Unknown CONFIG_IDF_TARGET_xxx
29-
#endif
11+
#include "rom/ets_sys.h"
3012

3113
#include "esp_attr.h"
3214

ports/espressif/supervisor/port.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ static void _never_reset_spi_ram_flash(void) {
190190

191191
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
192192
if (spiconfig == ESP_ROM_EFUSE_FLASH_DEFAULT_SPI) {
193-
never_reset_pin_number(SPI_IOMUX_PIN_NUM_CLK);
194-
never_reset_pin_number(SPI_IOMUX_PIN_NUM_CS);
193+
never_reset_pin_number(MSPI_IOMUX_PIN_NUM_CLK);
194+
never_reset_pin_number(MSPI_IOMUX_PIN_NUM_CS0);
195195
never_reset_pin_number(PSRAM_SPIQ_SD0_IO);
196196
never_reset_pin_number(PSRAM_SPID_SD1_IO);
197197
never_reset_pin_number(PSRAM_SPIWP_SD3_IO);

0 commit comments

Comments
 (0)