H7 turn off USB before reset (#2999)
* turn off USB before reset * comment * add link
This commit is contained in:
parent
9ebaa0f926
commit
c3699f8353
|
@ -313,6 +313,13 @@ stm32_hardware_pwm* getNextPwmDevice() {
|
|||
#endif
|
||||
|
||||
void jump_to_bootloader() {
|
||||
#ifdef STM32H7XX
|
||||
// H7 needs a forcible reset of the USB peripheral(s) in order for the bootloader to work properly.
|
||||
// If you don't do this, the bootloader will execute, but USB doesn't work (nobody knows why)
|
||||
// See https://community.st.com/s/question/0D53W00000vQEWsSAO/stm32h743-dfu-entry-doesnt-work-unless-boot0-held-high-at-poweron
|
||||
RCC->AHB1ENR &= ~(RCC_AHB1ENR_USB1OTGHSEN | RCC_AHB1ENR_USB2OTGFSEN);
|
||||
#endif
|
||||
|
||||
// leave DFU breadcrumb which assembly startup code would check, see [rusefi][DFU] section in assembly code
|
||||
*((unsigned long *)0x2001FFF0) = 0xDEADBEEF; // End of RAM
|
||||
// and now reboot
|
||||
|
|
Loading…
Reference in New Issue