Skip to main content
PPiór.1
Associate II
August 8, 2021
Solved

[Solved]STM32H743xx Failed attempt to run USB HS with ext PHY USB3300

Hello.

I am in the process of power on my custom board.

Right now I'm trying to get the USB to work but I'm stuck and don't know what to do next.

I use USB midleware from CubeMX 6.1.2

The moment I have everything configured and run the interrupts I get the one interrupt with flags:

USB_OTG_GINTSTS_USBRST and USB_OTG_GINTSTS_USBSUSP.

While handling the suspend handler my micro controller is restarting

(The restart is caused by operation: __HAL_PCD_GATE_PHYCLOCK(hpcd) in usb suspend handler)

I checked the voltages and waveforms of crystal lines and ulpi clk line and everything seems to be ok.

Here is the USB3300 wiring diagram:

0693W00000D1pcUQAR.pngThanks

Piotr

This topic has been closed for replies.
PPiór.1
PPiór.1Best answer
Associate II
August 18, 2021

Someone already stated on this forum that if something went wrong with USB330 it was HW's fault . I tested 4 USB3300 controllers and only the 4th one worked.

Solved!

7 replies

TDK
August 8, 2021

What do the RCC_CSR flags say is the source of the reset? Note that you need to clear them after reading them during startup as they will persist.

"If you feel a post has answered your question, please click ""Accept as Solution""."
PPiór.1
PPiór.1Author
Associate II
August 8, 2021

[For code below], after reset caused by suspend handler, only flag RCC_FLAG_PINRST is set.

	if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB))
		pr_debug("System resumed from STANDBY mode");
	if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST))
		pr_debug("Software Reset");
	if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST))
		pr_debug("Power - On - Reset");
	if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST))
		pr_debug("External Pin Reset");
	if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDG1RST) != RESET)
		pr_debug("Watchdog Reset");
	if (__HAL_RCC_GET_FLAG(RCC_FLAG_WWDG1RST) != RESET)
		pr_debug("Window Watchdog Reset");
	if (__HAL_RCC_GET_FLAG(RCC_FLAG_LPWR1RST) != RESET)
		pr_debug("Low Power Reset");
	if (__HAL_RCC_GET_FLAG(RCC_FLAG_BORRST) != RESET)
		pr_debug("Brown - Out Reset");
	
	__HAL_RCC_CLEAR_RESET_FLAGS();

TDK
August 8, 2021

The code in question stops the clock being sent to the USB chip.

https://github.com/STMicroelectronics/STM32CubeH7/blob/ccb11556044540590ca6e45056e6b65cdca2deb2/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pcd.h#L204

I don't see how stopping the clock would end up resetting your chip.

How is your NRST wired? Do you have a 0.1uF cap on it? Maybe using a scope on the NRST signal would prove insightful. Not really sure what it could be.

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