1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards: don't include programmer logic at board level

This commit is contained in:
Alexandre Abadie 2020-11-19 18:38:41 +01:00
parent ae4d505154
commit c6ad85a7b0
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
67 changed files with 110 additions and 190 deletions

View File

@ -12,5 +12,4 @@ ifeq ($(PROGRAMMER),pic32prog)
# * The triangle `▶` goes into the port number 1 (a hole with a square around it) # * The triangle `▶` goes into the port number 1 (a hole with a square around it)
# opposite side of the JP1 ICSP text. # opposite side of the JP1 ICSP text.
FLASHFILE ?= $(HEXFILE) FLASHFILE ?= $(HEXFILE)
include $(RIOTMAKE)/tools/pic32prog.inc.mk
endif endif

View File

@ -15,8 +15,6 @@ ifeq ($(PROGRAMMER),adafruit-nrfutil)
TERM_DELAY = 2 TERM_DELAY = 2
TERMDEPS += term-delay TERMDEPS += term-delay
endif endif
include $(RIOTMAKE)/tools/adafruit-nrfutil.inc.mk
endif endif
term-delay: term-delay:

View File

@ -11,8 +11,6 @@ ifeq ($(PROGRAMMER),bossa)
BOSSA_VERSION = nrf52 BOSSA_VERSION = nrf52
BOSSA_ARDUINO_PREFLASH = yes BOSSA_ARDUINO_PREFLASH = yes
PREFLASH_DELAY = 1 PREFLASH_DELAY = 1
include $(RIOTMAKE)/tools/bossa.inc.mk
endif endif
TESTRUNNER_CONNECT_DELAY ?= 2 TESTRUNNER_CONNECT_DELAY ?= 2

View File

@ -7,7 +7,7 @@ ATMEGA1284P_CLOCK ?=
# Allow overwriting programmer via env variables without affecting other boards # Allow overwriting programmer via env variables without affecting other boards
PROGRAMMER_BOARD_ATMEGA1284P ?= atmelice PROGRAMMER_BOARD_ATMEGA1284P ?= atmelice
# ICSP programmer to use for avrdude # ICSP programmer to use for avrdude
PROGRAMMER ?= $(PROGRAMMER_BOARD_ATMEGA1284P) AVRDUDE_PROGRAMMER ?= $(PROGRAMMER_BOARD_ATMEGA1284P)
ifneq (,$(ATMEGA1284P_CLOCK)) ifneq (,$(ATMEGA1284P_CLOCK))
CFLAGS += -DCLOCK_CORECLOCK=$(ATMEGA1284P_CLOCK) CFLAGS += -DCLOCK_CORECLOCK=$(ATMEGA1284P_CLOCK)

View File

@ -3,6 +3,6 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 115200 BAUD ?= 115200
# Use EDBG (xplainedpro) programmer with avrdude # Use EDBG (xplainedpro) programmer with avrdude
PROGRAMMER ?= xplainedpro AVRDUDE_PROGRAMMER ?= xplainedpro
include $(RIOTBOARD)/common/atmega/Makefile.include include $(RIOTBOARD)/common/atmega/Makefile.include

View File

@ -7,7 +7,7 @@ ATMEGA328P_CLOCK ?=
# Allow overwriting programmer via env variables without affecting other boards # Allow overwriting programmer via env variables without affecting other boards
PROGRAMMER_BOARD_ATMEGA328P ?= usbtiny PROGRAMMER_BOARD_ATMEGA328P ?= usbtiny
# ICSP programmer to use for avrdude # ICSP programmer to use for avrdude
PROGRAMMER ?= $(PROGRAMMER_BOARD_ATMEGA328P) AVRDUDE_PROGRAMMER ?= $(PROGRAMMER_BOARD_ATMEGA328P)
ifneq (,$(ATMEGA328P_CLOCK)) ifneq (,$(ATMEGA328P_CLOCK))
CFLAGS += -DCLOCK_CORECLOCK=$(ATMEGA328P_CLOCK) CFLAGS += -DCLOCK_CORECLOCK=$(ATMEGA328P_CLOCK)

View File

@ -9,11 +9,9 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board has an on-board ST-link adapter # this board has an on-board ST-link adapter
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# this board can become un-flashable after a hardfault, # this board can become un-flashable after a hardfault,
# use connect_assert_srst to always be able to flash or reset the board. # use connect_assert_srst to always be able to flash or reset the board.
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -9,11 +9,9 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board has an on-board ST-link adapter # this board has an on-board ST-link adapter
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# The board can become un-flashable after some execution, # The board can become un-flashable after some execution,
# use connect_assert_srst to always be able to flash or reset the board. # use connect_assert_srst to always be able to flash or reset the board.
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -11,7 +11,6 @@ else ifeq (pyocd,$(PROGRAMMER))
# PyOCD doesn't recognize automatically the board ID, so target type has to # PyOCD doesn't recognize automatically the board ID, so target type has to
# be passed explicitly # be passed explicitly
FLASH_TARGET_TYPE ?= -t nrf51 FLASH_TARGET_TYPE ?= -t nrf51
include $(RIOTMAKE)/tools/pyocd.inc.mk
endif endif
# include nrf51 boards common configuration # include nrf51 boards common configuration

