stm32: Rework usb_reboot_for_dfu_bootloader() so it works on stm32h723

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-12-12 22:54:17 -05:00
parent f6199ef613
commit 9d668d63a7
1 changed files with 2 additions and 1 deletions

View File

@ -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();
}