2017-05-18 04:02 PM
Issue:
USB Core issing interrupt at a rate of 8.65us causing high CPU loading.
Software/Chip:
Using USB Host/CDC from STM32Cube V1.15 on a STM32F429 board.
USB interrupt sources:
- SOF Interrupts (It is not needed for CDC type transfers) turned this interrupt off and still getting high interrupt rate.
This is configured in
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); return HAL_OK; }- NAK interrupts from bulk in endpoint. The issue is when the OTG USB gets enough NAKs from the bulk endpoint and issues an interrupt at a rate of 8.625us.
Solutions
?Is there a work around that does not degrade USB performance? The STM32FH7 also has has the same code to re-enable the bulk in endpoint.
static void HCD_HC_IN_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum)
}
else if ((USBx_HC(chnum)->HCINT) & USB_OTG_HCINT_NAK)
{
if(hhcd->hc[chnum].ep_type == EP_TYPE_INTR)
{
__HAL_HCD_UNMASK_HALT_HC_INT(chnum);
USB_HC_Halt(hhcd->Instance, chnum);
}
else if ((hhcd->hc[chnum].ep_type == EP_TYPE_CTRL)||
(hhcd->hc[chnum].ep_type == EP_TYPE_BULK))
{
/* re-activate the channel */
tmpreg = USBx_HC(chnum)->HCCHAR;
tmpreg &= ~USB_OTG_HCCHAR_CHDIS;
tmpreg |= USB_OTG_HCCHAR_CHENA;
USBx_HC(chnum)->HCCHAR = tmpreg;
}
hhcd->hc[chnum].state = HC_NAK;
__HAL_HCD_CLEAR_HC_INT(chnum, USB_OTG_HCINT_NAK);
}
}
There are several postings about this issue (The first posting is the best description of the issue)
https://community.st.com/0D50X00009XkYz2SAF
null2017-05-23 04:33 AM
Hi,
Thank you for this reported issue. This is shared internally for further review and investigation.
I will keep you informed about the taken actions/explanation if needed.
Thanks
Imen
2017-05-30 01:52 PM
Imen,
Status update?
Thanks,
Tim
2017-06-29 09:50 AM
Status update?
2017-07-06 05:54 AM
Hi
Michals.Tim
,I will check internally the status of your issue & come back to you as soon as possible with any update on this.
Sorry for the inconvenience may bring.
With Regards
Imen
2017-07-20 08:44 AM
Status?
2018-01-02 07:56 AM
Any news on this?
I am experiencing the same problem.
2018-02-04 04:03 PM
It takes a lot of time to solve this issueI I have it too: USB FS CDC in Host mode, interrupts every 8 us or so on an STM32F745. Almost 50% of the processor time is lost in this interrupt. Is there any solution?
2018-02-13 04:17 AM
Any update? Having the same issue.
2018-02-27 02:11 AM
Dear All,
Sorry for this late answer.
In fact, DMA mode is recommended in case using HS IP in order to optimize the CPU and let the core managing the reactivation of the channel.
Recently
,
we have reworked the HAL driver for STM32F7 to enhance this part
and i
t should be available in the next release of the STM32CubeF7 v1.10.0.
Kind Regards,
Imen.