diff --git a/boards/xtensa/esp32/CMakeLists.txt b/boards/xtensa/esp32/CMakeLists.txt new file mode 100644 index 000000000000..25413b92c3c4 --- /dev/null +++ b/boards/xtensa/esp32/CMakeLists.txt @@ -0,0 +1,11 @@ + +if(CONFIG_BOOTLOADER_ESP_IDF) + add_custom_target(EspIdfBootloader + COMMAND PATH=$ENV{PATH}:${ESPRESSIF_TOOLCHAIN_PATH}/bin make IDF_PATH=${ESP_IDF_PATH} -C ${ESP_IDF_PATH}/examples/get-started/hello_world/ BUILD_DIR_BASE=${CMAKE_BINARY_DIR}/esp-idf defconfig + COMMAND PATH=$ENV{PATH}:${ESPRESSIF_TOOLCHAIN_PATH}/bin make IDF_PATH=${ESP_IDF_PATH} -C ${ESP_IDF_PATH}/examples/get-started/hello_world/ BUILD_DIR_BASE=${CMAKE_BINARY_DIR}/esp-idf bootloader + COMMAND PATH=$ENV{PATH}:${ESPRESSIF_TOOLCHAIN_PATH}/bin make IDF_PATH=${ESP_IDF_PATH} -C ${ESP_IDF_PATH}/examples/get-started/hello_world/ BUILD_DIR_BASE=${CMAKE_BINARY_DIR}/esp-idf partition_table + ) + + add_dependencies(app EspIdfBootloader) + +endif() diff --git a/misc/Kconfig b/misc/Kconfig index c658c34c3901..c12f36f76f0c 100644 --- a/misc/Kconfig +++ b/misc/Kconfig @@ -338,6 +338,16 @@ config BOOTLOADER_MCUBOOT * Including dts/common/mcuboot.overlay when building the Device Tree in order to place and link the image at the slot0 offset +config BOOTLOADER_ESP_IDF + bool + prompt "ESP-IDF bootloader support" + default n + help + This option will trigger the compilation of the ESP-IDF booloader + inside the build folder. + At flash time, the bootloader will be flashed with the zephyr image + depends on SOC_ESP32 + config BOOTLOADER_KEXEC bool prompt "Boot using Linux kexec() system call"