2020-11-20 22:02:32 +01:00
|
|
|
RENODE ?= renode
|
|
|
|
RENODE_IMAGE_FILE ?= $(ELFFILE)
|
|
|
|
RENODE_BOARD_CONFIG ?= $(BOARDDIR)/dist/board.resc
|
2020-11-22 10:36:22 +01:00
|
|
|
|
|
|
|
# Global build system configurations
|
|
|
|
FLASHFILE ?= $(ELFFILE)
|
2020-11-21 18:45:16 +01:00
|
|
|
EMULATORDEPS += $(RENODE_BOARD_CONFIG)
|
2020-11-20 22:02:32 +01:00
|
|
|
|
|
|
|
# Use renode interactive commands to specify the image file and board config
|
2020-11-21 13:39:16 +01:00
|
|
|
RENODE_CONFIG_FLAGS += -e "set image_file '$(RENODE_IMAGE_FILE)'"
|
|
|
|
RENODE_CONFIG_FLAGS += -e "include @$(RENODE_BOARD_CONFIG)"
|
2020-11-22 18:14:56 +01:00
|
|
|
EMULATOR_PIDFILE ?=
|
|
|
|
ifneq (,$(EMULATOR_PIDFILE))
|
|
|
|
$(info Using Renode pid file $(EMULATOR_PIDFILE))
|
|
|
|
RENODE_CONFIG_FLAGS += --pid-file $(EMULATOR_PIDFILE)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Configure local serial port
|
|
|
|
PORT = /tmp/riot_$(APPLICATION)_$(BOARD)_uart
|
|
|
|
RENODE_CONFIG_FLAGS += -e "emulation CreateUartPtyTerminal \"term\" \"$(PORT)\" true"
|
|
|
|
RENODE_CONFIG_FLAGS += -e "connector Connect sysbus.uart0 term"
|
2020-11-20 22:02:32 +01:00
|
|
|
|
|
|
|
# Set emulator variables
|
2020-11-21 13:39:16 +01:00
|
|
|
EMULATOR_FLAGS ?= $(RENODE_CONFIG_FLAGS) -e start
|
2020-11-20 22:02:32 +01:00
|
|
|
EMULATOR ?= $(RENODE)
|
2020-11-21 18:12:43 +01:00
|
|
|
|
2020-11-22 18:14:56 +01:00
|
|
|
# Configure the terminal
|
|
|
|
RIOT_TERMPROG := $(TERMPROG)
|
|
|
|
RIOT_TERMFLAGS := $(TERMFLAGS)
|
|
|
|
TERMPROG := $(RIOTTOOLS)/emulator/term.sh
|
|
|
|
TERMFLAGS := $(RIOT_EMULATOR) $(BOARD) $(APPDIR) $(RIOT_TERMPROG) '$(RIOT_TERMFLAGS)' $(PORT)
|
|
|
|
|
2020-11-21 18:12:43 +01:00
|
|
|
# Configure the debugger
|
|
|
|
GDB_PORT ?= 3333
|
|
|
|
RENODE_DEBUG_FLAGS += $(RENODE_CONFIG_FLAGS)
|
|
|
|
RENODE_DEBUG_FLAGS += -e "machine StartGdbServer $(GDB_PORT) true"
|
|
|
|
|
|
|
|
DEBUGSERVER ?= $(EMULATOR)
|
|
|
|
DEBUGSERVER_FLAGS ?= $(RENODE_DEBUG_FLAGS)
|
|
|
|
|
|
|
|
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(ELFFILE) $(GDB_PORT) "-ex \"monitor start\""
|
2020-11-21 22:50:18 +01:00
|
|
|
DEBUGGER ?= $(RIOTTOOLS)/emulator/debug.sh
|