dmitrystu / libusb_stm32

Lightweight USB device Stack for STM32 microcontrollers
Apache License 2.0
713 stars 163 forks source link

TX not working when buffer length equal to CDC_DATA_SZ #56

Closed Slinred closed 4 years ago

Slinred commented 4 years ago

Hello there, i just started playing around with this very nice library and came across the issue, that when i use the cdc_loop demo and im sending the given enpoint size (64B in this case) its not transmitting back to the host. When i change the line that writes to the endpoint to this: usbd_ep_write(dev, CDC_TXD_EP, &fifo[0], (rxPos < CDC_DATA_SZ) ? rxPos : (CDC_DATA_SZ-1)); It works and sends two packets, first one is 63B and the next is 1B

Greets :)

dmitrystu commented 4 years ago

It was a problem with reading, not writing. Tnx.