Skip to content

Commit 95ce61d

Browse files
agattidpgeorge
authored andcommitted
esp32: Use better build settings for ESP32-C3.
ESP32-C3 is not Xtensa-based, so build settings are now tailored a bit better following that fact. ESP-IDF 5.x already adds architecture-specific modules by itself so there is no need to specify either the `xtensa` or the `riscv` module in the build settings. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
1 parent 4cffa84 commit 95ce61d

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

ports/esp32/esp32_common.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ list(APPEND IDF_COMPONENTS
134134
spi_flash
135135
ulp
136136
vfs
137-
xtensa
138137
)
139138

140139
# Register the main IDF component.
@@ -161,7 +160,9 @@ idf_component_register(
161160
set(MICROPY_TARGET ${COMPONENT_TARGET})
162161

163162
# Define mpy-cross flags, for use with frozen code.
163+
if(NOT IDF_TARGET STREQUAL "esp32c3")
164164
set(MICROPY_CROSS_FLAGS -march=xtensawin)
165+
endif()
165166

166167
# Set compile options for this port.
167168
target_compile_definitions(${MICROPY_TARGET} PUBLIC

ports/esp32/main_esp32c3/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ if(NOT MICROPY_PORT_DIR)
99
endif()
1010

1111
list(APPEND MICROPY_SOURCE_LIB ${MICROPY_DIR}/shared/runtime/gchelper_generic.c)
12-
list(APPEND IDF_COMPONENTS riscv)
1312

1413
include(${MICROPY_PORT_DIR}/esp32_common.cmake)

py/mkrules.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,16 @@ if(MICROPY_FROZEN_MANIFEST)
212212
)
213213
endif()
214214

215+
if(NOT MICROPY_CROSS_FLAGS)
216+
set(MICROPY_CROSS_FLAGS "")
217+
else()
218+
set(MICROPY_CROSS_FLAGS "-f${MICROPY_CROSS_FLAGS}")
219+
endif()
220+
215221
add_custom_target(
216222
BUILD_FROZEN_CONTENT ALL
217223
BYPRODUCTS ${MICROPY_FROZEN_CONTENT}
218-
COMMAND ${Python3_EXECUTABLE} ${MICROPY_DIR}/tools/makemanifest.py -o ${MICROPY_FROZEN_CONTENT} -v "MPY_DIR=${MICROPY_DIR}" -v "MPY_LIB_DIR=${MICROPY_LIB_DIR}" -v "PORT_DIR=${MICROPY_PORT_DIR}" -v "BOARD_DIR=${MICROPY_BOARD_DIR}" -b "${CMAKE_BINARY_DIR}" -f${MICROPY_CROSS_FLAGS} --mpy-tool-flags=${MICROPY_MPY_TOOL_FLAGS} ${MICROPY_FROZEN_MANIFEST}
224+
COMMAND ${Python3_EXECUTABLE} ${MICROPY_DIR}/tools/makemanifest.py -o ${MICROPY_FROZEN_CONTENT} -v "MPY_DIR=${MICROPY_DIR}" -v "MPY_LIB_DIR=${MICROPY_LIB_DIR}" -v "PORT_DIR=${MICROPY_PORT_DIR}" -v "BOARD_DIR=${MICROPY_BOARD_DIR}" -b "${CMAKE_BINARY_DIR}" ${MICROPY_CROSS_FLAGS} --mpy-tool-flags=${MICROPY_MPY_TOOL_FLAGS} ${MICROPY_FROZEN_MANIFEST}
219225
DEPENDS
220226
${MICROPY_QSTRDEFS_GENERATED}
221227
${MICROPY_ROOT_POINTERS}

0 commit comments

Comments
 (0)
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