2022-03-03 13:49:47 +01:00
|
|
|
# Select the most recently attached tty interface
|
|
|
|
ifeq (1,$(MOST_RECENT_PORT))
|
|
|
|
PORT ?= $(shell $(RIOTTOOLS)/usb-serial/ttys.py --most-recent --format path)
|
|
|
|
endif
|
|
|
|
# Otherwise, use as default the most commonly used ports on Linux and OSX
|
2020-11-20 10:59:18 +01:00
|
|
|
PORT_LINUX ?= /dev/ttyACM0
|
|
|
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
|
|
|
|
2015-04-22 15:41:37 +02:00
|
|
|
# set default port depending on operating system
|
|
|
|
ifeq ($(OS),Linux)
|
2020-11-20 10:59:18 +01:00
|
|
|
PORT ?= $(PORT_LINUX)
|
2015-04-22 15:41:37 +02:00
|
|
|
else ifeq ($(OS),Darwin)
|
2020-11-20 10:59:18 +01:00
|
|
|
PORT ?= $(PORT_DARWIN)
|
2015-04-22 15:41:37 +02:00
|
|
|
endif
|
|
|
|
|
2019-10-15 14:17:47 +02:00
|
|
|
# Default PROG_DEV is the same as PORT
|
|
|
|
PROG_DEV ?= $(PORT)
|
|
|
|
|
2015-04-22 15:41:37 +02:00
|
|
|
export BAUD ?= 115200
|
|
|
|
|
2017-10-23 15:19:30 +02:00
|
|
|
RIOT_TERMINAL ?= pyterm
|
|
|
|
ifeq ($(RIOT_TERMINAL),pyterm)
|
2019-02-25 16:46:44 +01:00
|
|
|
TERMPROG ?= $(RIOTTOOLS)/pyterm/pyterm
|
2019-08-27 12:07:00 +02:00
|
|
|
TERMFLAGS ?= -p "$(PORT)" -b "$(BAUD)" $(PYTERMFLAGS)
|
2019-02-20 08:30:33 +01:00
|
|
|
else ifeq ($(RIOT_TERMINAL),socat)
|
|
|
|
SOCAT_OUTPUT ?= -
|
2019-02-25 16:46:44 +01:00
|
|
|
TERMPROG ?= $(RIOT_TERMINAL)
|
|
|
|
TERMFLAGS ?= $(SOCAT_OUTPUT) open:$(PORT),b$(BAUD),echo=0,raw
|
2017-10-23 15:19:30 +02:00
|
|
|
else ifeq ($(RIOT_TERMINAL),picocom)
|
2019-02-25 16:46:44 +01:00
|
|
|
TERMPROG ?= picocom
|
2019-02-25 16:56:00 +01:00
|
|
|
TERMFLAGS ?= --nolock --imap lfcrlf --baud "$(BAUD)" "$(PORT)"
|
2019-11-19 15:06:46 +01:00
|
|
|
else ifeq ($(RIOT_TERMINAL),miniterm)
|
|
|
|
TERMPROG ?= miniterm.py
|
|
|
|
# The RIOT shell will still transmit back a CRLF, but at least with --eol LF
|
|
|
|
# we avoid sending two lines on every "enter".
|
2020-04-21 17:37:58 +02:00
|
|
|
TERMFLAGS ?= --eol LF "$(PORT)" "$(BAUD)" $(MINITERMFLAGS)
|
2019-11-16 14:23:13 +01:00
|
|
|
else ifeq ($(RIOT_TERMINAL),jlink)
|
|
|
|
TERMPROG = $(RIOTTOOLS)/jlink/jlink.sh
|
|
|
|
TERMFLAGS = term-rtt
|
2020-02-09 12:45:29 +01:00
|
|
|
else ifeq ($(RIOT_TERMINAL),semihosting)
|
|
|
|
TERMPROG = $(DEBUGGER)
|
|
|
|
TERMFLAGS = $(DEBUGGER_FLAGS)
|
|
|
|
OPENOCD_DBG_EXTRA_CMD += -c 'arm semihosting enable'
|
|
|
|
$(call target-export-variables,term cleanterm,OPENOCD_DBG_EXTRA_CMD)
|
2017-10-18 12:24:24 +02:00
|
|
|
endif
|