From 1925c99436eb8dcade019f78a1cfae2b8507685a Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 25 May 2022 15:06:16 +0200 Subject: [PATCH] makefiles/boot/riotboot: set DEBUG_ELFFILE to slot0.elf When doing a `make debug` on a board with riotboot bootloader, the original (non-offset) elf file gets selected. This causes all ROM addresses to be at the wrong offset, leading to strange debug behavior. Set `DEBUG_ELFFILE` to the .elf file that already accounts for the bootloader offset so the debugger gets the correct addresses. --- makefiles/boot/riotboot.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/makefiles/boot/riotboot.mk b/makefiles/boot/riotboot.mk index 61ebef6fcc..58c876e0c2 100644 --- a/makefiles/boot/riotboot.mk +++ b/makefiles/boot/riotboot.mk @@ -45,6 +45,7 @@ $(BINDIR_RIOTBOOT)/slot0.elf: ROM_OFFSET=$(SLOT0_IMAGE_OFFSET) $(BINDIR_RIOTBOOT)/slot1.elf: FW_ROM_LEN=$$((SLOT1_LEN - $(RIOTBOOT_HDR_LEN))) $(BINDIR_RIOTBOOT)/slot1.elf: ROM_OFFSET=$(SLOT1_IMAGE_OFFSET) SLOT_RIOT_ELFS = $(BINDIR_RIOTBOOT)/slot0.elf $(BINDIR_RIOTBOOT)/slot1.elf +DEBUG_ELFFILE ?= $(BINDIR_RIOTBOOT)/slot0.elf # ensure both slot elf files are always linked # this ensures that both "make test" and "make test-murdock" can rely on them