Hi,
I'm working with uVision 5.15 and RL-USB with RTX to develop a USB CDC application. I used the function USBD_CDC_ACM_DataSend to send data over the USB com port. The application continuously (250ms step) sends a keepalive message through the USB com port to the host, the problem is that if the com port is closed after some messages the USBD_CDC_ACM_DataSend stops to work and also return 0 as byte sent, also opening the connection does not solve the problem. Someone knows how to solve this problem? Is this a RL-USB bug?
Regards
Sound like you are working on the old RL-USB using the latest MDK-ARM.
Yes, I'm using the old RL-USB.
Maybe your PC is a Linux (or Mac) box, which polls the CDC bulk IN endpoint just while the COM port opens. Windows CDC driver always polls the IN endpoint, regardless of open/close of the COM port.
The PC is a Windows PC. I have already saw that with Linux OS this problem exists and I used the DTR signal to check the connection status and avoid data sending if the com port is closed.
tell us the type number of your MCU for further discussion The MCU is the LPC1758 from NXP.
After a lot of tests I restricted the problem at the OS reboot (still Windows), during reboot the com port is closed and the device put in suspended state. After the reboot the device is resumed from suspend state, the com port has been opened, the device detects the DTR signal and start transmissions but sometimes the transmission seems to be blocked. What I saw in debug mode is that the device receives SOF events, calls routines to tx on USB data but there are no BULKIN events and nothing is received from the PC side. After some packets the intermediate buffer becomes full and this is the reason why USBD_CDC_ACM_DataSend returns always 0.
I tried also to replace the USB lib from Keil with the one found here github.com/.../USBStack which seems to be the source code of the libs but I didn't found where is the real problem.
Hello,
I need to ask is the problem solved?
But at first, I working with Keil uVision Version 5.18, CMSIS 4.5.0 and MDK 7.0.0. The used microcontroller is a LPC4357.
I have the same problem with the USBD_CDC_ACM_WriteData Function that returns over the time always a zero value. When I send not big amount of data over the short period of time, then this function works fine, but in the case of big amounts it stops working after some time. In my case I am waiting for the DTR-Signal and after the Signal appears, I start with the data Transfer over USB to Windows PC. And DTR-Signal has the same state all the time, it is not toggled.
Best regards, Daniel Huhn