cancel
Showing results for 
Search instead for 
Did you mean: 

USB ID pin interrupt

YChun.5
Associate

GPIO configuration as follows

void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd)

{

...

  GPIO_InitStruct.Pin = GPIO_PIN_10;

  GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;

  GPIO_InitStruct.Pull = GPIO_PULLUP;

  GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;

  GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;

  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 

And ID interrupt mask was enabled.

HAL_StatusTypeDef USB_HostInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg)

{

 /* Enable interrupts matching to the Host mode ONLY */

 USBx->GINTMSK |= (USB_OTG_GINTMSK_PRTIM      | USB_OTG_GINTMSK_HCIM |\

          USB_OTG_GINTMSK_SOFM       |USB_OTG_GINTSTS_DISCINT|\

          USB_OTG_GINTMSK_PXFRM_IISOOXFRM | USB_OTG_GINTMSK_WUIM |\

           USB_OTG_GINTMSK_CIDSCHGM );

However ID change interrupt was not occurred.

Did I miss something?

Please check the GPIO configuration and interrupt mask.

I don't know what's wrong.

0 REPLIES 0