From 9d668d63a7183a62b9f78ef7e40f1a2089a43097 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 12 Dec 2022 22:54:17 -0500 Subject: [PATCH] stm32: Rework usb_reboot_for_dfu_bootloader() so it works on stm32h723 Signed-off-by: Kevin O'Connor --- src/stm32/stm32h7.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stm32/stm32h7.c b/src/stm32/stm32h7.c index 3423e7eb..4f9ec68c 100644 --- a/src/stm32/stm32h7.c +++ b/src/stm32/stm32h7.c @@ -208,7 +208,7 @@ clock_setup(void) * Bootloader ****************************************************************/ -#define USB_BOOT_FLAG_ADDR (CONFIG_RAM_START + CONFIG_RAM_SIZE - 1024) +#define USB_BOOT_FLAG_ADDR (0x24000000 + 0x8000) // Place flag in "AXI SRAM" #define USB_BOOT_FLAG 0x55534220424f4f54 // "USB BOOT" // Flag that bootloader is desired and reboot @@ -216,6 +216,7 @@ static void usb_reboot_for_dfu_bootloader(void) { irq_disable(); + SCB_DisableDCache(); *(uint64_t*)USB_BOOT_FLAG_ADDR = USB_BOOT_FLAG; NVIC_SystemReset(); }