From 0c43ae1fd4d3dc245038b39afe55197c9397f100 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 16 Dec 2022 17:29:45 -0500 Subject: [PATCH] stm32: Just clean dcache instead of disabling on stm32h7 dfu reboot Signed-off-by: Kevin O'Connor --- src/stm32/stm32h7.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stm32/stm32h7.c b/src/stm32/stm32h7.c index 4f9ec68c..43b7aa6e 100644 --- a/src/stm32/stm32h7.c +++ b/src/stm32/stm32h7.c @@ -216,8 +216,9 @@ static void usb_reboot_for_dfu_bootloader(void) { irq_disable(); - SCB_DisableDCache(); - *(uint64_t*)USB_BOOT_FLAG_ADDR = USB_BOOT_FLAG; + uint64_t *bflag = (void*)USB_BOOT_FLAG_ADDR; + *bflag = USB_BOOT_FLAG; + SCB_CleanDCache_by_Addr((void*)bflag, sizeof(*bflag)); NVIC_SystemReset(); }