cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7S3 - Issue with USB HS CDC (Internal PHY) without VBUS sensing

Paul-65
Associate

Hi everyone,

I’m reaching out because I’m having trouble setting up a USB HS CDC (Communication Device Class) using the internal PHY, without VBUS sensing.
I use STM32H7S3I8T6.

My program gets stuck in the following loop before timing out:

  /* Core Soft Reset */
  USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST;

  do
  {
    count++;

    if (count > HAL_USB_TIMEOUT)
    {
      return HAL_TIMEOUT;
    }

  } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);

  return HAL_OK;
}

Despite searching through various forum topics, I can't seem to get it to work.

Here is my STM32 configuration:

Clock : 

Paul65_0-1770801606922.png

USB Clock : 

Paul65_1-1770801695881.png

 

Power Regulator :

Paul65_2-1770801758349.png

USB HS Configuration :

Paul65_3-1770801807489.png

USB_DEVICE Configuration :

Paul65_4-1770801873377.png

Here is my configuration.

I would be very grateful for any help you can provide.

Thanks in advance,

Paul

2 REPLIES 2
Gyessine
ST Employee

Hello @Paul-65 

The behavior you see (code stuck in USB_CoreReset() waiting for USB_OTG_GRSTCTL_CSRST  to clear) is a typical symptom that the USB core is not correctly initialized, often due to a hardware or clock configuration issue. Check this FAQ: Troubleshooting a USB core soft reset stuck. I'd suggest checking your configuration including clock source and PLL settings, clock...
BR
Gyessine

 

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.

Hello,

Yes, I have seen this forum. Despite that, I still can’t get it to work.
I have really checked all the forums that were discussing this issue.

Best regards,
Paul