diff --git a/sys/riotboot/Makefile b/sys/riotboot/Makefile index 344672d2e2..448312b317 100644 --- a/sys/riotboot/Makefile +++ b/sys/riotboot/Makefile @@ -2,6 +2,8 @@ SUBMODULES := 1 ifneq (,$(filter riotboot_slot,$(USEMODULE))) CFLAGS += -DSLOT0_OFFSET=$(SLOT0_OFFSET) + CFLAGS += -DSLOT1_OFFSET=$(SLOT1_OFFSET) + CFLAGS += -DNUM_SLOTS=$(NUM_SLOTS) endif include $(RIOTBASE)/Makefile.base diff --git a/sys/riotboot/slot.c b/sys/riotboot/slot.c index 09cac62a78..4d38e6568d 100644 --- a/sys/riotboot/slot.c +++ b/sys/riotboot/slot.c @@ -33,6 +33,9 @@ */ const riotboot_hdr_t * const riotboot_slots[] = { (riotboot_hdr_t*)(CPU_FLASH_BASE + SLOT0_OFFSET), /* First slot address -> firmware image */ +#if NUM_SLOTS == 2 + (riotboot_hdr_t*)(CPU_FLASH_BASE + SLOT1_OFFSET), /* Second slot address -> firmware image */ +#endif }; /* Calculate the number of slots */