From 2ab585fd2ebe42a9d6c0030295baf77655589fa9 Mon Sep 17 00:00:00 2001 From: Shubham Kulkarni Date: Thu, 29 Apr 2021 14:25:55 +0530 Subject: [PATCH] boards: esp32: Use proper binary generation command west build generates binary file of around 13MB. Use esptool to generate proper binary file Signed-off-by: Shubham Kulkarni --- boards/xtensa/esp32/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards/xtensa/esp32/CMakeLists.txt b/boards/xtensa/esp32/CMakeLists.txt index 78fd6b8c0fc..5c85d6d897f 100644 --- a/boards/xtensa/esp32/CMakeLists.txt +++ b/boards/xtensa/esp32/CMakeLists.txt @@ -35,6 +35,14 @@ if(CONFIG_BOOTLOADER_ESP_IDF) INSTALL_COMMAND "" ) + if(CONFIG_BUILD_OUTPUT_BIN) + set_property(GLOBAL APPEND PROPERTY extra_post_build_commands + COMMAND python ${ESP_IDF_PATH}/components/esptool_py/esptool/esptool.py + ARGS --chip esp32 elf2image --flash_mode dio --flash_freq 40m + -o ${CMAKE_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.bin + ${CMAKE_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.elf) + endif() + add_dependencies(app EspIdfBootloader EspPartitionTable) board_finalize_runner_args(esp32 "--esp-flash-bootloader=${espidf_build_dir}/bootloader/bootloader.bin")