Skip to content

Commit

Permalink
Merge pull request #13470 from kfessel/fix13179
Browse files Browse the repository at this point in the history
boards/nucleo-f767zi: Fix13179 make nucleo-f767zi debuggable again
  • Loading branch information
fjmolinas committed Feb 28, 2020
2 parents 2ebf1d6 + f00f125 commit 5af4c5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
6 changes: 0 additions & 6 deletions boards/common/stm32/dist/stm32f7.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
source [find target/stm32f7x.cfg]

# specify flash start address: since target/stm32f7x.cfg doesn't, this
# can be used as backup in case probing fails. When correct address is
# given, the flash size is obtained from hardware so no need to specify.
flash bank $_FLASHNAME.riot stm32f2x 0x08000000 0 0 0 $_TARGETNAME

reset_config srst_only
$_TARGETNAME configure -rtos auto
10 changes: 0 additions & 10 deletions boards/nucleo-f767zi/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
# load the common Makefile.include for Nucleo boards
include $(RIOTBOARD)/common/nucleo144/Makefile.include

# openocd configuration file for `stm32f7` relies on probing to find out
# FLASH_ADDR. On this board probing (`flash probe 0`) fails when `srst` is
# asserted, but `srst` needs to be asserted to be able to flash the `BOARD`
# when sleeping or after a hardfault.
# To circumvent this in boards/common/stm32/dist/stm32f7.cfg we define a new
# flash bank with the appropriate flash start address and specify that this is
# the flash bank to be used as default configuration instead of the default (1)
FLASH_BANK ?= 4
$(call target-export-variables,flash flash-only,FLASH_BANK)
9 changes: 4 additions & 5 deletions dist/tools/openocd/openocd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@
# Valid values: elf, hex, s19, bin (see OpenOCD manual for more information)
: ${IMAGE_TYPE:=}

# flash bank to read default configuration when probing fails, default to first
# bank
: ${FLASH_BANK:=1}

#
# Examples of alternative debugger configurations
#
Expand Down Expand Up @@ -221,6 +217,8 @@ _flash_list_raw() {
-f '${OPENOCD_CONFIG}' \
${OPENOCD_EXTRA_RESET_INIT} \
-c 'init' \
-c 'targets' \
-c 'reset halt' \
-c 'flash probe 0' \
-c 'flash list' \
-c 'shutdown'" 2>&1 && return
Expand Down Expand Up @@ -273,7 +271,8 @@ do_flash() {
# In case of binary file, IMAGE_OFFSET should include the flash base address
# This allows flashing normal binary files without env configuration
if _is_binfile "${IMAGE_FILE}" "${IMAGE_TYPE}"; then
FLASH_ADDR=$(_flash_address ${FLASH_BANK})
# hardwritten to use the first bank
FLASH_ADDR=$(_flash_address 1)
echo "Binfile detected, adding ROM base address: ${FLASH_ADDR}"
IMAGE_TYPE=bin
IMAGE_OFFSET=$(printf "0x%08x\n" "$((${IMAGE_OFFSET} + ${FLASH_ADDR}))")
Expand Down

0 comments on commit 5af4c5a

Please sign in to comment.