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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 67 deletions
This file was deleted.

ports/espressif/Makefile

Lines changed: 16 additions & 12 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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
Lines changed: 37 additions & 0 deletions
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

0 commit comments

Comments
 (0)