STM32H7 USB Device configurate without USB interrupter
CubeMX generated a example for USB CDC, and with HAL_PCD_IRQHandler.
Now I want use polling method to initial USB,and communicate with host without USB interrupt.
So how can I modify it?
I had tried to do something ,but it not work.Please help me.
1. disable USB interrupt at HAL_PCD_Start().
HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd)
{
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
__HAL_LOCK(hpcd);
if (((USBx->GUSBCFG & USB_OTG_GUSBCFG_PHYSEL) != 0U) &&
(hpcd->Init.battery_charging_enable == 1U))
{
/* Enable USB Transceiver */
USBx->GCCFG |= USB_OTG_GCCFG_PWRDWN;
}
// __HAL_PCD_ENABLE(hpcd);
(void)USB_DevConnect(hpcd->Instance);
__HAL_UNLOCK(hpcd);
return HAL_OK;
}
2. moved out HAL_PCD_IRQHandler function to main loop.
but it dose not work.
when host send get descriptor,device dose not response.
