1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dist/tools/openocd/openocd.sh: add FLASH_BANK

Allow specifying index of `flash bank` to read configuration from
in cases where the configuration provided in openocd is incorrect.

This is the case for the majority of stm32 boards where it relies
on `flash probe` to get the correct value.
This commit is contained in:
Francisco Molina 2020-01-21 17:39:16 +01:00 committed by fjmolinas
parent b514f30ccc
commit 53f60db66f

View File

@ -105,6 +105,10 @@
# 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
#
@ -265,8 +269,7 @@ 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
# hardwritten to use the first bank
FLASH_ADDR=$(_flash_address 1)
FLASH_ADDR=$(_flash_address ${FLASH_BANK})
echo "Binfile detected, adding ROM base address: ${FLASH_ADDR}"
IMAGE_TYPE=bin
IMAGE_OFFSET=$(printf "0x%08x\n" "$((${IMAGE_OFFSET} + ${FLASH_ADDR}))")