From d07787ee7bf507ea75d07fb7b253ca0c8e7517ba Mon Sep 17 00:00:00 2001 From: Peter M Date: Wed, 28 Feb 2024 23:21:51 +0100 Subject: [PATCH] Add all Esp32-x BOOTLOADER_OFFSET Esp32-S2 Offset was not correct - this PR adds all offsets as documented here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/bootloader.html Signed-off-by: Peter M --- src/platforms/esp32/tools/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/platforms/esp32/tools/CMakeLists.txt b/src/platforms/esp32/tools/CMakeLists.txt index aedcd33893..f39d2cb0bd 100644 --- a/src/platforms/esp32/tools/CMakeLists.txt +++ b/src/platforms/esp32/tools/CMakeLists.txt @@ -23,15 +23,24 @@ project (ReleaseEsp32) ## Build image tools for target chip +# BOOTLOADER_OFFSET +# https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/bootloader.html + set(BOOTLOADER_OFFSET "0x1000") -if(${CONFIG_IDF_TARGET} STREQUAL "esp32s3") +if( ${CONFIG_IDF_TARGET} STREQUAL "esp32s2") + set(BOOTLOADER_OFFSET "0x1000") +elseif(${CONFIG_IDF_TARGET} STREQUAL "esp32s3") + set(BOOTLOADER_OFFSET "0x0") +elseif(${CONFIG_IDF_TARGET} STREQUAL "esp32c2") set(BOOTLOADER_OFFSET "0x0") elseif(${CONFIG_IDF_TARGET} STREQUAL "esp32c3") set(BOOTLOADER_OFFSET "0x0") elseif(${CONFIG_IDF_TARGET} STREQUAL "esp32c6") set(BOOTLOADER_OFFSET "0x0") -elseif( ${CONFIG_IDF_TARGET} STREQUAL "esp32s2") +elseif(${CONFIG_IDF_TARGET} STREQUAL "esp32h2") set(BOOTLOADER_OFFSET "0x0") +elseif(${CONFIG_IDF_TARGET} STREQUAL "esp32p4") + set(BOOTLOADER_OFFSET "0x2000") endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mkimage.config.in ${CMAKE_BINARY_DIR}/mkimage.config)