View File

@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# configure the flash tool # configure the flash tool
include $(RIOTMAKE)/tools/uniflash.inc.mk PROGRAMMER ?= uniflash

View File

@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# configure the flash tool # configure the flash tool
include $(RIOTMAKE)/tools/uniflash.inc.mk PROGRAMMER ?= uniflash

View File

@ -9,6 +9,6 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# setup flasher (using BOSSA) # setup flasher (using BOSSA)
PROGRAMMER ?= bossa
BOSSA_VERSION = 1.8 BOSSA_VERSION = 1.8
BOSSA_ARDUINO_PREFLASH = yes BOSSA_ARDUINO_PREFLASH = yes
include $(RIOTMAKE)/tools/bossa.inc.mk

View File

@ -8,7 +8,6 @@ include $(RIOTMAKE)/tools/serial.inc.mk
ifeq ($(PROGRAMMER),jlink) ifeq ($(PROGRAMMER),jlink)
# in case J-Link is attached to SWD pins, use a plain CPU memory model # in case J-Link is attached to SWD pins, use a plain CPU memory model
JLINK_DEVICE = $(MKR_JLINK_DEVICE) JLINK_DEVICE = $(MKR_JLINK_DEVICE)
include $(RIOTMAKE)/tools/jlink.inc.mk
endif endif
# Include all definitions for flashing with bossa over USB # Include all definitions for flashing with bossa over USB

View File

@ -1,15 +1,18 @@
INCLUDES += -I$(RIOTBOARD)/common/atmega/include INCLUDES += -I$(RIOTBOARD)/common/atmega/include
# If programmer is not set, set it based on the bootloader used # Use avrdude programmer
ifeq (,$(PROGRAMMER)) PROGRAMMER ?= avrdude
# If avrdude specific programmer is not set, set it based on the bootloader used
ifeq (,$(AVRDUDE_PROGRAMMER))
ifeq (atmegaboot,$(BOOTLOADER)) ifeq (atmegaboot,$(BOOTLOADER))
PROGRAMMER = arduino AVRDUDE_PROGRAMMER = arduino
BOOTLOADER_SIZE ?= 2048 BOOTLOADER_SIZE ?= 2048
BOOTLOADER_BAUD ?= 57600 BOOTLOADER_BAUD ?= 57600
endif endif
ifeq (optiboot,$(BOOTLOADER)) ifeq (optiboot,$(BOOTLOADER))
PROGRAMMER = arduino AVRDUDE_PROGRAMMER = arduino
ifneq (,$(filter $(CPU), atmega128rfa1 atmega256rfr2 atmega1281 atmega1284p atmega2560)) ifneq (,$(filter $(CPU), atmega128rfa1 atmega256rfr2 atmega1281 atmega1284p atmega2560))
# The minimum bootloader size on these CPUs is 1 KiB (so 512 Byte are wasted) # The minimum bootloader size on these CPUs is 1 KiB (so 512 Byte are wasted)
BOOTLOADER_SIZE ?= 1024 BOOTLOADER_SIZE ?= 1024
@ -19,12 +22,12 @@ ifeq (,$(PROGRAMMER))
endif endif
ifeq (stk500v1,$(BOOTLOADER)) ifeq (stk500v1,$(BOOTLOADER))
PROGRAMMER = stk500v1 AVRDUDE_PROGRAMMER = stk500v1
BOOTLOADER_SIZE ?= 8K BOOTLOADER_SIZE ?= 8K
endif endif
ifeq (stk500v2,$(BOOTLOADER)) ifeq (stk500v2,$(BOOTLOADER))
PROGRAMMER = stk500v2 AVRDUDE_PROGRAMMER = stk500v2
BOOTLOADER_SIZE ?= 8K BOOTLOADER_SIZE ?= 8K
# Disable auto erase; erasing the flash is done implicitly by the bootloader # Disable auto erase; erasing the flash is done implicitly by the bootloader
# and explicit erase is not supported # and explicit erase is not supported
@ -32,12 +35,12 @@ ifeq (,$(PROGRAMMER))
endif endif
ifeq (avr109,$(BOOTLOADER)) ifeq (avr109,$(BOOTLOADER))
PROGRAMMER = avr109 AVRDUDE_PROGRAMMER = avr109
BOOTLOADER_SIZE ?= 4K BOOTLOADER_SIZE ?= 4K
endif endif
ifeq (derfmega,$(BOOTLOADER)) ifeq (derfmega,$(BOOTLOADER))
PROGRAMMER = wiring AVRDUDE_PROGRAMMER = wiring
BOOTLOADER_SIZE ?= 4K BOOTLOADER_SIZE ?= 4K
endif endif
@ -50,5 +53,3 @@ BOOTLOADER_SIZE ?= 0
ROM_RESERVED ?= $(BOOTLOADER_SIZE) ROM_RESERVED ?= $(BOOTLOADER_SIZE)
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# include avrdude flashing tool
include $(RIOTMAKE)/tools/avrdude.inc.mk

View File

