From 3894247548838e66062617956c6e90d306d5ccec Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sat, 13 Feb 2021 22:53:06 +1300 Subject: Use simulator ELF, not real ELF, with gdb --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0a5c710..b5cb2e8 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ AVRDUDE ?= avrdude QEMU ?= qemu-system-avr REAL_ELF = build/altimeter.elf +SIM_ELF = build/altimeter_sim.elf # options for native (i.e. unit test) UNITY_SRC ?= unity/src @@ -35,12 +36,12 @@ all: build/altimeter_sim.elf build/altimeter.hex test size # Run the sim build software in qemu, halted ready for `make gdb` to attach and # continue. Note that sim build mocks out some hardware components -emu: build/altimeter_sim.elf +emu: $(SIM_ELF) $(QEMU) -s -S -nographic -machine mega2560 -bios $< # Attach GDB session to qemu instance started with `make emu` gdb: - $(GDB) -ex "target remote :1234" $(REAL_ELF) + $(GDB) -ex "target remote :1234" $(SIM_ELF) # Flash AVR software to microcontroller with AVRdude flash: build/altimeter.hex $(AVRDUDE) -F -V -c avr109 -p $(MCU) -P $(PORT) -b 115200 -U flash:w:$< -- cgit v1.1