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:

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=https%3a%2f%2fmy.st.com%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM32Java%2fProblem%20with%20USB%20Host%20CDC%20class&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=289

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.

Outcomes