AnsweredAssumed Answered

Problems sending large files via serial gadget driver (g_serial)

Question asked by Markus Braitner on Nov 2, 2015
Latest reply on Jun 8, 2016 by hrushinale

Hello to all,

 

I'm experiencing problems sending a large text file (~112MB) from an i.MX6 COM (Computer on module) to a PC via USB (sometimes no problems, sometimes data loss up to 90%). Maybe someone has an idea how to tackle that problem?

 

My setup is as follows:

- The COM module uses the USB OTG interface to connect to a PC via USB

- I connect to the PC with only 1 USB cable directly (no extension cable)

- I'm using a custom Linux built with Yocto using kernel 3.10.17 (freescale) and g_serial compiled as a module (for kernel config see attachment)

- On the PC side, I use Windows 7 (both as "real" system and in VirtualBox; using the "linux-cdc-acm.inf" driver from the Linux kernel sources) and Ubuntu 14.04 (VirtualBox).

- For receiving data I use TeraTerm on Windows and putty or picocom on Linux.

- On the COM side, I use a qt5 program to read and send the text file via reading it and sending it to a serial interface.

- I have tried baud rates of 11500k and 9600k on both sides, but this didn't affect transmission speed (transmitting the whole 112MB file took approximately 160s, when it was transmitted without errors).

- Currently, I'm running the target (Linux) system via network from the Desktop system (but I also tried with the whole system being on sdcard - with no change)

 

What works:

- The g_serial module loads without errors using 'modprobe'.

- I can transmit and receive single characters/words without problems using the "cat" command on both ends using Linux ('cat /dev/ttyGS0' on board and 'cat /dev/ttyACM0' on desktop)

 

What doesn't work:

- Sending the large text file from the target board to the Desktop, often whole paragraphs are simply lost during transmission. Interestingly, transmission to Desktop Linux (VirtualBox) worked best, sometimes even without any data loss.

 

I tried also to run usbmon on the target board, but for some reason although there is evident data transport via USB, there is no usbmon output (even using 'cat /sys/kernel/debug/usb/usbmon/0u')...

 

Could the whole issue maybe be some problem with some underlying USB drivers, some USB buffers or with the kernel version or something else?

 

Any help would be highly appreciated...

 

Kind regards,

 

Markus

Original Attachment has been moved to: defconfig-mine.zip

Outcomes