4

Running linux kernel 3.14.43, I am reading from a CDC ACM device (implemented on an LPC4330). The device appears at /dev/ttyACM0, and I can open it and read from it in the normal way.

The device appears to be buffering about 4096 bytes (I get reads of 4095 bytes, typically, after a period of mostly 12 byte reads during the early phase of operation). When running on a fancy schmancy workstation, all goes smoothly. However, when running on an embedded device (AM3352), occasionally data goes missing if I go for a high data rate. I suspect the read buffer is being over-filled - the high data rate is fast enough to fill a 4k buffer in not much more than 1msec (3.8MB/s), and it seems very possible that I'm not coming back to the read() call fast enough to keep up, given that the device is doing a bunch of other stuff in other threads and I'm using SCHED_OTHER across the board.

So - first - is there a way to increase the buffer size of the device? As a supplementary, is there any way to detect that the buffers here have overflowed? I guess I have another option of using real-time scheduling for the read() thread but I'd rather not get into that if possible.

Thanks.

J. Doe
  • 63
  • 2
  • Indeed, it is 4096 byes maximum. I am also looking for a solution. Maybe I have to change the buffer size in the cdc_acm driver code and then load the modified kernal object for my device using insmod. As I am unable to find any other solution YET. – Ubdus Samad Oct 01 '20 at 14:27

0 Answers0