From 62be0c0585b147686ad3a41fdce181c8a7e95cd1 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 22 Mar 2025 21:39:13 +0100 Subject: fw: btl: Move MCUboot build here The directory structure should be less nested and with shorter paths. This is a first step. --- .gitmodules | 2 +- fw/CMakeLists.txt | 8 ++++---- fw/btl/bootloader.conf | 7 +++++++ fw/btl/mcuboot | 1 + fw/nucleo.sh | 4 ++-- fw/zephyrproject/bootloader/bootloader.conf | 7 ------- fw/zephyrproject/bootloader/mcuboot | 1 - 7 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 fw/btl/bootloader.conf create mode 160000 fw/btl/mcuboot delete mode 100644 fw/zephyrproject/bootloader/bootloader.conf delete mode 160000 fw/zephyrproject/bootloader/mcuboot diff --git a/.gitmodules b/.gitmodules index d26a2ad..f12e67b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -11,5 +11,5 @@ path = fw/zephyrproject/modules/crypto/mbedtls url = https://github.com/zephyrproject-rtos/mbedtls.git [submodule "fw/zephyrproject/bootloader/mcuboot"] - path = fw/zephyrproject/bootloader/mcuboot + path = fw/btl/mcuboot url = https://github.com/zephyrproject-rtos/mcuboot.git diff --git a/fw/CMakeLists.txt b/fw/CMakeLists.txt index 1b978b7..6be1c21 100644 --- a/fw/CMakeLists.txt +++ b/fw/CMakeLists.txt @@ -9,7 +9,7 @@ set(ZEPHYR_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/modules/hal/cmsis" "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/modules/hal/stm32" "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/modules/crypto/mbedtls" - "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/bootloader/mcuboot" + "${CMAKE_CURRENT_SOURCE_DIR}/btl/mcuboot" ) string(REPLACE ";" "," ZEPHYR_MODULES_COMMA "${ZEPHYR_MODULES}") @@ -17,14 +17,14 @@ include(ExternalProject) ExternalProject_Add( bootloader PREFIX bootloader - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/bootloader/mcuboot/boot/zephyr" - BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/bootloader" + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/btl/mcuboot/boot/zephyr" + BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/btl" INSTALL_COMMAND "" LIST_SEPARATOR "," CMAKE_ARGS "-DBOARD=nucleo_f767zi" "-DZEPHYR_MODULES=${ZEPHYR_MODULES_COMMA}" - "-DEXTRA_CONF_FILE=${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/bootloader/bootloader.conf" + "-DEXTRA_CONF_FILE=${CMAKE_CURRENT_SOURCE_DIR}/btl/bootloader.conf" -DCONFIG_BOOT_SIGNATURE_KEY_FILE="${KEY}" ) diff --git a/fw/btl/bootloader.conf b/fw/btl/bootloader.conf new file mode 100644 index 0000000..c42b7fc --- /dev/null +++ b/fw/btl/bootloader.conf @@ -0,0 +1,7 @@ +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. + + +CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n +CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y diff --git a/fw/btl/mcuboot b/fw/btl/mcuboot new file mode 160000 index 0000000..346f737 --- /dev/null +++ b/fw/btl/mcuboot @@ -0,0 +1 @@ +Subproject commit 346f7374ff4467e40b5594658f8ac67a5e9813c9 diff --git a/fw/nucleo.sh b/fw/nucleo.sh index be694b8..f625ce6 100755 --- a/fw/nucleo.sh +++ b/fw/nucleo.sh @@ -23,12 +23,12 @@ SCRIPT="$(realpath "$0")" FW="$(dirname "$SCRIPT")" ROOT="$(dirname "$FW")" BUILD="${ROOT}/nucleo" -BOOTLOADER_FIRMWARE="${BUILD}/fw/bootloader/zephyr/zephyr.bin" +BOOTLOADER_FIRMWARE="${BUILD}/fw/btl/zephyr/zephyr.bin" APPLICATION_FIRMWARE="${BUILD}/fw/zephyr/zephyr.bin" APPLICATION_FIRMWARE_SIGNED="${BUILD}/fw/zephyr/zephyr.signed.bin" BOOTLOADER_FLASH_ADDRESS='0x8000000' APPLICATION_FLASH_ADDRESS='0x8040000' -MCUBOOT="${ROOT}/fw/zephyrproject/bootloader/mcuboot" +MCUBOOT="${ROOT}/fw/btl/mcuboot" IMGTOOL="${MCUBOOT}/scripts/imgtool.py" KEY="${HOME}/mcuboot/key.pem" BOARD='nucleo_f767zi' diff --git a/fw/zephyrproject/bootloader/bootloader.conf b/fw/zephyrproject/bootloader/bootloader.conf deleted file mode 100644 index c42b7fc..0000000 --- a/fw/zephyrproject/bootloader/bootloader.conf +++ /dev/null @@ -1,7 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public License, -# v. 2.0. If a copy of the MPL was not distributed with this file, You can -# obtain one at https://mozilla.org/MPL/2.0/. - - -CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n -CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y diff --git a/fw/zephyrproject/bootloader/mcuboot b/fw/zephyrproject/bootloader/mcuboot deleted file mode 160000 index 346f737..0000000 --- a/fw/zephyrproject/bootloader/mcuboot +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 346f7374ff4467e40b5594658f8ac67a5e9813c9 -- cgit v1.2.3-70-g09d2