8000 esp32: Merge the per-SoC "main" components back together. · micropython/micropython@9cec276 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cec276

Browse files
committed
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 e465012. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 4d034f8 commit 9cec276

File tree

18 files changed

+59
-124
lines changed

18 files changed

+59
-124
lines changed

ports/esp32/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,5 @@ set(SDKCONFIG_DEFAULTS ${CMAKE_BINARY_DIR}/sdkconfig.combined)
6161
# Include main IDF cmake file.
6262
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
6363

64-
# Set the location of the main component for the project (one per target).
65-
list(APPEND EXTRA_COMPONENT_DIRS main_${IDF_TARGET})
66-
6764
# Define the project.
6865
project(micropython)

ports/esp32/esp32_common.cmake

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ if(NOT MICROPY_PORT_DIR)
1414
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
1515
endif()
1616

17+
# RISC-V specific inclusions
18+
if(CONFIG_IDF_TARGET_ARCH_RISCV)
19+
list(APPEND MICROPY_SOURCE_LIB ${MICROPY_DIR}/shared/runtime/gchelper_generic.c)
20+
list(APPEND IDF_COMPONENTS riscv)
21+
endif()
22+
23+
if(NOT DEFINED MICROPY_PY_TINYUSB)
24+
if(CONFIG_IDF_TARGET_ESP32S2 OR CONFIG_IDF_TARGET_ESP32S3)
25+
set(MICROPY_PY_TINYUSB ON)
26+
endif()
27+
endif()
28+
1729
# Include core source components.
1830
include(${MICROPY_DIR}/py/py.cmake)
1931

@@ -182,7 +194,7 @@ list(APPEND IDF_COMPONENTS
182194
if (MICROPY_USER_LDFRAGMENTS)
183195
set(MICROPY_LDFRAGMENTS ${MICROPY_USER_LDFRAGMENTS})
184196
else()
185-
set(MICROPY_LDFRAGMENTS linker.lf)
197+
set(MICROPY_LDFRAGMENTS linker_esp32.lf)
186198
endif()
187199

188200
# Register the main IDF component.

ports/esp32/main_esp32/CMakeLists.txt renamed to ports/esp32/main/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if(NOT MICROPY_DIR)
33
get_filename_component(MICROPY_DIR ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE)
44
endif()
55

6-
# Set location of the ESP32 port directory.
6+
# Set location of the esp32 port directory.
77
if(NOT MICROPY_PORT_DIR)
88
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
99
endif()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## IDF Component Manager Manifest File
22
dependencies:
33
espressif/mdns: "~1.1.0"
4+
espressif/esp_tinyusb:
5+
rules:
6+
- if: "target in [esp32s2, esp32s3]"
7+
version: "~1.0.0"
48
idf:
59
version: ">=5.2.0"

ports/esp32/main/linker_esp32.lf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This fixes components/esp_ringbuf/linker.lf for ESP32 only to allow us to put
2+
# non-ISR ringbuf functions in flash.
3+
4+
# Requires that both RINGBUF_PLACE_FUNCTIONS_INTO_FLASH and RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH
5+
# are set to "n" (which is the default), otherwise this would result in duplicate section config
6+
# when resolving the linker fragments.
7+
8+
# The effect of this file is to leave the ISR functions in RAM (which we require), but apply a fixed
9+
# version of RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y (leaving out prvGetFreeSize and prvGetCurMaxSizeByteBuf)
10+
# See https://github.com/espressif/esp-idf/issues/13378
11+
12+
[mapping:esp_ringbuf_fix]
13+
archive: libesp_ringbuf.a
14+
entries:
15+
if IDF_TARGET_ESP32 = y:
16+
# This is exactly the list of functions from RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y,
17+
# but with prvGetFreeSize and prvGetCurMaxSizeByteBuf removed.
18+
ringbuf: prvGetCurMaxSizeNoSplit (default)
19+
ringbuf: prvGetCurMaxSizeAllowSplit (default)
20+
ringbuf: prvInitializeNewRingbuffer (default)
21+
ringbuf: prvReceiveGeneric (default)
22+
ringbuf: vRingbufferDelete (default)
23+
ringbuf: vRingbufferGetInfo (default)
24+
ringbuf: vRingbufferReturnItem (default)
25+
ringbuf: xRingbufferAddToQueueSetRead (default)
26+
ringbuf: xRingbufferCanRead (default)
27+
ringbuf: xRingbufferCreate (default)
28+
ringbuf: xRingbufferCreateStatic (default)
29+
ringbuf: xRingbufferCreateNoSplit (default)
30+
ringbuf: xRingbufferReceive (default)
31+
ringbuf: xRingbufferReceiveSplit (default)
32+
ringbuf: xRingbufferReceiveUpTo (default)
33+
ringbuf: xRingbufferRemoveFromQueueSetRead (default)
34+
ringbuf: xRingbufferSend (default)
35+
ringbuf: xRingbufferSendAcquire (default)
36+
ringbuf: xRingbufferSendComplete (default)
37+
ringbuf: xRingbufferPrintInfo (default)
38+
ringbuf: xRingbufferGetMaxItemSize (default)
39+
ringbuf: xRingbufferGetCurFreeSize (default)
40+
41+
# Everything else will have the default rule already applied (i.e. noflash_text).

ports/esp32/main_esp32/idf_component.yml

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

ports/esp32/main_esp32/linker.lf

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

ports/esp32/main_esp32c3/CMakeLists.txt

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

ports/esp32/main_esp32c3/linker.lf

Lines changed: 0 additions & 1 deletion
This file was deleted.

ports/esp32/main_esp32c6/CMakeLists.txt

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

0 commit comments

Comments
 (0)
0