From 7cd9729e6960feb5f05a6e1f3baa27b4b650224e Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 20 Apr 2026 19:52:19 +0800 Subject: [PATCH] feat(esp_rom): add support for esp32s31 Made-with: Cursor --- components/esp_rom/esp32s31/Kconfig.soc_caps.in | 4 ++++ components/esp_rom/esp32s31/esp_rom_caps.h | 1 + .../esp32s31/include/esp32s31/rom/rom_layout.h | 12 +++++++++--- ...sp32s31.rom.libc-suboptimal_for_misaligned_mem.ld | 10 ---------- 4 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 components/esp_rom/esp32s31/ld/esp32s31.rom.libc-suboptimal_for_misaligned_mem.ld diff --git a/components/esp_rom/esp32s31/Kconfig.soc_caps.in b/components/esp_rom/esp32s31/Kconfig.soc_caps.in index 9d4d933fb3..3021424ca5 100644 --- a/components/esp_rom/esp32s31/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32s31/Kconfig.soc_caps.in @@ -71,6 +71,10 @@ config ESP_ROM_HAS_VERSION bool default y +config ESP_ROM_HAS_OUTPUT_PUTC_FUNC + bool + default y + config ESP_ROM_MULTI_HEAP_WALK_PATCH bool default y diff --git a/components/esp_rom/esp32s31/esp_rom_caps.h b/components/esp_rom/esp32s31/esp_rom_caps.h index c165e4e3a2..8af9489d90 100644 --- a/components/esp_rom/esp32s31/esp_rom_caps.h +++ b/components/esp_rom/esp32s31/esp_rom_caps.h @@ -23,4 +23,5 @@ #define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions #define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information +#define ESP_ROM_HAS_OUTPUT_PUTC_FUNC (1) // ROM has esp_rom_output_putc (or ets_write_char_uart) #define ESP_ROM_MULTI_HEAP_WALK_PATCH (1) // ROM does not contain the patch of multi_heap_walk() diff --git a/components/esp_rom/esp32s31/include/esp32s31/rom/rom_layout.h b/components/esp_rom/esp32s31/include/esp32s31/rom/rom_layout.h index a53820ac7c..8fdaa2d6af 100644 --- a/components/esp_rom/esp32s31/include/esp32s31/rom/rom_layout.h +++ b/components/esp_rom/esp32s31/include/esp32s31/rom/rom_layout.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,11 +12,12 @@ extern "C" { #endif +#define CORE_NUM 2 #define SUPPORT_BTDM 0 #define SUPPORT_BTBB 0 -#define SUPPORT_WIFI 0 +#define SUPPORT_WIFI 1 #define SUPPORT_USB_DWCOTG 1 -#define SUPPORT_COEXIST 0 +#define SUPPORT_COEXIST 1 #define SUPPORT_MBEDTLS 0 /* Structure and functions for returning ROM global layout @@ -91,6 +92,11 @@ typedef struct { void *dram_start_uart_rom; void *dram_end_uart_rom; + + void *eh_frame_vaddr_rom; + void *eh_frame_hdr_vaddr_rom; + + void *drom_start; } ets_rom_layout_t; extern const ets_rom_layout_t *const ets_rom_layout_p; diff --git a/components/esp_rom/esp32s31/ld/esp32s31.rom.libc-suboptimal_for_misaligned_mem.ld b/components/esp_rom/esp32s31/ld/esp32s31.rom.libc-suboptimal_for_misaligned_mem.ld deleted file mode 100644 index 0f05ada038..0000000000 --- a/components/esp_rom/esp32s31/ld/esp32s31.rom.libc-suboptimal_for_misaligned_mem.ld +++ /dev/null @@ -1,10 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* These functions are not well optimized for misaligned memory access. - * See details in the https://sourceware.org/pipermail/newlib/2025/021470.html - * patch series. */ - -/* TODO: ESP32S31 IDF-14690 */