cancel
Showing results for 
Search instead for 
Did you mean: 

How to leave DFU mode and start User Code on both cores on a dual core controller? (STM32H745)

Beni1
Associate II

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

4 REPLIES 4
TDK
Guru

Having BOOT0=1 by default is a bit odd. Your user will have to jump to the application every time it's run. Usually the application is run by default and the user can select to jump to DFU mode. Might solve some issues if you did it that way instead.

If you feel a post has answered your question, please click "Accept as Solution".

Definitely modes available to start M4 from M7 side, don't expect the system loader to provide complicated functionality. Load code fragments into RAM to extend functionality.

Yes, issues the RESET being buffered/managed, and behaving different to a power cycle. Seen this on L4 also where a blank device needs power cycling to boot from FLASH.​

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Beni1
Associate II

Yeah I am not sure if that's a good method, but if wrong firmware is flashed ​into the controller and have no physical access to it you somehow need to put back a working one. This eliminates adding a custom bootloader and H7 flash memory regions are quite large compared to F7 to allocate them as bootloader flash.. or could add some external flash memory, but thought it might be simpler just using the built in one.

The issue that host needs to kick the controller out of bootloader is not a concern.

Okay I thought so there might be something possible, I will look into it.

​​

Hmm okay, thanks​