From 1636a9759bc2d5f162312ac8bf5823e95e0ad053 Mon Sep 17 00:00:00 2001 From: BIGTREETECH <38851044+bigtreetech@users.noreply.github.com> Date: Fri, 1 Jul 2022 01:58:00 +0800 Subject: stm32: stm32g0/h7 usb_dfu_bootloader support (#5596) Signed-off-by: Alan.Ma from BigTreeTech --- src/stm32/stm32g0.c | 3 ++- src/stm32/stm32h7.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/stm32/stm32g0.c b/src/stm32/stm32g0.c index f38fc9c5..36520dfb 100644 --- a/src/stm32/stm32g0.c +++ b/src/stm32/stm32g0.c @@ -147,7 +147,6 @@ usb_request_bootloader(void) void armcm_main(void) { - check_usb_dfu_bootloader(); SCB->VTOR = (uint32_t)VectorTable; // Reset clock registers (in case bootloader has changed them) @@ -164,6 +163,8 @@ armcm_main(void) RCC->APBENR1 = 0x00000000; RCC->APBENR2 = 0x00000000; + check_usb_dfu_bootloader(); + // Set flash latency FLASH->ACR = (2<D1CCIPR = 0x00000000; + RCC->D2CCIP1R = 0x00000000; + RCC->D2CCIP2R = 0x00000000; + RCC->D3CCIPR = 0x00000000; SCB->VTOR = (uint32_t)VectorTable; + check_usb_dfu_bootloader(); + clock_setup(); sched_main(); -- cgit v1.2.3-70-g09d2