cancel
Showing results for 
Search instead for 
Did you mean: 

stm32h725 stalling at USBD_Init() function when debugging on SWD in stm32cubeIDE

llee_
Associate

I am currently working with an stm32h725RG on a custom board and was previously developing the code in VScode. After flashing the code using stm32Programmer, I could visually see that the program was getting past the MX_USB_DEVICE_Init() function because the function is called in between two sets of LED timer initializations. However, I wanted to debug the SPI communication via SWD and have now switched over to use stm32CubeIDE as my IDE and programmer. Now, the code keeps getting stuck at the USBD_Init() call inside MX_USB_DEVICE_Init() when debugging.

For more context, the board is being powered via USB through a LDO regulator with no VBUS sensing and I'm using a chopped up nucleof401re as my st-link. Both the USB and the nucleo are connected to my pc.

This is my first time working with the stm32 family so any help is much appreciated!

llee__0-1723569943643.png

(EDIT: Resolved, after switching BOOT0 so that it is pulled low, I'm able to get past the MX_USB_Init() call. It hadn't occurred to me to change this because the debugger was connecting as expected.)

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Glad you figured out the root cause of this issue. For better visibility of the solution:

By pulling low BOOT0, you configured correctly debugger settings in STM32CubeIDE, and you can boot from main flash. Bootloader might use certain configuration not in line with your current application. So, this mismatch can cause such issues.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
FBL
ST Employee

Glad you figured out the root cause of this issue. For better visibility of the solution:

By pulling low BOOT0, you configured correctly debugger settings in STM32CubeIDE, and you can boot from main flash. Bootloader might use certain configuration not in line with your current application. So, this mismatch can cause such issues.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.