@ -12,14 +12,12 @@ endif
ifeq ($(PROGRAMMER),cc2538-bsl) ifeq ($(PROGRAMMER),cc2538-bsl)
PROG_BAUD ?= 460800 PROG_BAUD ?= 460800
include $(RIOTMAKE)/tools/cc2538-bsl.inc.mk
else ifeq ($(PROGRAMMER),jlink) else ifeq ($(PROGRAMMER),jlink)
# Special flashing and reset scripts are required due to board hardware # Special flashing and reset scripts are required due to board hardware
FLASH_ADDR = 0x200000 FLASH_ADDR = 0x200000
JLINK_DEVICE = CC2538SF53 JLINK_DEVICE = CC2538SF53
JLINK_IF = JTAG JLINK_IF = JTAG
JLINK_RESET_FILE = $(RIOTBOARD)/common/cc2538/dist/hw_reset.seg JLINK_RESET_FILE = $(RIOTBOARD)/common/cc2538/dist/hw_reset.seg
include $(RIOTMAKE)/tools/jlink.inc.mk
endif endif
OFLAGS = --gap-fill 0xff OFLAGS = --gap-fill 0xff

View File

@ -3,9 +3,3 @@ PROGRAMMER ?= uniflash
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/cc26x2_cc13x2/dist/openocd.cfg OPENOCD_CONFIG ?= $(RIOTBOARD)/common/cc26x2_cc13x2/dist/openocd.cfg
UNIFLASH_CONFIG ?= $(RIOTBOARD)/common/cc26x2_cc13x2/dist UNIFLASH_CONFIG ?= $(RIOTBOARD)/common/cc26x2_cc13x2/dist
ifeq ($(PROGRAMMER),uniflash)
include $(RIOTMAKE)/tools/uniflash.inc.mk
else ifeq ($(PROGRAMMER),openocd)
include $(RIOTMAKE)/tools/openocd.inc.mk
endif

View File

@ -2,6 +2,9 @@
PORT_LINUX ?= /dev/ttyACM0 PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# Use OpenOCD by default
PROGRAMMER ?= openocd
# Use the shared OpenOCD configuration # Use the shared OpenOCD configuration
# Using dap or jlink depends on which firmware the OpenSDA debugger is running # Using dap or jlink depends on which firmware the OpenSDA debugger is running
DEBUG_ADAPTER ?= dap DEBUG_ADAPTER ?= dap
@ -22,12 +25,9 @@ OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(OPENOCD_KINETIS_FAMILY
# Check the flash configuration field before flashing # Check the flash configuration field before flashing
PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk
# The board can become un-flashable after some execution, # The board can become un-flashable after some execution,
# use connect_assert_srst to always be able to flash or reset the board. # use connect_assert_srst to always be able to flash or reset the board.
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd # setup serial terminal
include $(RIOTMAKE)/tools/openocd.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk

View File

@ -6,6 +6,9 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*B)))
BAUD ?= 500000 BAUD ?= 500000
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# Use openocd by default
PROGRAMMER ?= openocd
# Using connect_assert_srst removes errors on flash from invalid state # Using connect_assert_srst removes errors on flash from invalid state
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
@ -13,9 +16,6 @@ DEBUG_ADAPTER ?= iotlab
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/iotlab/dist/openocd.cfg OPENOCD_CONFIG ?= $(RIOTBOARD)/common/iotlab/dist/openocd.cfg
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
# add the common header files to the include path # add the common header files to the include path
INCLUDES += -I$(RIOTBOARD)/common/stm32/include INCLUDES += -I$(RIOTBOARD)/common/stm32/include
INCLUDES += -I$(RIOTBOARD)/common/iotlab/include INCLUDES += -I$(RIOTBOARD)/common/iotlab/include

View File

@ -9,12 +9,13 @@ ifneq (,$(filter nimble,$(USEPKG)))
CFLAGS += -DBOARD_NRF51_XTIMER_ALT CFLAGS += -DBOARD_NRF51_XTIMER_ALT
endif endif
# Use openocd by default
PROGRAMMER ?= openocd
ifeq ($(PROGRAMMER),openocd) ifeq ($(PROGRAMMER),openocd)
# use common openocd configuration for nrf51 # use common openocd configuration for nrf51
OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf51/dist/openocd.cfg OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf51/dist/openocd.cfg
include $(RIOTMAKE)/tools/openocd.inc.mk
else ifeq ($(PROGRAMMER),jlink) else ifeq ($(PROGRAMMER),jlink)
# setup JLink for flashing # setup JLink for flashing
JLINK_DEVICE = nrf51822 JLINK_DEVICE = nrf51822
include $(RIOTMAKE)/tools/jlink.inc.mk
endif endif

View File

@ -19,7 +19,6 @@ PROGRAMMER ?= jlink
ifeq (jlink,$(PROGRAMMER)) ifeq (jlink,$(PROGRAMMER))
# setup JLink for flashing # setup JLink for flashing
JLINK_DEVICE = nrf52 JLINK_DEVICE = nrf52
include $(RIOTMAKE)/tools/jlink.inc.mk
else ifeq (openocd,$(PROGRAMMER)) else ifeq (openocd,$(PROGRAMMER))
ifneq (,$(filter $(BOARD),ruuvitag thingy52)) ifneq (,$(filter $(BOARD),ruuvitag thingy52))
# openocd doesn't fully work with ruuvitag and thingy52 # openocd doesn't fully work with ruuvitag and thingy52
@ -30,7 +29,4 @@ else ifeq (openocd,$(PROGRAMMER))
# build from source (master > 2018, August the 13rd) is required. # build from source (master > 2018, August the 13rd) is required.
DEBUG_ADAPTER ?= jlink DEBUG_ADAPTER ?= jlink
OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg
include $(RIOTMAKE)/tools/openocd.inc.mk
else ifeq (bmp,$(PROGRAMMER))
include $(RIOTMAKE)/tools/bmp.inc.mk
endif endif

View File

@ -17,7 +17,6 @@ ifeq (1,$(PARTICLE_MONOFIRMWARE))
# Setting DFU_ARGS won't work as the implied --reset causes errors. # Setting DFU_ARGS won't work as the implied --reset causes errors.
FFLAGS = -d 0x2B04:0xD00E -a 0 -s 0x30000:leave -D $(FLASHFILE) FFLAGS = -d 0x2B04:0xD00E -a 0 -s 0x30000:leave -D $(FLASHFILE)
PROGRAMMER = dfu-util PROGRAMMER = dfu-util
include $(RIOTMAKE)/tools/dfu.inc.mk
# If CDC-ACM is *not* enabled, any pre-flash resets will just not work -- but # If CDC-ACM is *not* enabled, any pre-flash resets will just not work -- but
# then again nothing can be done in that case anyway, and the preflash # then again nothing can be done in that case anyway, and the preflash
# routines fall through without erring. # routines fall through without erring.
@ -32,7 +31,6 @@ else
# The board is not recognized automatically by pyocd, so the CPU target # The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly # option is passed explicitly
FLASH_TARGET_TYPE ?= -t nrf52840 FLASH_TARGET_TYPE ?= -t nrf52840
include $(RIOTMAKE)/tools/pyocd.inc.mk
else ifeq (openocd,$(PROGRAMMER)) else ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER ?= dap DEBUG_ADAPTER ?= dap
endif endif

View File

@ -8,6 +8,4 @@ ifeq ($(PROGRAMMER),bossa)
# such bootloader. # such bootloader.
ROM_OFFSET ?= 0x2000 ROM_OFFSET ?= 0x2000
BOSSA_ARDUINO_PREFLASH = yes BOSSA_ARDUINO_PREFLASH = yes
include $(RIOTMAKE)/tools/bossa.inc.mk
endif endif

View File

@ -5,9 +5,3 @@ PROGRAMMER ?= jlink
JLINK_DEVICE ?= ${CPU_MODEL} JLINK_DEVICE ?= ${CPU_MODEL}
OPENOCD_CONFIG ?= board/efm32.cfg OPENOCD_CONFIG ?= board/efm32.cfg
ifeq ($(PROGRAMMER),jlink)
include $(RIOTMAKE)/tools/jlink.inc.mk
else ifeq ($(PROGRAMMER),openocd)
include $(RIOTMAKE)/tools/openocd.inc.mk
endif

View File

@ -6,4 +6,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd # this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk PROGRAMMER ?= openocd

View File

@ -8,7 +8,6 @@ include $(RIOTMAKE)/tools/serial.inc.mk
ifeq ($(PROGRAMMER),jlink) ifeq ($(PROGRAMMER),jlink)
# in case J-Link is attached to SWD pins, use a plain CPU memory model # in case J-Link is attached to SWD pins, use a plain CPU memory model
JLINK_DEVICE = atsamd21 JLINK_DEVICE = atsamd21
include $(RIOTMAKE)/tools/jlink.inc.mk
endif endif
# Include all definitions for flashing with bossa over USB # Include all definitions for flashing with bossa over USB

View File

@ -9,4 +9,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd # this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk PROGRAMMER ?= openocd

View File

@ -1,4 +1,5 @@
# debugger config # debugger config
PROGRAMMER ?= jlink
JLINK_DEVICE = atsamr21e18a JLINK_DEVICE = atsamr21e18a
OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb
OFLAGS := --gap-fill 0xff OFLAGS := --gap-fill 0xff
@ -6,5 +7,3 @@ OFLAGS := --gap-fill 0xff
# use JLink Segger RTT by default # use JLink Segger RTT by default
RIOT_TERMINAL ?= jlink RIOT_TERMINAL ?= jlink
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
include $(RIOTMAKE)/tools/jlink.inc.mk

View File

@ -6,8 +6,8 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with a custom reset command # this board uses openocd with a custom reset command
PROGRAMMER ?= openocd
OPENOCD_CMD_RESET_RUN =-c _reset OPENOCD_CMD_RESET_RUN =-c _reset
include $(RIOTMAKE)/tools/openocd.inc.mk
# use our own openocd script to flash since HiFive1 has reset problems. # use our own openocd script to flash since HiFive1 has reset problems.
FLASHER = $(RIOTBASE)/boards/hifive1/dist/flasher.sh FLASHER = $(RIOTBASE)/boards/hifive1/dist/flasher.sh

View File

@ -12,13 +12,11 @@ ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER = jlink DEBUG_ADAPTER = jlink
OPENOCD_TRANSPORT = jtag OPENOCD_TRANSPORT = jtag
OPENOCD_PRE_FLASH_CMDS += "-c flash protect 0 1 last off" OPENOCD_PRE_FLASH_CMDS += "-c flash protect 0 1 last off"
include $(RIOTMAKE)/tools/openocd.inc.mk
else ifeq (jlink,$(PROGRAMMER)) else ifeq (jlink,$(PROGRAMMER))
# setup JLink for flashing # setup JLink for flashing
JLINK_DEVICE = FE310 JLINK_DEVICE = FE310
JLINK_IF = JTAG JLINK_IF = JTAG
FLASH_ADDR = 0x20010000 FLASH_ADDR = 0x20010000
include $(RIOTMAKE)/tools/jlink.inc.mk
else else
$(error Programmer '$(PROGRAMMER)' not supported for board '$(BOARD)') $(error Programmer '$(PROGRAMMER)' not supported for board '$(BOARD)')
endif endif

View File

@ -16,4 +16,4 @@ DEBUG_ADAPTER ?= stlink
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd # this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk PROGRAMMER ?= openocd

View File

@ -3,9 +3,9 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# setup JLink for flashing # setup JLink for flashing
PROGRAMMER ?= jlink
JLINK_DEVICE = EFR32MG1PxxxF256 JLINK_DEVICE = EFR32MG1PxxxF256
JLINK_PRE_FLASH = r JLINK_PRE_FLASH = r
include $(RIOTMAKE)/tools/jlink.inc.mk
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk

View File

@ -8,10 +8,9 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
DEBUG_ADAPTER ?= stlink
CFLAGS+=-DSX127X_TX_SWITCH CFLAGS+=-DSX127X_TX_SWITCH
CFLAGS+=-DSX127X_RX_SWITCH CFLAGS+=-DSX127X_RX_SWITCH
# this board uses openocd # this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink

View File

@ -8,8 +8,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with st-link
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
STLINK_VERSION ?= 2 STLINK_VERSION ?= 2
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,12 +8,10 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# By default, flash this board using an ST-link adapter # this board uses openocd
DEBUG_ADAPTER ?= stlink PROGRAMMER ?= openocd
# this board can become un-flashable after a hardfault, # this board can become un-flashable after a hardfault,
# use connect_assert_srst to always be able to flash or reset the boards. # use connect_assert_srst to always be able to flash or reset the boards.
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# By default, flash this board using an ST-link adapter
# this board uses openocd DEBUG_ADAPTER ?= stlink
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,7 +8,6 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with st-link
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -1,9 +1,6 @@
# FLASHER will be lpc2k_pgm still # FLASHER will be lpc2k_pgm still
DEBUG_ADAPTER ?= dap DEBUG_ADAPTER ?= dap
PROGRAMMER ?= openocd
JLINK_DEVICE := LPC2388 JLINK_DEVICE := LPC2388
OPENOCD_TRANSPORT := jtag OPENOCD_TRANSPORT := jtag
include $(RIOTBOARD)/common/msba2/Makefile.include include $(RIOTBOARD)/common/msba2/Makefile.include
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,8 +8,8 @@ ifneq (,$(AVRDUDE_PORT))
PROG_DEV ?= $(AVRDUDE_PORT) PROG_DEV ?= $(AVRDUDE_PORT)
endif endif
# PROGRAMMER defaults to the external flasher Bus Pirate ISP using avrdude. # Avrdude programmer defaults to the external flasher Bus Pirate ISP.
PROGRAMMER ?= buspirate AVRDUDE_PROGRAMMER ?= buspirate
# set serial port for avrdude with buspirate # set serial port for avrdude with buspirate
ifeq ($(OS),Linux) ifeq ($(OS),Linux)
PROG_DEV ?= /dev/ttyUSB0 PROG_DEV ?= /dev/ttyUSB0

View File

@ -7,8 +7,6 @@ PROGRAMMER ?= openocd
ifeq (openocd,$(PROGRAMMER)) ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER = dap DEBUG_ADAPTER = dap
else ifeq (pyocd,$(PROGRAMMER))
include $(RIOTMAKE)/tools/pyocd.inc.mk
endif endif
# QEMU 4.0 added microbit system emulation. # QEMU 4.0 added microbit system emulation.

View File

@ -3,9 +3,9 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 115200 BAUD ?= 115200
# PROGRAMMER defaults to UM232H which is a FT232H breakout board # Avrdude programmer defaults to UM232H which is a FT232H breakout board
# externally connected using wires # externally connected using wires
PROGRAMMER_MICRODUINO_CORERF ?= UM232H PROGRAMMER_MICRODUINO_CORERF ?= UM232H
PROGRAMMER ?= $(PROGRAMMER_MICRODUINO_CORERF) AVRDUDE_PROGRAMMER ?= $(PROGRAMMER_MICRODUINO_CORERF)
include $(RIOTBOARD)/common/atmega/Makefile.include include $(RIOTBOARD)/common/atmega/Makefile.include

View File

@ -1,2 +1 @@
include $(RIOTBOARD)/common/msba2/Makefile.include include $(RIOTBOARD)/common/msba2/Makefile.include
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -3,19 +3,12 @@ ifdef MULLE_SERIAL
CFLAGS += -DMULLE_SERIAL=$(MULLE_SERIAL) CFLAGS += -DMULLE_SERIAL=$(MULLE_SERIAL)
endif endif
# this board uses openocd
PROGRAMMER ?= openocd
# Default debug adapter choice is to use the Mulle programmer board # Default debug adapter choice is to use the Mulle programmer board
DEBUG_ADAPTER ?= mulle DEBUG_ADAPTER ?= mulle
# Fall back to PROGRAMMER_SERIAL for backwards compatibility
DEBUG_ADAPTER_ID ?= $(PROGRAMMER_SERIAL)
# Define the default port depending on the host OS
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk
# We need special handling of the watchdog if we want to speed up the flash # We need special handling of the watchdog if we want to speed up the flash
# verification by using the MCU to compute the image checksum after flashing. # verification by using the MCU to compute the image checksum after flashing.
# wdog-disable.bin is a precompiled binary which will disable the watchdog and # wdog-disable.bin is a precompiled binary which will disable the watchdog and
@ -25,5 +18,12 @@ OPENOCD_PRE_VERIFY_CMDS += \
-c 'resume 0x20000000' -c 'resume 0x20000000'
PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
# this board uses openocd # Fall back to PROGRAMMER_SERIAL for backwards compatibility
include $(RIOTMAKE)/tools/openocd.inc.mk DEBUG_ADAPTER_ID ?= $(PROGRAMMER_SERIAL)
# Define the default port depending on the host OS
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk

View File

@ -8,8 +8,6 @@ PROGRAMMER ?= openocd
# dap debug adapter is required for openocd # dap debug adapter is required for openocd
ifeq (openocd,$(PROGRAMMER)) ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER = dap DEBUG_ADAPTER = dap
else ifeq (pyocd, $(PROGRAMMER)) # this boards is also supported by PyOCD
include $(RIOTMAKE)/tools/pyocd.inc.mk
endif endif
# include nrf51 boards common configuration # include nrf51 boards common configuration

View File

@ -7,7 +7,6 @@ ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target # The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly # option is passed explicitly
FLASH_TARGET_TYPE ?= -t $(CPU) FLASH_TARGET_TYPE ?= -t $(CPU)
include $(RIOTMAKE)/tools/pyocd.inc.mk
else ifeq (openocd,$(PROGRAMMER)) else ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER = dap DEBUG_ADAPTER = dap
endif endif

View File

@ -7,7 +7,6 @@ ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target # The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly # option is passed explicitly
FLASH_TARGET_TYPE ?= -t nrf52840 FLASH_TARGET_TYPE ?= -t nrf52840
include $(RIOTMAKE)/tools/pyocd.inc.mk
else ifeq (openocd,$(PROGRAMMER)) else ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER = dap DEBUG_ADAPTER = dap
endif endif

View File

@ -6,8 +6,8 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# this board is flashed using DFU # this board is flashed using DFU
PROGRAMMER ?= dfu-util
DFU_USB_ID = 0483:df11 DFU_USB_ID = 0483:df11
include $(RIOTMAKE)/tools/dfu.inc.mk
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk

View File

@ -8,7 +8,6 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with st-link
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -18,6 +18,9 @@ endif
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd
PROGRAMMER ?= openocd
# We need special handling of the watchdog if we want to speed up the flash # We need special handling of the watchdog if we want to speed up the flash
# verification by using the MCU to compute the image checksum after flashing. # verification by using the MCU to compute the image checksum after flashing.
# wdog-disable.bin is a precompiled binary which will disable the watchdog and # wdog-disable.bin is a precompiled binary which will disable the watchdog and
@ -32,6 +35,3 @@ DEBUG_ADAPTER ?= dap
# The board can become un-flashable after some firmware, use connect_assert_srst # The board can become un-flashable after some firmware, use connect_assert_srst
# to always be able to flash or reset the board. # to always be able to flash or reset the board.
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -15,10 +15,8 @@ ifeq ($(PROGRAMMER),pic32prog)
# * The triangle `▶` goes into the port number 1 (a hole with a square around it) # * The triangle `▶` goes into the port number 1 (a hole with a square around it)
# opposite side of the JP1 ICSP text. # opposite side of the JP1 ICSP text.
FLASHFILE ?= $(HEXFILE) FLASHFILE ?= $(HEXFILE)
include $(RIOTMAKE)/tools/pic32prog.inc.mk
else ifeq ($(PROGRAMMER),jlink) else ifeq ($(PROGRAMMER),jlink)
FLASHFILE ?= $(HEXFILE) FLASHFILE ?= $(HEXFILE)
JLINK_DEVICE = PIC32MZ2048EFG100 JLINK_DEVICE = PIC32MZ2048EFG100
JLINK_IF = JTAG JLINK_IF = JTAG
include $(RIOTMAKE)/tools/jlink.inc.mk
endif endif

View File

