stlink for st-bootloader: Reset with platform_request_boot()
Both V2 and V21 switch to (ST) bootloader with powered reset.
This commit is contained in:
parent
470c8e8cf1
commit
ee316431f5
|
@ -13,6 +13,7 @@ LDFLAGS_BOOT := $(LDFLAGS) --specs=nano.specs -lopencm3_stm32f1 \
|
|||
-L../libopencm3/lib
|
||||
ifeq ($(ST_BOOTLOADER), 1)
|
||||
$(info Load address 0x08004000 for original ST-LinkV2 Bootloader)
|
||||
CFLAGS += -DST_BOOTLOADER
|
||||
LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8004000
|
||||
else
|
||||
LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8002000
|
||||
|
@ -34,8 +35,11 @@ SRC += cdcacm.c \
|
|||
traceswoasync.c \
|
||||
stlink_common.c \
|
||||
|
||||
ifeq ($(ST_BOOTLOADER), 1)
|
||||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
else
|
||||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade.bin dfu_upgrade.hex
|
||||
|
||||
endif
|
||||
blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o stlink_common.o
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
|
|
|
@ -93,6 +93,9 @@ uint32_t detect_rev(void)
|
|||
|
||||
void platform_request_boot(void)
|
||||
{
|
||||
#if defined(DST_BOOTLOADER)
|
||||
scb_reset_system();
|
||||
#else
|
||||
uint32_t crl = GPIOA_CRL;
|
||||
/* Assert bootloader marker.
|
||||
* Enable Pull on GPIOA1. We don't rely on the external pin
|
||||
|
@ -103,4 +106,5 @@ void platform_request_boot(void)
|
|||
crl |= 0x80;
|
||||
GPIOA_CRL = crl;
|
||||
SCB_VTOR = 0;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue