@@ -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
176180else
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)
238242LDFLAGS += \
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
244247CHIP_COMPONENTS = \
@@ -261,7 +264,6 @@ CHIP_COMPONENTS = \
261264else ifeq ($(IDF_TARGET),esp32c3)
262265LDFLAGS += \
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)
308310LDFLAGS += \
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
314315CHIP_COMPONENTS = \
@@ -392,7 +393,7 @@ SRC_C += \
392393 peripherals/$(IDF_TARGET ) /pins.c
393394
394395ifeq ($(CIRCUITPY_SSL ) ,1)
395- SRC_C += lib/mbedtls_config /crt_bundle.c
396+ SRC_C += common-hal/ssl /crt_bundle.c
396397endif
397398
398399SRC_C += $(wildcard common-hal/espidf/* .c)
@@ -603,7 +604,7 @@ endif
603604
604605ESP_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
605606ifneq ($(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
607608endif
608609ifneq ($(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
638639endif
640+ ifeq ($(IDF_TARGET ) ,esp32p4)
641+ ESP_IDF_COMPONENTS_LINK += esp_security
642+ endif
639643ifneq ($(CIRCUITPY_ESPULP ) ,0)
640644 ESP_IDF_COMPONENTS_LINK += ulp
641645endif
0 commit comments