2019-09-04 14:58:32 +02:00
|
|
|
INCLUDES += -I$(RIOTBOARD)/common/blxxxpill/include
|
2018-06-12 14:55:04 +02:00
|
|
|
|
2018-05-28 22:32:44 +02:00
|
|
|
# define the default port depending on the host OS
|
|
|
|
PORT_LINUX ?= /dev/ttyUSB0
|
|
|
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
|
|
|
|
|
|
|
# setup serial terminal
|
|
|
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
|
|
|
|
|
|
|
# optionally, use dfu-util to flash via usb
|
|
|
|
# note: needs a bootloader flashed before, config below is compatible
|
|
|
|
# with blackmagic_dfu, see https://github.com/blacksphere/blackmagic/
|
|
|
|
# To stop bootloader from loading an existing firmware, pull down
|
|
|
|
# (ground) GPIO B1.
|
|
|
|
ifeq ($(PROGRAMMER),dfu-util)
|
|
|
|
export ROM_OFFSET ?= 0x2000 # Skip the space needed by the embedded bootloader
|
2019-05-17 13:52:34 +02:00
|
|
|
FLASHER = dfu-util
|
2019-05-17 13:52:34 +02:00
|
|
|
DEBUGGER = # no debugger
|
2019-06-06 16:22:14 +02:00
|
|
|
RESET ?= # dfu-util has no support for resetting the device
|
2018-05-28 22:32:44 +02:00
|
|
|
|
2018-12-19 19:00:04 +01:00
|
|
|
FLASHFILE ?= $(BINFILE)
|
|
|
|
FFLAGS = -d 1eaf:0003 -a 2 -D $(FLASHFILE)
|
2018-08-15 14:45:03 +02:00
|
|
|
# for older bootloader versions use this:
|
2018-12-19 19:00:04 +01:00
|
|
|
# FFLAGS = -d 1d50:6017 -s 0x08002000:leave -D $(FLASHFILE)
|
2018-05-28 22:32:44 +02:00
|
|
|
else
|
|
|
|
|
2018-06-12 15:29:36 +02:00
|
|
|
# this board uses openocd by default
|
2019-05-31 11:43:47 +02:00
|
|
|
DEBUG_ADAPTER ?= stlink
|
|
|
|
STLINK_VERSION ?= 2
|
2018-05-28 22:32:44 +02:00
|
|
|
|
2018-08-10 14:41:35 +02:00
|
|
|
# call a 'reset halt' command before starting the debugger
|
|
|
|
# it is required as `connect_assert_srst` is set
|
|
|
|
export OPENOCD_DBG_START_CMD = -c 'reset halt'
|
|
|
|
|
2018-06-12 15:29:36 +02:00
|
|
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|
2018-05-28 22:32:44 +02:00
|
|
|
endif
|