2023-01-16 01:13 AM
USB_ResetPort function is called in USBH_Process in HOST_IDLE state after USBH_Delay(200U); this results in 300 ms delay usb application.
Is there any way to reduce this time in stm32 USB applications.
This function is after a USB connection.
Is there any way to remove this delays in USB_ResetPort funciton.
HAL_StatusTypeDef USB_ResetPort(USB_OTG_GlobalTypeDef *USBx)
{
uint32_t USBx_BASE = (uint32_t)USBx;
__IO uint32_t hprt0 = 0U;
hprt0 = USBx_HPRT0;
hprt0 &= ~(USB_OTG_HPRT_PENA | USB_OTG_HPRT_PCDET |
USB_OTG_HPRT_PENCHNG | USB_OTG_HPRT_POCCHNG);
USBx_HPRT0 = (USB_OTG_HPRT_PRST | hprt0);
HAL_Delay(100U); /* See Note #1 */
USBx_HPRT0 = ((~USB_OTG_HPRT_PRST) & hprt0);
HAL_Delay(10U);
return HAL_OK;
}
#[STM32 MCUs] #USB
Solved! Go to Solution.
2023-02-10 10:49 AM
Hi @NAgha.1 ,
Some timings are forced by specification and by portability reasons.
We setup these timings following validation tests ran on multiple devices.
But if your host is going to support a specific device or specific range of devices that doesn't need this delay, then you can remove it or reduce it.
I hope it helps.
2023-02-10 10:49 AM
Hi @NAgha.1 ,
Some timings are forced by specification and by portability reasons.
We setup these timings following validation tests ran on multiple devices.
But if your host is going to support a specific device or specific range of devices that doesn't need this delay, then you can remove it or reduce it.
I hope it helps.