From 3da2914345e8f158dc69076a10594e0336fdd295 Mon Sep 17 00:00:00 2001 From: eightycc Date: Thu, 8 May 2025 07:17:05 -0700 Subject: [PATCH] For Espressif boards: o For Xtensa cores, wraps `longjmp` with a patched implementation that protects register window update in a critical section o Adds support for `ENABLE_JTAG=1` --- ports/espressif/Makefile | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index bdf0fd53f6876..ac3387332fdd8 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -202,21 +202,24 @@ else endif ifeq ($(IDF_TARGET_ARCH),xtensa) -# Remove the last two flags once TinyUSB is updated with the `#include ` instead of -# `#include "xtensa/xtensa_api.h"`. + # Remove the last two flags once TinyUSB is updated with the `#include ` instead of + # `#include "xtensa/xtensa_api.h"`. -CFLAGS += -mlongcalls -isystem esp-idf/components/xtensa/deprecated_include/ -Wno-error=cpp + CFLAGS += -mlongcalls -isystem esp-idf/components/xtensa/deprecated_include/ -Wno-error=cpp + + # Wrap longjmp with a patched version that protects register window update with a critical section + LDFLAGS += -Wl,--wrap=longjmp else ifeq ($(IDF_TARGET_ARCH),riscv) -ifeq ($(IDF_TARGET),esp32p4) -CFLAGS += -march=rv32imafc_zicsr_zifencei_xesppie -mabi=ilp32f -else -CFLAGS += -march=rv32imac_zicsr_zifencei -endif + ifeq ($(IDF_TARGET),esp32p4) + CFLAGS += -march=rv32imafc_zicsr_zifencei_xesppie -mabi=ilp32f + else + CFLAGS += -march=rv32imac_zicsr_zifencei + endif -LDFLAGS += \ - -Lesp-idf/components/riscv/ld \ - -Trom.api.ld + LDFLAGS += \ + -Lesp-idf/components/riscv/ld \ + -Trom.api.ld endif $(BUILD)/lib/tlsf/tlsf.o: CFLAGS += -Wno-cast-align @@ -545,6 +548,10 @@ else DEBUG_SDKCONFIG = esp-idf-config/sdkconfig-opt.defaults endif +ifeq ($(ENABLE_JTAG), 1) + CFLAGS += -DENABLE_JTAG=1 +endif + SDKCONFIGS := esp-idf-config/sdkconfig.defaults;$(DEBUG_SDKCONFIG);$(FLASH_SIZE_SDKCONFIG);$(FLASH_MODE_SDKCONFIG);$(FLASH_SPEED_SDKCONFIG);$(PSRAM_SDKCONFIG);$(PSRAM_SIZE_SDKCONFIG);$(PSRAM_MODE_SDKCONFIG);$(PSRAM_SPEED_SDKCONFIG);$(TARGET_SDKCONFIG);boards/$(BOARD)/sdkconfig ifneq ($(CIRCUITPY_BLEIO_NATIVE),0) SDKCONFIGS := esp-idf-config/sdkconfig-ble.defaults;$(SDKCONFIGS) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy