From 1814bcd21165325fd32b92f858ebf6848549bbc7 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Sun, 8 Jan 2023 19:48:24 +0100 Subject: [PATCH] boards/hifive1b: Clean up flashing parameters - OpenOCD and J-Link flash configuration can be provided unconditionally, as those variables do not conflict with any others - Only use J-Link as default flasher if actually installed --- boards/hifive1b/Makefile.include | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/boards/hifive1b/Makefile.include b/boards/hifive1b/Makefile.include index 88ec119270..cbf690b580 100644 --- a/boards/hifive1b/Makefile.include +++ b/boards/hifive1b/Makefile.include @@ -1,16 +1,22 @@ -# Set default programmer as jlink -PROGRAMMER ?= jlink PROGRAMMERS_SUPPORTED += jlink openocd -ifeq (openocd,$(PROGRAMMER)) - OPENOCD_DEBUG_ADAPTER = jlink - OPENOCD_TRANSPORT = jtag - OPENOCD_PRE_FLASH_CMDS += "-c flash protect 0 1 last off" -else ifeq (jlink,$(PROGRAMMER)) - # setup JLink for flashing - JLINK_DEVICE = FE310 - JLINK_IF = JTAG - FLASH_ADDR = 0x20010000 +# OpenOCD parameters +OPENOCD_DEBUG_ADAPTER := jlink +OPENOCD_TRANSPORT := jtag +OPENOCD_PRE_FLASH_CMDS += "-c flash protect 0 1 last off" + +# setup JLink for flashing +JLINK_DEVICE := FE310 +JLINK_IF := JTAG +FLASH_ADDR := 0x20010000 + +# keep name of `JLINK` in sync with script jlink.sh in $(RIOTTOOLS)/jlink +# Default to J-Link as programmer when installed, otherwise go for OpenOCD +JLINK ?= JLinkExe +ifneq (,$(shell command -v $(JLINK))) + PROGRAMMER ?= jlink +else + PROGRAMMER ?= openocd endif TESTRUNNER_RESET_DELAY = 1