mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
make bootloader depend on IDF_TARGET
This commit is contained in:
parent
041c784ff8
commit
78034879a8
@ -10,28 +10,28 @@ if(NOT IDF_PATH)
|
|||||||
"in by the parent build process.")
|
"in by the parent build process.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc main efuse)
|
set(COMPONENTS bootloader esptool_py partition_table soc bootloader_support log spi_flash micro-ecc main efuse)
|
||||||
set(BOOTLOADER_BUILD 1)
|
set(BOOTLOADER_BUILD 1)
|
||||||
add_definitions(-DBOOTLOADER_BUILD=1)
|
add_definitions(-DBOOTLOADER_BUILD=1)
|
||||||
|
|
||||||
set(COMPONENT_REQUIRES_COMMON log esp32 soc esp_rom esp_common xtensa)
|
set(COMPONENT_REQUIRES_COMMON log soc esp_rom esp_common xtensa)
|
||||||
|
|
||||||
include("${IDF_PATH}/tools/cmake/project.cmake")
|
include("${IDF_PATH}/tools/cmake/project.cmake")
|
||||||
project(bootloader)
|
project(bootloader)
|
||||||
|
|
||||||
target_linker_script(bootloader.elf
|
target_linker_script(bootloader.elf
|
||||||
"main/esp32.bootloader.ld"
|
"main/${IDF_TARGET}.bootloader.ld"
|
||||||
"main/esp32.bootloader.rom.ld"
|
"main/${IDF_TARGET}.bootloader.rom.ld"
|
||||||
)
|
)
|
||||||
|
|
||||||
# as cmake won't attach linker args to a header-only library, attach
|
# as cmake won't attach linker args to a header-only library, attach
|
||||||
# linker args directly to the bootloader.elf
|
# linker args directly to the bootloader.elf
|
||||||
set(ESP32_BOOTLOADER_LINKER_SCRIPTS
|
set(BOOTLOADER_LINKER_SCRIPTS
|
||||||
"../../esp_rom/esp32/ld/esp32.rom.ld"
|
"${IDF_PATH}/components/esp_rom/${IDF_TARGET}/ld/${IDF_TARGET}.rom.ld"
|
||||||
"../../esp_rom/esp32/ld/esp32.rom.spiram_incompatible_fns.ld"
|
"${IDF_PATH}/components/esp_rom/${IDF_TARGET}/ld/${IDF_TARGET}.rom.spiram_incompatible_fns.ld"
|
||||||
"../../esp32/ld/esp32.peripherals.ld")
|
"${IDF_PATH}/components/${IDF_TARGET}/ld/${IDF_TARGET}.peripherals.ld")
|
||||||
|
|
||||||
target_linker_script(bootloader.elf ${ESP32_BOOTLOADER_LINKER_SCRIPTS})
|
target_linker_script(bootloader.elf ${BOOTLOADER_LINKER_SCRIPTS})
|
||||||
|
|
||||||
target_link_libraries(bootloader.elf gcc)
|
target_link_libraries(bootloader.elf gcc)
|
||||||
|
|
||||||
|
@ -14,11 +14,11 @@ COMPONENTS := esptool_py bootloader_support log spi_flash micro-ecc soc main efu
|
|||||||
CFLAGS =
|
CFLAGS =
|
||||||
CXXFLAGS =
|
CXXFLAGS =
|
||||||
|
|
||||||
#We cannot include the esp32, esp_rom, esp_common component directly but we need their includes.
|
#We cannot include the idf_target, esp_rom, esp_common component directly but we need their includes.
|
||||||
CFLAGS += -I $(IDF_PATH)/components/esp32/include
|
CFLAGS += -I $(IDF_PATH)/components/$(IDF_TARGET)/include
|
||||||
CFLAGS += -I $(IDF_PATH)/components/esp_rom/include
|
CFLAGS += -I $(IDF_PATH)/components/esp_rom/include
|
||||||
CFLAGS += -I $(IDF_PATH)/components/esp_common/include
|
CFLAGS += -I $(IDF_PATH)/components/esp_common/include
|
||||||
CFLAGS += -I $(IDF_PATH)/components/xtensa/include -I $(IDF_PATH)/components/xtensa/esp32/include
|
CFLAGS += -I $(IDF_PATH)/components/xtensa/include -I $(IDF_PATH)/components/xtensa/$(IDF_TARGET)/include
|
||||||
|
|
||||||
# The bootloader pseudo-component is also included in this build, for its Kconfig.projbuild to be included.
|
# The bootloader pseudo-component is also included in this build, for its Kconfig.projbuild to be included.
|
||||||
#
|
#
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
LINKER_SCRIPTS := \
|
LINKER_SCRIPTS := \
|
||||||
esp32.bootloader.ld \
|
$(IDF_TARGET).bootloader.ld \
|
||||||
$(IDF_PATH)/components/esp_rom/esp32/ld/esp32.rom.ld \
|
$(IDF_TARGET).bootloader.rom.ld \
|
||||||
$(IDF_PATH)/components/esp_rom/esp32/ld/esp32.rom.spiram_incompatible_fns.ld \
|
$(IDF_PATH)/components/esp_rom/$(IDF_TARGET)/ld/$(IDF_TARGET).rom.ld \
|
||||||
$(IDF_PATH)/components/esp32/ld/esp32.peripherals.ld \
|
$(IDF_PATH)/components/esp_rom/$(IDF_TARGET)/ld/$(IDF_TARGET).rom.spiram_incompatible_fns.ld \
|
||||||
esp32.bootloader.rom.ld
|
$(IDF_PATH)/components/$(IDF_TARGET)/ld/$(IDF_TARGET).peripherals.ld
|
||||||
|
|
||||||
ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
|
ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
|
||||||
LINKER_SCRIPTS += $(IDF_PATH)/components/esp_rom/esp32/ld/esp32.rom.spiflash.ld
|
LINKER_SCRIPTS += $(IDF_PATH)/components/esp_rom/$(IDF_TARGET)/ld/$(IDF_TARGET).rom.spiflash.ld
|
||||||
endif
|
endif
|
||||||
|
|
||||||
COMPONENT_ADD_LDFLAGS += -L $(COMPONENT_PATH) $(addprefix -T ,$(LINKER_SCRIPTS))
|
COMPONENT_ADD_LDFLAGS += -L $(COMPONENT_PATH) $(addprefix -T ,$(LINKER_SCRIPTS))
|
||||||
|
@ -61,6 +61,11 @@ macro(idf_set_variables)
|
|||||||
set_default(IDF_COMPONENT_REQUIRES_COMMON "cxx ${IDF_TARGET} newlib freertos heap log soc \
|
set_default(IDF_COMPONENT_REQUIRES_COMMON "cxx ${IDF_TARGET} newlib freertos heap log soc \
|
||||||
esp_rom esp_common xtensa")
|
esp_rom esp_common xtensa")
|
||||||
|
|
||||||
|
list(FIND IDF_COMPONENT_REQUIRES_COMMON "${IDF_TARGET}" result)
|
||||||
|
if(result EQUAL -1)
|
||||||
|
list(APPEND IDF_COMPONENT_REQUIRES_COMMON "${IDF_TARGET}")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(IDF_PROJECT_PATH "${CMAKE_SOURCE_DIR}")
|
set(IDF_PROJECT_PATH "${CMAKE_SOURCE_DIR}")
|
||||||
|
|
||||||
set(ESP_PLATFORM 1 CACHE BOOL INTERNAL)
|
set(ESP_PLATFORM 1 CACHE BOOL INTERNAL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user