STM32Cube USB device driver interrupt handler fails to clear TxState, leaving CDC unable to send IN transfers
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-12-15 11:08 AM
Posted on December 15, 2015 at 20:08
I've found a bug where the order of the interrupt handlers causes the HAL driver to get stuck in TxState==1, causing CDC_Transmit_FS() to always return USBD_BUSY leaving it unable to send any more IN transfers.
The bug sometimes occurs when the USB IN interrupt is triggered with flags 0x81 (USB_OTG_DIEPINT_XFRC and USB_OTG_DIEPINT_TXFE). The transfer complete flag is cleared before the call to PCD_WriteEmptyTxFifo(), which can lead to TxState never being cleared. I resolved it in my repository by moving the if block that handles USB_OTG_DIEPINT_XFRC to the end of the ep_intr handling section.This is happening on an STM32F405RG, attached to a ThinkPad running Windows 7, with PuTTY attached to the COM port supplied by the ST Virtual comport driver. #bug #cdc #usb #stm32cube
Labels:
- Labels:
-
Bug-report
-
STM32Cube MCU Packages
-
USB
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
