In the nRF52840, I used the app_usbd_cdc_acm_write(&m_app_cdc_acm,tx_buf,size) method to output the data.
At the beginning, I use the pyserial to read the output data from the COM port. It works, but the speed of serial is a little bit slow around 20kB per second compared with my application which needs 25kB per second. Also, I try to use the MatLab to read the COM port, and the speed is similar with python. So, I search relevant information about how to enhance the reading speed. I found that I should read the output data from USB (winusb) instead of COM port. Then, I use the pyusb package (https://github.com/pyusb/pyusb) to do the job. First step is to install the winusb driver to nRF52840.
Then, we can see the configuration information about the device.
As we can see in the above information, we could choose the interface 1 to write something like "test1" through USB. It works and returns the result 5 which is the number of character.
However, when I try to read something from the device through USB, it shows USBTimeoutError. I communicate with the maintainer of pyusb and other people who use the other device instead of nRF52840 and read the output data through USB successfully, but could not figure out why it cannot work. Could you help me to find out how to solve this problem or give me some suggestion in other ways to enhance the reading speed to satisfy my application requirement 25kB per second.