1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 10:52:44 +01:00

boards/blxxxpill: add support for stm32duino bootloader and for generic St-Link V2.

This commit is contained in:
Vinicius G. Guimaraes 2020-04-03 11:53:29 -07:00
parent b87be4bd6e
commit f8776a989f
4 changed files with 50 additions and 2 deletions

View File

@ -7,6 +7,22 @@ ifeq (dfu-util,$(PROGRAMMER))
# Leave some space at the beginning of the flash for the bootloader
ROM_OFFSET ?= 0x2000
# If using STM32duino bootloader, this change is necessary.
# Bootloader available at
# github.com/rogerclarkmelbourne/STM32duino-bootloader/tree/master/binaries
ifeq (stm32duino,$(BOOTLOADER))
FFLAGS_OPTS ?= -R
FFLAGS ?= --device $(DFU_USB_ID) \
--alt $(DFU_ALT) \
--download $(FLASHFILE) \
$(FFLAGS_OPTS)
# Flashing may be easier if using a software USB reset.
# Future updates may provide USB support for stm32f1 which benefits
# from this software reset.
endif
else ifeq (openocd,$(PROGRAMMER))
STLINK_VERSION ?= 2
endif

View File

@ -9,9 +9,20 @@ set STOP_WATCHDOG 1
# STlink Debug clock frequency
set CLOCK_FREQ 4000
# Some revisions of the Bluepills use a CS32F103C8T6 rather than the STM32Fx
# MCU, which has a different CPUTAPID than the official STM32F103C8T6. As of
# 2020-04-09, no upstream support in OpenOCD has been merged. You can uncomment
# the following line as a workaround until your OpenOCD supports this option:
#set CPUTAPID 0x2ba01477
# Set the default reset option in cases where "SRST=none" is not used for make
if { ![info exists SRST_OPT] } {
set SRST_OPT srst_only
}
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst
reset_config $SRST_OPT srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1
# brutally overwriting detected flash size with 128KiB (OpenOCD > 0.10.0)

View File

@ -9,9 +9,20 @@ set STOP_WATCHDOG 1
# STlink Debug clock frequency
set CLOCK_FREQ 4000
# Some revisions of the Bluepills use a CS32F103C8T6 rather than the STM32Fx
# MCU, which has a different CPUTAPID than the official STM32F103C8T6. As of
# 2020-04-09, no upstream support in OpenOCD has been merged. You can uncomment
# the following line as a workaround until your OpenOCD supports this option:
#set CPUTAPID 0x2ba01477
# Set the default reset option in cases where "SRST=none" is not used for make
if { ![info exists SRST_OPT] } {
set SRST_OPT srst_only
}
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst
reset_config $SRST_OPT srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1
source [find target/stm32f1x.cfg]

View File

@ -11,6 +11,16 @@ ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'hla_serial $(DEBUG_ADAPTER_ID)'
endif
# Some stlink clones cannot signal reset properly,
# In this case, use SRST=none
ifneq (,$(SRST))
#Change the adapter init to it
# Use STLINK_VERSION to select which stlink version is used
OPENOCD_ADAPTER_INIT += \
-c 'set SRST_OPT $(SRST)'
endif
# if no openocd specific configuration file, check for default locations:
# 1. Using the default dist/openocd.cfg (automatically set by openocd.sh)
# 2. Using the common cpu specific config file