@ -5,7 +5,6 @@ include $(RIOTMAKE)/tools/serial.inc.mk
# define pyocd as programmer to program with stlink # define pyocd as programmer to program with stlink
ifeq (pyocd,$(PROGRAMMER)) ifeq (pyocd,$(PROGRAMMER))
FLASH_TARGET_TYPE ?= -t $(CPU) FLASH_TARGET_TYPE ?= -t $(CPU)
include $(RIOTMAKE)/tools/pyocd.inc.mk
endif endif
# use shared Makefile.include # use shared Makefile.include

View File

@ -9,6 +9,6 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board is flashed using DFU # this board is flashed using DFU
PROGRAMMER ?= dfu-util
DFU_USB_ID = 1d50:607f DFU_USB_ID = 1d50:607f
FFLAGS_OPTS = --reset FFLAGS_OPTS = --reset
include $(RIOTMAKE)/tools/dfu.inc.mk

View File

@ -5,6 +5,10 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with an HEXFILE
PROGRAMMER ?= openocd
FLASHFILE ?= $(HEXFILE)
DEBUG_ADAPTER ?= dap DEBUG_ADAPTER ?= dap
# generate image checksum from hex file # generate image checksum from hex file
@ -12,7 +16,3 @@ PRE_FLASH_CHECK_SCRIPT = lpc_checksum --format hex
# remap flash to address 0x0, otherwise it verifies the rom bootloader # remap flash to address 0x0, otherwise it verifies the rom bootloader
OPENOCD_PRE_VERIFY_CMDS += '-c reset init' OPENOCD_PRE_VERIFY_CMDS += '-c reset init'
# this board uses openocd with an HEXFILE
FLASHFILE ?= $(HEXFILE)
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -4,17 +4,17 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# by default, we use BOSSA to flash this board to take into account the
# pre-flashed Arduino bootloader
PROGRAMMER ?= bossa
# setup the flash tool used # setup the flash tool used
ifeq ($(PROGRAMMER),jlink) ifeq ($(PROGRAMMER),jlink)
# in case J-Link is attached to SWD pins, use a plain CPU memory model # in case J-Link is attached to SWD pins, use a plain CPU memory model
JLINK_DEVICE = atsamd21 JLINK_DEVICE = atsamd21
include $(RIOTMAKE)/tools/jlink.inc.mk else ifeq ($(PROGRAMMER),bossa)
else # ROM_OFFSET skips the space taken by the pre-flashed Arduino bootloader.
# by default, we use BOSSA to flash this board to take into account the
# pre-flashed Arduino bootloader. ROM_OFFSET skips the space taken by
# such bootloader.
ROM_OFFSET ?= 0x2000 ROM_OFFSET ?= 0x2000
include $(RIOTMAKE)/tools/bossa.inc.mk
endif endif
# setup the boards dependencies # setup the boards dependencies

View File

@ -11,8 +11,5 @@ include $(RIOTMAKE)/tools/serial.inc.mk
ROM_OFFSET ?= 0x5000 ROM_OFFSET ?= 0x5000
# this board is flashed using DFU # this board is flashed using DFU
PROGRAMMER ?= dfu-util
DFU_USB_ID = 1d50:607f DFU_USB_ID = 1d50:607f
include $(RIOTMAKE)/tools/dfu.inc.mk
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,8 +8,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
STLINK_VERSION ?= 2 STLINK_VERSION ?= 2
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,12 +8,11 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
STLINK_VERSION ?= 2 STLINK_VERSION ?= 2
# The board can become un-flashable after some execution, # The board can become un-flashable after some execution,
# use connect_assert_srst to always be able to flash or reset the board. # use connect_assert_srst to always be able to flash or reset the board.
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,8 +8,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd
PROGRAMMER ?= openocd
# this board has an on-board ST-link adapter # this board has an on-board ST-link adapter
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,8 +8,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with st-link
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
STLINK_VERSION ?= 2 STLINK_VERSION ?= 2
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,8 +8,8 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd
PROGRAMMER ?= openocd
# this board has an on-board ST-link adapter # this board has an on-board ST-link adapter
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,8 +8,8 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with st-link
PROGRAMMER ?= openocd
# this board has an on-board ST-link adapter # this board has an on-board ST-link adapter
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,7 +8,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
DEBUG_ADAPTER ?= stlink # this board uses openocd with st-link
PROGRAMMER ?= openocd
# this board uses openocd DEBUG_ADAPTER ?= stlink
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,7 +8,6 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with st-link
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -8,8 +8,8 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# setup serial terminal # setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# this board uses openocd with st-link
PROGRAMMER ?= openocd
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
STLINK_VERSION ?= 2-1 STLINK_VERSION ?= 2-1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -6,8 +6,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
STLINK_VERSION ?= 2 STLINK_VERSION ?= 2
# use openocd to program this board
PROGRAMMER = openocd
# import nrf51 boards common configuration # import nrf51 boards common configuration
include $(RIOTBOARD)/common/nrf51/Makefile.include include $(RIOTBOARD)/common/nrf51/Makefile.include

View File

