cancel
Showing results for 
Search instead for 
Did you mean: 

Transmission not working with USB HOST CDC using the STM USB stack, STM32CubeMX, the dev board B-L475E-IOT01A (STM32L475 Discovery Kit)

Posted on April 11, 2018 at 21:30

I installed the USB HOST CDC on B-L475E-IOT01A, used the STM USB stack and I followed the UM1720 User manual STM32Cube USB host library. When I connect a USB CDC device, everything goes well for the enumeration and configuration. Then, two observations:

1- If I only transmit a packet (USBH_CDC_Transmit) each two seconds, the data is transmitted but after around 10 packets, transmission stop and the stack tries to send again the same packet continuously (since URB_Status == USBH_URB_NOTREADY in CDC_ProcessTransmission()) without any success.

2- If I transmit a packet to a CDC device each two seconds and that device returns another packet right away (gotten with USBH_CDC_Receive() on the host side), transmission works only one time, but after the first transmission/reception, no other data is transmitted even if USB_WritePacket() is called. No Tx interrupt. Curiously, if I put a breakpoint at USB_WritePacket() function call in USB_HC_StartXfer(), everything starts working, transmission and reception.

Is anybody have an idea what can I do to find the problem?

Thanks,

JS

By the way, English is not my natural language.

#usb-cube-host-cdc
3 REPLIES 3
Posted on April 13, 2018 at 17:26

OK now I fixed the problem no. 2. However, the problem no. 1 is still there. In fact, it seems that the problem starts when I get HC_NAK (

HCD_HC_OUT_IRQHandler

) continuously. Any ideas?

Ghassen Brinis
Associate
Posted on April 19, 2018 at 16:46

Hello , I am working on the data transmission using usb host cdc  too . I ma using  stm32f207 nucmleo 144  . i select the host on stm32 cube mx and the class cdc and i write my code on the  main but i dont know why it cant send the msg using 

USBH_CDC_Transmit. .I think i missed something .

Posted on April 26, 2018 at 16:13

The problem no.1 has been fixed. It was related to the connected USB device, not the host.