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
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
2020-11-22 18:16:31 +01:00
|
|
|
# Renode logging configuration
|
|
|
|
RENODE_SHOW_LOG ?= 0
|
|
|
|
ifneq (1,$(RENODE_SHOW_LOG))
|
|
|
|
RENODE_CONFIG_FLAGS += --hide-log
|
|
|
|
endif
|
|
|
|
RENODE_LOG_LEVEL ?= 2 # Warning level
|
|
|
|
RENODE_CONFIG_FLAGS += -e "logLevel $(RENODE_LOG_LEVEL)"
|
|
|
|
|
2021-05-27 13:32:08 +02:00
|
|
|
# Configure renode telnet port to allow sending command to the monitor while
|
|
|
|
# the emulator is running (used to send reset command)
|
|
|
|
RENODE_TELNET_PORT ?= 1234
|
|
|
|
RENODE_CONFIG_FLAGS += -P $(RENODE_TELNET_PORT)
|
|
|
|
|
2020-11-22 18:16:31 +01:00
|
|
|
# Renode GUI
|
|
|
|
RENODE_SHOW_GUI ?= 0
|
|
|
|
ifneq (1,$(RENODE_SHOW_GUI))
|
|
|
|
RENODE_CONFIG_FLAGS += --disable-xwt
|
|
|
|
endif
|
|
|
|
|
2020-11-22 18:14:56 +01:00
|
|
|
# Configure local serial port
|
2020-11-26 14:43:20 +01:00
|
|
|
RENODE_SYSBUS_UART ?= sysbus.uart0
|
2022-03-04 13:44:51 +01:00
|
|
|
EMULATOR_SERIAL_PORT ?= $(EMULATOR_TMP_DIR)/uart
|
2020-11-26 14:43:20 +01:00
|
|
|
RENODE_CONFIG_FLAGS += -e "emulation CreateUartPtyTerminal \"term\" \"$(EMULATOR_SERIAL_PORT)\" true"
|
|
|
|
RENODE_CONFIG_FLAGS += -e "connector Connect $(RENODE_SYSBUS_UART) 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
|
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)
|
2020-11-22 18:14:56 +01:00
|
|
|
|
2020-11-21 18:12:43 +01:00
|
|
|
# Configure the debugger
|
|
|
|
GDB_PORT ?= 3333
|
2022-02-19 00:03:13 +01:00
|
|
|
GDB_REMOTE ?= :$(GDB_PORT)
|
2020-11-21 18:12:43 +01:00
|
|
|
RENODE_DEBUG_FLAGS += $(RENODE_CONFIG_FLAGS)
|
|
|
|
RENODE_DEBUG_FLAGS += -e "machine StartGdbServer $(GDB_PORT) true"
|
|
|
|
|
|
|
|
DEBUGSERVER ?= $(EMULATOR)
|
|
|
|
DEBUGSERVER_FLAGS ?= $(RENODE_DEBUG_FLAGS)
|
|
|
|
|
2022-05-31 12:39:16 +02:00
|
|
|
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(DEBUG_ELFFILE) $(GDB_REMOTE) $(EMULATOR_TMP_DIR) "-ex \"monitor start\""
|
2020-11-21 22:50:18 +01:00
|
|
|
DEBUGGER ?= $(RIOTTOOLS)/emulator/debug.sh
|
2020-11-26 14:43:20 +01:00
|
|
|
|
2021-05-27 13:32:08 +02:00
|
|
|
RESET ?= bash
|
|
|
|
RESET_FLAGS ?= -c "{ sleep 0.2;echo machine RequestReset; } | telnet localhost $(RENODE_TELNET_PORT)" || true
|
|
|
|
|
2020-11-26 14:43:20 +01:00
|
|
|
# No flasher available with renode emulator
|
|
|
|
FLASHER ?=
|
|
|
|
FFLAGS ?=
|