stm32: stm32g0/h7 usb_dfu_bootloader support (#5596)

Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
This commit is contained in:
BIGTREETECH 2022-07-01 01:58:00 +08:00 committed by GitHub
parent 167736ad1c
commit 1636a9759b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 2 deletions

View file

@ -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<<FLASH_ACR_LATENCY_Pos) | FLASH_ACR_ICEN | FLASH_ACR_PRFTEN;