Skip to main content
Visitor II
March 18, 2025
Question

STM32H723 Stuck after USB DFU Reset

  • March 18, 2025
  • 1 reply
  • 2057 views

STM32H723 get stuck after a successful USB DFU download / reset in the HAL_Delay() in MX_USB_DEVICE_Init();

I can fix it by moving MX_IWDG1_Init(); before MX_USB_DEVICE_Init(); so the watchdog resets the device, but is there a way so this does not happen ?

We don't see it after a power cycle but have seen it during development when reloading the debugger

    This topic has been closed for replies.

    1 reply

    Super User
    March 19, 2025

    The program probably expects peripherals to be in their after-reset state. How are you moving from USB DFU bootloader to the program?

    Perhaps in the program you should detect if USB DFU was active, perhaps by looking at USB peripheral, and reset if needed.

    pmarkAuthor
    Visitor II
    March 19, 2025

    After the flashing command i send this

    dfu-util  -d 0483:df11 -a 0 -e -R

    and it jumps to the application code but gets stuck

    so i tried adding this and it seems to work, is there any chance it could get into a endless loop or is there a better way to know that it was a jump from the DFU bootloader ?

    int main(void)

    {

    /* USER CODE BEGIN 1 */

    if(READ_REG(RCC->D2CCIP2R))

         NVIC_SystemReset();