Skip to content

Commit

Permalink
boards/stm32f3: fix openocd config to flash from invalid state
Browse files Browse the repository at this point in the history
When flashing multiple times the flasher sometimes gets stuck which
prevents flashing after.
It may be from a specific firmware or operation but do not have one yet.
Connect under reset fix flashing from this state.
-c 'reset halt' is needed to support debug with the new configuration.

It was found after the `stm32f3discovery` get stuck in a non-flashable mode
after some firmwares.

This was adapted from `stm3f103c8` configuration and commit.

Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
  • Loading branch information
cladmi and MrKevinWeiss committed May 20, 2019
1 parent c439346 commit 3a18eaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion boards/common/stm32/dist/stm32f3.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source [find target/stm32f3x.cfg]
reset_config srst_only
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only connect_assert_srst
$_TARGETNAME configure -rtos auto
4 changes: 4 additions & 0 deletions boards/stm32f3discovery/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ include $(RIOTMAKE)/tools/serial.inc.mk
export DEBUG_ADAPTER ?= stlink
export STLINK_VERSION ?= 2

# call a 'reset halt' command before starting the debugger
# it is required as `connect_assert_srst` is set
export OPENOCD_DBG_START_CMD = -c 'reset halt'

# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

0 comments on commit 3a18eaa

Please sign in to comment.