AnsweredAssumed Answered

USB Host stack is not stable during CDC communication

Question asked by baj.lukasz on Feb 4, 2015
Latest reply on Mar 4, 2015 by Montassar BEN ROMDHANE
Currently we are working with STM32F217 MCU and we use USB Host in FS mode to communicate with some external device. We use CDC class driver generated by STM32Cube plug-in to Eclipse. We are facing some problems with communication over USB. After some send/receive sequences USBH_CDC_TransmitCallback() is never called again. CPU clock is 120MHz. This problem has been noticed by other user in following topic:

Because callback is never called after some sends we are not able to implement proper communication using it. It seems when CPU clock is below 30MHz it is more stable, but this is not solution/option for our project, because we need to run CPU at the highest frequency because we are planning to transfer a lot of data through the USB interface.

Our current analysis:

1)      After 1 or 2 send sequences USBH_CDC_TransmitCallback() is never called.
2)      USBH_CDC_TransmitCallback() is not called because in CDC_ProcessTransmission() URB_Status always equals USBH_URB_IDLE.
3)      URB_Status does not change from USB_URB_IDLE to USBH_URB_DONE because interrupt for out pipe (function HCD_HC_OUT_IRQHandler() ) is not called (it is called at the beginning and it stops after 1 or 2 send sequences).
4)      Interrupts for in pipe seems to be handled properly (ISR function for RCV is called periodicaly).
5)      After each USBH_CDC_Transmit() proper data are placed in TX_FIFO of USB peripheral - USB_WritePacket function is called with proper parameters.
I'm looking forward for some help with this problem.