esp32: Merge the per-SoC "main" components back together.

Removes redundant metadata from each, shouldn't otherwise change
any build output.

Reverts the split originally added in e4650125.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton
2025-03-04 12:20:02 +11:00
committed by Damien George
parent dafff1fd0e
commit 4b1c666c28
18 changed files with 58 additions and 123 deletions

View File

@@ -61,8 +61,5 @@ set(SDKCONFIG_DEFAULTS ${CMAKE_BINARY_DIR}/sdkconfig.combined)
# Include main IDF cmake file.
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# Set the location of the main component for the project (one per target).
list(APPEND EXTRA_COMPONENT_DIRS main_${IDF_TARGET})
# Define the project.
project(micropython)

View File

@@ -14,6 +14,18 @@ if(NOT MICROPY_PORT_DIR)
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
endif()
# RISC-V specific inclusions
if(CONFIG_IDF_TARGET_ARCH_RISCV)
list(APPEND MICROPY_SOURCE_LIB ${MICROPY_DIR}/shared/runtime/gchelper_generic.c)
list(APPEND IDF_COMPONENTS riscv)
endif()
if(NOT DEFINED MICROPY_PY_TINYUSB)
if(CONFIG_IDF_TARGET_ESP32S2 OR CONFIG_IDF_TARGET_ESP32S3)
set(MICROPY_PY_TINYUSB ON)
endif()
endif()
# Include core source components.
include(${MICROPY_DIR}/py/py.cmake)
@@ -182,7 +194,7 @@ list(APPEND IDF_COMPONENTS
if (MICROPY_USER_LDFRAGMENTS)
set(MICROPY_LDFRAGMENTS ${MICROPY_USER_LDFRAGMENTS})
else()
set(MICROPY_LDFRAGMENTS linker.lf)
set(MICROPY_LDFRAGMENTS linker_esp32.lf)
endif()
# Register the main IDF component.

View File

@@ -1,5 +1,9 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
espressif/esp_tinyusb:
rules:
- if: "target in [esp32s2, esp32s3]"
version: "~1.0.0"
idf:
version: ">=5.2.0"

View File

@@ -0,0 +1,41 @@
# This fixes components/esp_ringbuf/linker.lf for ESP32 only to allow us to put
# non-ISR ringbuf functions in flash.
# Requires that both RINGBUF_PLACE_FUNCTIONS_INTO_FLASH and RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH
# are set to "n" (which is the default), otherwise this would result in duplicate section config
# when resolving the linker fragments.
# The effect of this file is to leave the ISR functions in RAM (which we require), but apply a fixed
# version of RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y (leaving out prvGetFreeSize and prvGetCurMaxSizeByteBuf)
# See https://github.com/espressif/esp-idf/issues/13378
[mapping:esp_ringbuf_fix]
archive: libesp_ringbuf.a
entries:
if IDF_TARGET_ESP32 = y:
# This is exactly the list of functions from RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y,
# but with prvGetFreeSize and prvGetCurMaxSizeByteBuf removed.
ringbuf: prvGetCurMaxSizeNoSplit (default)
ringbuf: prvGetCurMaxSizeAllowSplit (default)
ringbuf: prvInitializeNewRingbuffer (default)
ringbuf: prvReceiveGeneric (default)
ringbuf: vRingbufferDelete (default)
ringbuf: vRingbufferGetInfo (default)
ringbuf: vRingbufferReturnItem (default)
ringbuf: xRingbufferAddToQueueSetRead (default)
ringbuf: xRingbufferCanRead (default)
ringbuf: xRingbufferCreate (default)
ringbuf: xRingbufferCreateStatic (default)
ringbuf: xRingbufferCreateNoSplit (default)
ringbuf: xRingbufferReceive (default)
ringbuf: xRingbufferReceiveSplit (default)
ringbuf: xRingbufferReceiveUpTo (default)
ringbuf: xRingbufferRemoveFromQueueSetRead (default)
ringbuf: xRingbufferSend (default)
ringbuf: xRingbufferSendAcquire (default)
ringbuf: xRingbufferSendComplete (default)
ringbuf: xRingbufferPrintInfo (default)
ringbuf: xRingbufferGetMaxItemSize (default)
ringbuf: xRingbufferGetCurFreeSize (default)
# Everything else will have the default rule already applied (i.e. noflash_text).

View File

@@ -1,39 +0,0 @@
# This fixes components/esp_ringbuf/linker.lf to allow us to put non-ISR ringbuf functions in flash.
# Requires that both RINGBUF_PLACE_FUNCTIONS_INTO_FLASH and RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH
# are set to "n" (which is the default), otherwise this would result in duplicate section config
# when resolving the linker fragments.
# The effect of this file is to leave the ISR functions in RAM (which we require), but apply a fixed
# version of RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y (leaving out prvGetFreeSize and prvGetCurMaxSizeByteBuf)
# See https://github.com/espressif/esp-idf/issues/13378
[mapping:esp_ringbuf_fix]
archive: libesp_ringbuf.a
entries:
# This is exactly the list of functions from RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y,
# but with prvGetFreeSize and prvGetCurMaxSizeByteBuf removed.
ringbuf: prvGetCurMaxSizeNoSplit (default)
ringbuf: prvGetCurMaxSizeAllowSplit (default)
ringbuf: prvInitializeNewRingbuffer (default)
ringbuf: prvReceiveGeneric (default)
ringbuf: vRingbufferDelete (default)
ringbuf: vRingbufferGetInfo (default)
ringbuf: vRingbufferReturnItem (default)
ringbuf: xRingbufferAddToQueueSetRead (default)
ringbuf: xRingbufferCanRead (default)
ringbuf: xRingbufferCreate (default)
ringbuf: xRingbufferCreateStatic (default)
ringbuf: xRingbufferCreateNoSplit (default)
ringbuf: xRingbufferReceive (default)
ringbuf: xRingbufferReceiveSplit (default)
ringbuf: xRingbufferReceiveUpTo (default)
ringbuf: xRingbufferRemoveFromQueueSetRead (default)
ringbuf: xRingbufferSend (default)
ringbuf: xRingbufferSendAcquire (default)
ringbuf: xRingbufferSendComplete (default)
ringbuf: xRingbufferPrintInfo (default)
ringbuf: xRingbufferGetMaxItemSize (default)
ringbuf: xRingbufferGetCurFreeSize (default)
# Everything else will have the default rule already applied (i.e. noflash_text).

View File

@@ -1,14 +0,0 @@
# Set location of base MicroPython directory.
if(NOT MICROPY_DIR)
get_filename_component(MICROPY_DIR ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE)
endif()
# Set location of the ESP32 port directory.
if(NOT MICROPY_PORT_DIR)
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
endif()
list(APPEND MICROPY_SOURCE_LIB ${MICROPY_DIR}/shared/runtime/gchelper_generic.c)
list(APPEND IDF_COMPONENTS riscv)
include(${MICROPY_PORT_DIR}/esp32_common.cmake)

View File

@@ -1,5 +0,0 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
idf:
version: ">=5.2.0"

View File

@@ -1 +0,0 @@
# Empty linker fragment (no workaround required for C3, see main_esp32/linker.lf).

View File

@@ -1,14 +0,0 @@
# Set location of base MicroPython directory.
if(NOT MICROPY_DIR)
get_filename_component(MICROPY_DIR ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE)
endif()
# Set location of the ESP32 port directory.
if(NOT MICROPY_PORT_DIR)
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
endif()
list(APPEND MICROPY_SOURCE_LIB ${MICROPY_DIR}/shared/runtime/gchelper_generic.c)
list(APPEND IDF_COMPONENTS riscv)
include(${MICROPY_PORT_DIR}/esp32_common.cmake)

View File

@@ -1,5 +0,0 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
idf:
version: ">=5.2.0"

View File

@@ -1 +0,0 @@
# Empty linker fragment (no workaround required for C6, see main_esp32/linker.lf).

View File

@@ -1,13 +0,0 @@
# Set location of base MicroPython directory.
if(NOT MICROPY_DIR)
get_filename_component(MICROPY_DIR ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE)
endif()
# Set location of the ESP32 port directory.
if(NOT MICROPY_PORT_DIR)
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
endif()
set(MICROPY_PY_TINYUSB ON)
include(${MICROPY_PORT_DIR}/esp32_common.cmake)

View File

@@ -1,6 +0,0 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
espressif/esp_tinyusb: "~1.0.0"
idf:
version: ">=5.2.0"

View File

@@ -1 +0,0 @@
# Empty linker fragment (no workaround required for S2, see main_esp32/linker.lf).

View File

@@ -1,13 +0,0 @@
# Set location of base MicroPython directory.
if(NOT MICROPY_DIR)
get_filename_component(MICROPY_DIR ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE)
endif()
# Set location of the ESP32 port directory.
if(NOT MICROPY_PORT_DIR)
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
endif()
set(MICROPY_PY_TINYUSB ON)
include(${MICROPY_PORT_DIR}/esp32_common.cmake)

View File

@@ -1,6 +0,0 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
espressif/esp_tinyusb: "~1.0.0"
idf:
version: ">=5.2.0"

View File

@@ -1 +0,0 @@
# Empty linker fragment (no workaround required for S3, see main_esp32/linker.lf).