Merge pull request #14428 from aabadie/pr/boards/hifive1b_openocd
boards/hifive1b: add support for openocd programmer
This commit is contained in:
commit
6bf6b6be6c
@ -5,12 +5,23 @@ 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
|
||||||
|
|
||||||
# setup JLink for flashing
|
# Set default programmer as jlink
|
||||||
# export JLINK := JLink
|
PROGRAMMER ?= jlink
|
||||||
JLINK_DEVICE = FE310
|
|
||||||
JLINK_IF = JTAG
|
ifeq (openocd,$(PROGRAMMER))
|
||||||
FLASH_ADDR = 0x20010000
|
DEBUG_ADAPTER = jlink
|
||||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
OPENOCD_TRANSPORT = jtag
|
||||||
|
OPENOCD_PRE_FLASH_CMDS += "-c flash protect 0 1 last off"
|
||||||
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|
||||||
|
else ifeq (jlink,$(PROGRAMMER))
|
||||||
|
# setup JLink for flashing
|
||||||
|
JLINK_DEVICE = FE310
|
||||||
|
JLINK_IF = JTAG
|
||||||
|
FLASH_ADDR = 0x20010000
|
||||||
|
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||||
|
else
|
||||||
|
$(error Programmer '$(PROGRAMMER)' not supported for board '$(BOARD)')
|
||||||
|
endif
|
||||||
|
|
||||||
TESTRUNNER_RESET_DELAY = 1
|
TESTRUNNER_RESET_DELAY = 1
|
||||||
$(call target-export-variables,test,TESTRUNNER_RESET_DELAY)
|
$(call target-export-variables,test,TESTRUNNER_RESET_DELAY)
|
||||||
|
|||||||
10
boards/hifive1b/dist/openocd.cfg
vendored
Normal file
10
boards/hifive1b/dist/openocd.cfg
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
adapter speed 4000
|
||||||
|
|
||||||
|
set _CHIPNAME riscv
|
||||||
|
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x20000913
|
||||||
|
|
||||||
|
set _TARGETNAME $_CHIPNAME.cpu
|
||||||
|
target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME
|
||||||
|
$_TARGETNAME.0 configure -work-area-phys 0x80000000 -work-area-size 0x4000 -work-area-backup 0
|
||||||
|
|
||||||
|
flash bank onboard_spi_flash fespi 0x20000000 0 0 0 $_TARGETNAME.0
|
||||||
Loading…
x
Reference in New Issue
Block a user