cancel
Showing results for 
Search instead for 
Did you mean: 

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

PPiór.1
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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!

View solution in original post

7 REPLIES 7
TDK
Guru

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".

[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();

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".

This is what the NRST line looks like

0693W00000D1q10QAB.png 

Keep in mind that the uC restarts in a loop. Those longer pauses were when I pressed the reset button.

I have a 10nF capacitor there:

0693W00000D1q0mQAB.png 

I changed the condenser at reset to 0.1uF - no change seen.

As for the interrupt: While I understand the reset flag, is this suspend flag normal ?

One more thing wonders me. How can I check if everything is ok with ext phy USB3300?

As far as I know that the uC is ok because I can communicate with it, how can I check it for USB3300. Can I use the uC to try to read some USB3300 registers or something?

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!