@ -43,14 +43,8 @@ ifeq ($(PROGRAMMER),)
endif endif
ifeq ($(PROGRAMMER),edbg) ifeq ($(PROGRAMMER),edbg)
# use edbg for flashing # use edbg for flashing. must be included before openocd
include $(RIOTMAKE)/tools/edbg.inc.mk include $(RIOTMAKE)/tools/edbg.inc.mk
# use openocd for debugging # use openocd for debugging
include $(RIOTMAKE)/tools/openocd.inc.mk include $(RIOTMAKE)/tools/openocd.inc.mk
else ifeq ($(PROGRAMMER),jlink)
# this board uses J-Link for debug and possibly flashing
include $(RIOTMAKE)/tools/jlink.inc.mk
else ifeq ($(PROGRAMMER),openocd)
# this board uses openocd for debug and possibly flashing
include $(RIOTMAKE)/tools/openocd.inc.mk
endif endif

View File

@ -28,18 +28,10 @@ ifeq (openocd,$(PROGRAMMER))
# For STM32 boards the ST-link adapter is the default adapter, e.g. all # For STM32 boards the ST-link adapter is the default adapter, e.g. all
# Nucleo boards have an on-board ST-link adapter # Nucleo boards have an on-board ST-link adapter
DEBUG_ADAPTER ?= stlink DEBUG_ADAPTER ?= stlink
# RIOT uses openocd by default
include $(RIOTMAKE)/tools/openocd.inc.mk
endif
ifeq (bmp,$(PROGRAMMER))
include $(RIOTMAKE)/tools/bmp.inc.mk
endif endif
ifeq (jlink,$(PROGRAMMER)) ifeq (jlink,$(PROGRAMMER))
JLINK_DEVICE ?= $(CPU_MODEL) JLINK_DEVICE ?= $(CPU_MODEL)
include $(RIOTMAKE)/tools/jlink.inc.mk
endif endif
ifeq (dfu-util,$(PROGRAMMER)) ifeq (dfu-util,$(PROGRAMMER))
@ -51,7 +43,6 @@ ifeq (dfu-util,$(PROGRAMMER))
ifeq (,$(DFU_USB_ID)) ifeq (,$(DFU_USB_ID))
$(error DFU_USB_ID is not set) $(error DFU_USB_ID is not set)
endif endif
include $(RIOTMAKE)/tools/dfu.inc.mk
endif endif
ifeq (stm32flash,$(PROGRAMMER)) ifeq (stm32flash,$(PROGRAMMER))

View File

@ -19,22 +19,22 @@ DEBUGSERVER_FLAGS = "$(AVR_DEBUGDEVICE) $(DEBUGPROTO) :$(DEBUGSERVER_PORT)"
DEBUGGER_FLAGS = "-x $(AVARICE_PATH)/gdb.conf $(ELFFILE)" DEBUGGER_FLAGS = "-x $(AVARICE_PATH)/gdb.conf $(ELFFILE)"
DEBUGGER = "$(AVARICE_PATH)/debug.sh" $(DEBUGSERVER_FLAGS) $(AVARICE_PATH) $(DEBUGSERVER_PORT) DEBUGGER = "$(AVARICE_PATH)/debug.sh" $(DEBUGSERVER_FLAGS) $(AVARICE_PATH) $(DEBUGSERVER_PORT)
PROGRAMMER_FLAGS = -p $(subst atmega,m,$(CPU)) AVRDUDE_PROGRAMMER_FLAGS = -p $(subst atmega,m,$(CPU))
# Set flasher port only for programmers that require it # Set flasher port only for programmers that require it
ifneq (,$(filter $(PROGRAMMER),arduino avr109 buspirate stk500v1 stk500v2 wiring)) ifneq (,$(filter $(AVRDUDE_PROGRAMMER),arduino avr109 buspirate stk500v1 stk500v2 wiring))
# make the flasher port configurable (e.g. with atmelice the port is usb) # make the flasher port configurable (e.g. with atmelice the port is usb)
# defaults to terminal's serial port if not configured # defaults to terminal's serial port if not configured
PROGRAMMER_FLAGS += -P $(PROG_DEV) AVRDUDE_PROGRAMMER_FLAGS += -P $(PROG_DEV)
endif endif
PROGRAMMER_FLAGS += $(FFLAGS_EXTRA) AVRDUDE_PROGRAMMER_FLAGS += $(FFLAGS_EXTRA)
# don't force to flash HEXFILE, but set it as default # don't force to flash HEXFILE, but set it as default
FLASHFILE ?= $(HEXFILE) FLASHFILE ?= $(HEXFILE)
FFLAGS += -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -U flash:w:$(FLASHFILE) FFLAGS += -c $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PROGRAMMER_FLAGS) -U flash:w:$(FLASHFILE)
ifeq (,$(filter $(PROGRAMMER),arduino avr109 stk500v1 stk500v2 wiring)) ifeq (,$(filter $(AVRDUDE_PROGRAMMER),arduino avr109 stk500v1 stk500v2 wiring))
# Use avrdude to trigger a reset, if programming is not done via UART and a # Use avrdude to trigger a reset, if programming is not done via UART and a
# bootloader. # bootloader.
RESET ?= $(FLASHER) -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) RESET ?= $(FLASHER) -c $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PROGRAMMER_FLAGS)
endif endif