aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2021-02-13 22:53:06 +1300
committerDavid Phillips <david@yeah.nah.nz>2021-02-13 22:53:06 +1300
commit3894247548838e66062617956c6e90d306d5ccec (patch)
treef408fc79d1d1aa02c6795c93a888476fa84fc545
parent292d2fb701a6a65f969e2f44e4e7e9d707a147b7 (diff)
downloadaltimeter-3894247548838e66062617956c6e90d306d5ccec.tar.xz
Use simulator ELF, not real ELF, with gdb
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
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:$<