Merge pull request #11833 from MrKevinWeiss/boards/openmoteb/flashfix

boards/openmote-b: Fix flashing issues
This commit is contained in:
Peter Kietzmann 2019-07-22 11:51:48 +02:00 committed by GitHub
commit 294fb38381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 13 deletions

View File

@ -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

View File

@ -29,6 +29,9 @@ void board_init(void)
gpio_init(LED1_PIN, GPIO_OUT);
gpio_init(LED2_PIN, GPIO_OUT);
gpio_init(LED3_PIN, GPIO_OUT);
/* The boot pin must be set to input otherwise it may lock the bootloader */
gpio_init(BOOT_PIN, GPIO_IN);
gpio_init(USER_BUTTON_PIN, GPIO_IN);
gpio_init(RF_SWITCH_2_4_GHZ_PIN, GPIO_OUT);
gpio_init(RF_SWITCH_SUB_GHZ_PIN, GPIO_OUT);

4
boards/openmote-b/dist/hw_reset.seg vendored Normal file
View File

@ -0,0 +1,4 @@
r0
sleep 100
r1
exit

View File

@ -40,11 +40,6 @@ RIOT support flashing with USB by default.
You may have to specify the flashing port with
`PORT_BSL=<my_openmote_port> make flash`
@note On some boards the MSP430 chip responsible for controlling
the bootloading pins may not be functioning. If you are only able to flash
when there is no image (either the first time after purchase or after erasing
with the jtag). Please contact the manufacturer to provide a fix.
### Flashing via JTAG
To be able to flash the board via JTAG you need to install Seggers JLinkExe
@ -56,4 +51,11 @@ from your application folder.
Mac OS users may experiment a command line expecting `connect`. Just type it
and the process will continue.
### Debugging
The JTAG interface is required for debugging. On some board revisions the
debug may not be able to run. To debug use:
`make debug`
*/

View File

@ -96,6 +96,8 @@
#define CCA_BACKDOOR_ENABLE (1)
#define CCA_BACKDOOR_PORT_A_PIN (6) /**< BSL_BOOT Pin */
#define CCA_BACKDOOR_ACTIVE_LEVEL (0) /**< Active low */
#define BOOT_PIN GPIO_PIN(0, CCA_BACKDOOR_PORT_A_PIN) /**< BSL_BOOT Pin */
/** @} */
/**