2017-10-12 19:09:53 +02:00
|
|
|
## the cpu to build for
|
|
|
|
export CPU = stm32f1
|
|
|
|
export CPU_MODEL = stm32f103c8
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2017-11-01 17:09:10 +01:00
|
|
|
# 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)
|
2017-10-24 14:24:19 +02:00
|
|
|
export ROM_OFFSET ?= 0x2000 # Skip the space needed by the embedded bootloader
|
|
|
|
export BINFILE = $(patsubst %.elf,%.bin,$(ELFFILE))
|
|
|
|
export FLASHER = dfu-util
|
|
|
|
export DEBUGGER = # no debugger
|
|
|
|
export RESET = # dfu-util has no support for resetting the device
|
2017-11-01 17:09:10 +01:00
|
|
|
|
2017-10-24 14:24:19 +02:00
|
|
|
export OFLAGS = -O binary
|
|
|
|
export FFLAGS = -d 1d50:6017 -s 0x08002000:leave -D "$(HEXFILE)"
|
2017-11-01 17:09:10 +01:00
|
|
|
else
|
2017-10-24 14:24:19 +02:00
|
|
|
|
2017-11-01 17:09:10 +01:00
|
|
|
# this board uses openocd by default
|
2017-10-12 19:09:53 +02:00
|
|
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|
2017-11-01 17:09:10 +01:00
|
|
|
endif
|