2019-03-14 09:29:32 +00:00
|
|
|
if(BOOTLOADER_BUILD)
|
|
|
|
# For bootloader, all we need is headers
|
|
|
|
set(COMPONENT_ADD_INCLUDEDIRS "include")
|
|
|
|
set(COMPONENT_REQUIRES ${IDF_COMPONENTS})
|
|
|
|
set(COMPONENT_SRCS)
|
|
|
|
register_component()
|
2019-05-27 06:29:43 +00:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
set(scripts "${target}/ld/${target}.rom.ld")
|
|
|
|
if(target STREQUAL "esp32")
|
|
|
|
list(APPEND scripts
|
|
|
|
"${target}/ld/${target}.rom.newlib-funcs.ld"
|
|
|
|
"${target}/ld/${target}.rom.libgcc.ld")
|
|
|
|
elseif(target STREQUAL "esp32s2beta")
|
|
|
|
list(APPEND scripts
|
|
|
|
"${target}/ld/${target}.rom.spiflash.ld"
|
|
|
|
"${target}/ld/${target}.rom.spiram_incompatible_fns.ld")
|
|
|
|
endif()
|
2019-05-10 02:53:08 +00:00
|
|
|
target_linker_script(${COMPONENT_LIB} "${scripts}")
|
2019-03-14 09:29:32 +00:00
|
|
|
else()
|
|
|
|
# Regular app build
|
|
|
|
set(COMPONENT_SRCS "esp_rom.c")
|
|
|
|
set(COMPONENT_ADD_INCLUDEDIRS "include")
|
|
|
|
|
|
|
|
register_component()
|
|
|
|
|
2019-06-06 02:57:29 +00:00
|
|
|
if (IDF_TARGET STREQUAL "esp32")
|
2019-05-27 06:29:43 +00:00
|
|
|
set(scripts
|
|
|
|
"esp32/ld/esp32.rom.ld"
|
|
|
|
"esp32/ld/esp32.rom.libgcc.ld"
|
|
|
|
"esp32/ld/esp32.rom.syscalls.ld"
|
|
|
|
"esp32/ld/esp32.rom.newlib-data.ld"
|
|
|
|
)
|
|
|
|
target_linker_script(${COMPONENT_LIB} "${scripts}")
|
2019-03-14 09:29:32 +00:00
|
|
|
|
2019-05-27 06:29:43 +00:00
|
|
|
if(NOT CONFIG_SPIRAM_CACHE_WORKAROUND)
|
|
|
|
target_linker_script(${COMPONENT_LIB} "esp32/ld/esp32.rom.newlib-funcs.ld")
|
|
|
|
endif()
|
2019-03-14 09:29:32 +00:00
|
|
|
|
2019-05-27 06:29:43 +00:00
|
|
|
if(CONFIG_NEWLIB_NANO_FORMAT)
|
|
|
|
target_linker_script(${COMPONENT_LIB} "esp32/ld/esp32.rom.newlib-nano.ld")
|
|
|
|
endif()
|
2019-03-14 09:29:32 +00:00
|
|
|
|
2019-05-27 06:29:43 +00:00
|
|
|
if(NOT GCC_NOT_5_2_0)
|
|
|
|
target_linker_script(${COMPONENT_LIB} "esp32/ld/esp32.rom.newlib-locale.ld")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT CONFIG_SPI_FLASH_ROM_DRIVER_PATCH)
|
|
|
|
target_linker_script(${COMPONENT_LIB} "esp32/ld/esp32.rom.spiflash.ld")
|
|
|
|
endif()
|
2019-03-29 04:37:51 +00:00
|
|
|
|
2019-06-06 02:57:29 +00:00
|
|
|
elseif(IDF_TARGET STREQUAL "esp32s2beta")
|
|
|
|
set(scripts "esp32s2beta/ld/esp32s2beta.rom.ld"
|
|
|
|
"esp32s2beta/ld/esp32s2beta.rom.nanofmt.ld"
|
|
|
|
"esp32s2beta/ld/esp32s2beta.rom.spiflash.ld"
|
|
|
|
"esp32s2beta/ld/esp32s2beta.rom.spiram_incompatible_fns.ld")
|
|
|
|
target_linker_script(${COMPONENT_LIB} "${scripts}")
|
2019-03-14 09:29:32 +00:00
|
|
|
endif()
|
2019-05-27 06:29:43 +00:00
|
|
|
|
2019-03-14 09:29:32 +00:00
|
|
|
endif()
|