diff --git a/ports/esp32/esp32_common.cmake b/ports/esp32/esp32_common.cmake index e03d2ff11..059989c10 100644 --- a/ports/esp32/esp32_common.cmake +++ b/ports/esp32/esp32_common.cmake @@ -178,6 +178,13 @@ list(APPEND IDF_COMPONENTS vfs ) +# Provide the default LD fragment if not set +if (MICROPY_USER_LDFRAGMENTS) + set(MICROPY_LDFRAGMENTS ${MICROPY_USER_LDFRAGMENTS}) +else() + set(MICROPY_LDFRAGMENTS linker.lf) +endif() + # Register the main IDF component. idf_component_register( SRCS @@ -197,7 +204,7 @@ idf_component_register( ${MICROPY_BOARD_DIR} ${CMAKE_BINARY_DIR} LDFRAGMENTS - linker.lf + ${MICROPY_LDFRAGMENTS} REQUIRES ${IDF_COMPONENTS} )