Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44c7b90

Browse files
davids5LorenzMeier
authored andcommitted
stm32h7:Bootloader fix assertion caused by USB running
USB was still running in transition to Firmware. This resets the USB
1 parent 0cc2501 commit 44c7b90

File tree

1 file changed

+5
-1
lines changed
  • platforms/nuttx/src/bootloader/stm32h7

1 file changed

+5
-1
lines changed

platforms/nuttx/src/bootloader/stm32h7/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ board_deinit(void)
311311

312312
#if INTERFACE_USB
313313
px4_arch_configgpio(MK_GPIO_INPUT(GPIO_OTGFS_VBUS));
314+
putreg32(RCC_AHB1RSTR_OTGFSRST, STM32_RCC_AHB1RSTR);
314315
#endif
315316

316317
#if defined(BOARD_FORCE_BL_PIN_IN) && defined(BOARD_FORCE_BL_PIN_OUT)
@@ -342,7 +343,10 @@ board_deinit(void)
342343
#endif
343344

344345

345-
/* disable the AHB peripheral clocks */
346+
347+
/* Clear any RSTR set above and disable the AHB peripheral clocks */
348+
349+
putreg32(0, STM32_RCC_AHB1RSTR);
346350
putreg32(0, STM32_RCC_AHB1ENR);
347351
}
348352

0 commit comments

Comments
 (0)