Skip to main content
Visitor II
August 8, 2021
Solved

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

  • August 8, 2021
  • 1 reply
  • 2088 views

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.
    Best answer by PPiór.1

    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!

    1 reply

    Super User
    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.

    PPiór.1Author
    Visitor 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();

    Super User
    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.