Problems sending large files via serial gadget driver (g_serial)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems sending large files via serial gadget driver (g_serial)

2,354 Views
markusbraitner
Contributor IV

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

Labels (4)
0 Kudos
7 Replies

1,630 Views
seungwhanrhee
Contributor I

Hello Markus and Fabio,

My interest on this is the transfer speed.

Seems that transfer speed is around 700KB/sec which is far below than USB 2.0 HS speed.

Is it( ~ 700KB/sec) what you normally get in this configuration?

I am doing something similar and I wish I could get around 4 ~ 5MB/sec.

Do you have any clue on how to achieve this?

Thank you,

SR.

0 Kudos

1,630 Views
fabio_estevam
NXP Employee
NXP Employee

What is the kernel version you are running on the mx6?

0 Kudos

1,630 Views
markusbraitner
Contributor IV

This is the freescale kernel 3.10.17 with some adaptations to the hardware (COM) by the COM manufacturer.

0 Kudos

1,630 Views
fabio_estevam
NXP Employee
NXP Employee

Do you see the same issue with FSL 3.14 kernel?

0 Kudos

1,630 Views
markusbraitner
Contributor IV

Hello Fabio,

meanwhile I've found out that the problem obviously doesn't refer to the driver, but to the way I use the driver in my little Qt program to transmit the text file... So somehow my mistake...

Anyway, thanks very much for your help!

Kind regards,

Markus

0 Kudos

1,630 Views
hrushinale
Contributor III

Hello Markus,

                       Can you please tell me , how you configured the USB OTG as a serial device?I want to use the USB-OTG as a serial Console in U-boot but I am not getting any solution regarding that.

0 Kudos

1,630 Views
markusbraitner
Contributor IV

Hello Fabian,

the output of 'uname -a' on the board is

3.10.17-release20150209-g34a7e24-dirty #3 SMP PREEMPT Fri Oct 30 15:02:02 CET 2015 armv7l GNU/Linux

Kind regards,

Markus

0 Kudos