How to leave DFU mode and start User Code on both cores on a dual core controller? (STM32H745)
Hi!
I have basically two questions:
1. How can I jump to user code after exiting DFU on a dual core chip?
I am using NUCLEO-H745ZI-Q board and I can reset to the CM7 core by setting address 0x8000000 and than initiate a 0 download or to CM4 core if I set address 0x81000000. But cannot really start up both cores? Or is there a way to start from one core the other?
So basically my aim is to connect BOOT0 pin to high and the controller always comes up as a DFU device when board starts up and when the USB host is up it can update the firmware if neccessary and than run the user code on both cores?
2. If I am using CM7 core with USB stuffs than I need to disable USB interrupts and reset them to work properly(regarding to the DFU manual):
"When performing a jump from the bootloader to a loaded application code using the USB IP,
the application has to disable all pending USB interrupts and reset the core before enabling
interrupts. Otherwise, a pending interrupt (issued from the bootloader code) may interfere
with the user code and cause a functional failure. This procedure is not needed after exiting
the system memory boot mode"
I am doing this in the beginning of USB_OTG_FS_PCD_Init ()
hpcd_USB_OTG_FS.Instance = USB_OTG_FS;
USB_DisableGlobalInt(hpcd_USB_OTG_FS.Instance); //disable USB global interrupt
USB_CoreReset_User(hpcd_USB_OTG_FS.Instance); //copy of restet USB core code fom LL libraries
but it only works sometimes only once but generally doesnt work. Either my user code USB deivce comes up or the USB bootloader and than I try to reset to bootloader and the USB doesnt come up at all.. and after that I need to power cycle the whole demo board to get any USB back, reset pin doesnt work.. quite odd, probaly USB is getting in a messy state somehow..
Thanks,
Beni
