STM32F722RET6 timeout at USB_CoreReset() with USB3300EZK
- June 18, 2026
- 7 replies
- 137 views
Environment & hardware:
STM32F722RET6:LQFP64
USB3300EZK
STM32CubeIDE v2.1.1
STM32CubeMX v6.17.0
Windows 11 OS
Description of problem:
I am trying to use ULPI with external HS USB phy with the follwing schematic:

when calling MX_USB_DEVICE_Init(), it will be stuck at
/* Required few clock cycles before accessing USB PHY Controller Registers */
for (volatile uint32_t i = 0; i < 10; i++) {
__NOP(); // No Operation instruction to create a delay
}
/* 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;
}in USB_CoreReset(), eventually returning HAL_TIMEOUT.
Images of USBx and RCC:



My clock configuration, everything not included in this image is greyed out

ULPI pins:
/**USB_OTG_HS GPIO Configuration
PC0 ------> USB_OTG_HS_ULPI_STP
PC2 ------> USB_OTG_HS_ULPI_DIR
PC3 ------> USB_OTG_HS_ULPI_NXT
PA3 ------> USB_OTG_HS_ULPI_D0
PA5 ------> USB_OTG_HS_ULPI_CK
PB0 ------> USB_OTG_HS_ULPI_D1
PB1 ------> USB_OTG_HS_ULPI_D2
PB10 ------> USB_OTG_HS_ULPI_D3
PB11 ------> USB_OTG_HS_ULPI_D4
PB12 ------> USB_OTG_HS_ULPI_D5
PB13 ------> USB_OTG_HS_ULPI_D6
PB5 ------> USB_OTG_HS_ULPI_D7
*/
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_5;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_10|GPIO_PIN_11
|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_5;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
what I have tried:
-using another USB cable
-using another USB port
-using another PCB from the batch
-insertion of 10 cycle delay before core soft reset
-commenting out __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE(); in usbd_conf.c
-adding the follwing code in main()
/* USER CODE BEGIN SysInit */
RCC->AHB1ENR |= RCC_AHB1ENR_OTGHSEN; // enable USB OTG HS clock
RCC->AHB1ENR |= RCC_AHB1ENR_OTGHSULPIEN; // enable ULPI clock
HAL_Delay(50);
/* USER CODE END SysInit */extra information:
A short while prior to posting, the 2 PCB with the code flashed just started working without any modifications being made (the only action is that I restarted my computer) and is enumerated correctly by the computer. I then flashed new code on to one of them (I changed usb class from COM to HID), which then made it defective again, I proceed to flash the original code back but it failed again, timed out at USB_CoreReset(); Now I have one working and one defective, the voltages of the pins from USB3300EZK of 2 boards are:
working (both PCB measures to this value prior to flashing new code):
XO measures ~1.8V
CLK measures 1.666V
DIR measures a very low voltage ~ 0.04mV
defective:
no voltage across XI & XO
CLK no voltage
DIR measures 3.3V
I must again emphasize that the 2 PCB have the exact same design (they are from the same batch) and running the exact same code, the ioc file has been attatched.
Thank you for your help and advice.
