2021-01-05 21:59:55 +01:00
|
|
|
QEMU ?= qemu-system-arm
|
|
|
|
QEMU_MACHINE ?= $(BOARD)
|
2020-11-22 10:36:22 +01:00
|
|
|
FLASHFILE ?= $(ELFFILE)
|
2020-11-20 14:17:54 +01:00
|
|
|
|
2022-03-04 13:44:51 +01:00
|
|
|
ifeq (,$(EMULATOR_TMP_DIR))
|
|
|
|
EMULATOR_TMP_DIR := $(shell mktemp -td riot_$(APPLICATION)_$(BOARD).XXXXX)
|
2022-02-19 00:03:13 +01:00
|
|
|
endif
|
|
|
|
|
2022-03-04 13:44:51 +01:00
|
|
|
EMULATOR_SERIAL_PORT ?= $(EMULATOR_TMP_DIR)/uart
|
|
|
|
EMULATOR_MONITOR ?= $(EMULATOR_TMP_DIR)/mon
|
2021-01-05 21:59:55 +01:00
|
|
|
|
|
|
|
# Configure emulator variables
|
|
|
|
EMULATOR ?= $(QEMU)
|
2022-02-19 00:03:13 +01:00
|
|
|
EMULATOR_FLAGS ?= -machine $(QEMU_MACHINE) \
|
|
|
|
-device loader,file=$(ELFFILE) \
|
|
|
|
-serial unix:$(EMULATOR_SERIAL_PORT)_socket,server=on,wait=off \
|
|
|
|
-monitor unix:$(EMULATOR_MONITOR)_socket,server=on,wait=off \
|
2021-01-05 21:59:55 +01:00
|
|
|
-nographic
|
2020-11-21 22:34:41 +01:00
|
|
|
|
2020-11-22 18:14:56 +01:00
|
|
|
# Configure the qemu terminal access
|
2020-11-26 14:43:20 +01:00
|
|
|
PORT = $(EMULATOR_SERIAL_PORT)
|
2020-11-22 18:14:56 +01:00
|
|
|
RIOT_TERMPROG := $(TERMPROG)
|
|
|
|
RIOT_TERMFLAGS := $(TERMFLAGS)
|
|
|
|
TERMPROG := $(RIOTTOOLS)/emulator/term.sh
|
2022-03-04 13:44:51 +01:00
|
|
|
TERMFLAGS := $(RIOT_EMULATOR) $(BOARD) $(APPDIR) $(RIOT_TERMPROG) '$(RIOT_TERMFLAGS)' $(EMULATOR_SERIAL_PORT) $(EMULATOR_TMP_DIR)
|
2022-02-19 00:03:13 +01:00
|
|
|
|
|
|
|
# Configure the debugger ,wait=off
|
2022-03-04 13:44:51 +01:00
|
|
|
GDB_REMOTE ?= $(EMULATOR_TMP_DIR)/gdb_socket
|
2020-11-22 18:14:56 +01:00
|
|
|
|
2022-02-19 00:03:13 +01:00
|
|
|
QEMU_DEBUG_FLAGS += -S -gdb unix:$(GDB_REMOTE),server=on
|
2020-11-21 22:34:41 +01:00
|
|
|
QEMU_DEBUG_FLAGS += $(EMULATOR_FLAGS)
|
|
|
|
|
|
|
|
DEBUGSERVER ?= $(EMULATOR)
|
|
|
|
DEBUGSERVER_FLAGS ?= $(QEMU_DEBUG_FLAGS)
|
|
|
|
|
2022-05-31 12:39:16 +02:00
|
|
|
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(DEBUG_ELFFILE) $(GDB_REMOTE) $(EMULATOR_TMP_DIR)
|
2020-11-21 22:50:18 +01:00
|
|
|
DEBUGGER ?= $(RIOTTOOLS)/emulator/debug.sh
|
2020-11-26 14:43:20 +01:00
|
|
|
|
|
|
|
# No flasher available with qemu emulator
|
|
|
|
FLASHER ?=
|
|
|
|
FFLAGS ?=
|