cancel
Showing results for 
Search instead for 
Did you mean: 

USB HOST bootloader, start application

DamianoF
Associate II

Starting from this video (https://www.youtube.com/watch?v=CGUC1wqSLCE) I'm trying to write my bootloader for DFU from an USB stick. The code works but I would like to tweak it such that:

  • if at boot an USB stick is detected, than start the update, otherwise jump to application (done and it works)
  • at the end of the update, jump to the application (this does not work)

I got it work the second point by adding a delay to let me remove the USB stick. But if the USB stick is still plugged in, then the "jump to application part does not work.

I suspect that this is related some kind of USB peripheral initialization.

Here is the zip of the project.

1 ACCEPTED SOLUTION

Accepted Solutions
MM..1
Chief II

Try rearange your start into app from clean mcu state. I preffer reboot with some marker....

Perfect is dont init or deinit all boot periph before jump.

View solution in original post

2 REPLIES 2
MM..1
Chief II

Try rearange your start into app from clean mcu state. I preffer reboot with some marker....

Perfect is dont init or deinit all boot periph before jump.

Thank you so much! I have managed to implement your solution. It works, but there is still a problem: when the flash programming is finished, the application program starts but when I remove the USB memory device, the program freezes.

 

EDIT: I fixed this issue by disabling the usb interrupt: HAL_NVIC_DisableIRQ(OTG_FS_IRQn);