From 36ca186bd188f99d079abae5bac1376c30fd128f Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 17 Jul 2019 16:48:50 +0200 Subject: [PATCH] boards/openmote-b: Fix openmote-b flasher This fixes the JTAG flasher which needs a hw_reset This is needed since the standard jtag reset command does not work Since FLASHFILE is assigned in the jlink makefile only the bsl needs something The FLASHFILE is assigned a hex since the bin takes much longer to flash --- boards/openmote-b/Makefile.include | 17 +++++++++-------- boards/openmote-b/dist/hw_reset.seg | 4 ++++ 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 boards/openmote-b/dist/hw_reset.seg diff --git a/boards/openmote-b/Makefile.include b/boards/openmote-b/Makefile.include index 6ecb7decf3..cea18f1ea7 100644 --- a/boards/openmote-b/Makefile.include +++ b/boards/openmote-b/Makefile.include @@ -16,19 +16,20 @@ ifeq ($(PROGRAMMER),cc2538-bsl) else ifeq ($(OS),Darwin) PORT_BSL ?= $(PORT_DARWIN) endif + FLASHFILE ?= $(HEXFILE) FLASHER = $(RIOTBASE)/dist/tools/cc2538-bsl/cc2538-bsl.py FFLAGS = -p "$(PORT_BSL)" --bootloader-invert-lines -e -w -v -b 460800 $(FLASHFILE) + RESET ?= $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py + RESET_FLAGS ?= -p "$(PORT_BSL)" --bootloader-invert-lines else ifeq ($(PROGRAMMER),jlink) - FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh - FFLAGS = $(BINDIR) $(FLASHFILE) - DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh - DEBUGSERVER = JLinkGDBServer -device CC2538SF53 - RESET ?= $(RIOTBOARD)/$(BOARD)/dist/reset.sh + # Special flashing and reset scripts are required due to board hardware + export FLASH_ADDR = 0x200000 + export JLINK_DEVICE = CC2538SF53 + export JLINK_IF = JTAG + export JLINK_RESET_FILE = $(RIOTBOARD)/$(BOARD)/dist/hw_reset.seg + include $(RIOTMAKE)/tools/jlink.inc.mk endif -FLASHFILE ?= $(BINFILE) -DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) -RESET_FLAGS ?= $(BINDIR) export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb # setup serial terminal diff --git a/boards/openmote-b/dist/hw_reset.seg b/boards/openmote-b/dist/hw_reset.seg new file mode 100644 index 0000000000..8e3ada033b --- /dev/null +++ b/boards/openmote-b/dist/hw_reset.seg @@ -0,0 +1,4 @@ +r0 +sleep 100 +r1 +exit