From 7b66eb2c470339fdc80ef81b30e899b2fc8112ff Mon Sep 17 00:00:00 2001 From: Joshua DeWeese Date: Mon, 20 Nov 2023 12:08:30 -0500 Subject: [PATCH 1/2] bootloaders/riotboot: add INCLUDES to build If external boards defined in one of the EXTERNAL_BOARD_DIRS folders pulls in a header file external to the RIOT tree and added to the build via the INCLUDES macro, the build will fail to find the header. This patch adds the INCLUDES macro to the bootloader build step so that the headers can be found. --- makefiles/boot/riotboot.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/makefiles/boot/riotboot.mk b/makefiles/boot/riotboot.mk index 8cfac6b0a025..447c9ac08be3 100644 --- a/makefiles/boot/riotboot.mk +++ b/makefiles/boot/riotboot.mk @@ -86,6 +86,7 @@ riotboot/flash-bootloader: riotboot/bootloader/flash riotboot/bootloader/%: $$(if $$(filter riotboot/bootloader/clean,$$@),,$$(BUILDDEPS) pkg-prepare) $(Q)/usr/bin/env -i \ QUIET=$(QUIET) PATH="$(PATH)" USER="$(USER)"\ + INCLUDES="$(INCLUDES)"\ EXTERNAL_BOARD_DIRS="$(EXTERNAL_BOARD_DIRS)" BOARD=$(BOARD)\ DEBUG_ADAPTER_ID=$(DEBUG_ADAPTER_ID) \ IOTLAB_NODE=$(IOTLAB_NODE) \ From 9f27a5a246db519a7048116e8d0ca2f309904306 Mon Sep 17 00:00:00 2001 From: Joshua DeWeese Date: Thu, 21 Dec 2023 16:24:51 -0500 Subject: [PATCH 2/2] sys/riotboot/slot: fix failed build When riotboot/slot.h is included, but riotboot is not enabled in the build, a compiler error occures. This is because SLOT0_LEN is not defined. This patch fixes this by surrounding the offending macrro with a conditional compile. `riotboot_slot_size()` may still be called, in which case it returns 0 for the size of any slot given. --- sys/include/riotboot/slot.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/include/riotboot/slot.h b/sys/include/riotboot/slot.h index ba44c44c1c9d..f49da61c9900 100644 --- a/sys/include/riotboot/slot.h +++ b/sys/include/riotboot/slot.h @@ -116,8 +116,10 @@ void riotboot_slot_dump_addrs(void); static inline size_t riotboot_slot_size(unsigned slot) { switch (slot) { +#if NUM_SLOTS >= 1 case 0: return SLOT0_LEN; +#endif #if NUM_SLOTS == 2 case 1: return SLOT1_LEN;