Data loss over ttyACM* when 'cat' command is used for data transfer

Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
I have a development board which will have 3 ACM interfaces when connected to Ubuntu host and i want to transfer data from Host to Device over ttyACM3.
I have followed the following procedure for data transfer,
Precondition:
- Modify
/etc/inittabto remove Linux console on/dev/ttyGS3 - Create a binary file with a minimum length of about 20MBytes
Test Steps:
- DUT side:
stty -F /dev/ttyGS3 raw -echo -echoe -echok -echoctl -echoke - HOST side:
stty -F /dev/ttyACM3 raw -echo -echoe -echok -echoctl -echoke - DUT side:
cat /dev/ttyGS3 > /tmp/rx_pattern.bin - HOST side:
cat ./pattern.bin > /dev/ttyACM3
By following above procedure i see some data(~300 KB) is missed at the DUT side randomly.
I have also used "dd" command for data transfer but still there is a data loss.
But i tried to transfer the same "pattern.bin" file from the Host by using "minicom" application and "cat" command to receive from DUT side, surprisingly i don't see any data loss.
I have took USB Ellisys logs during issue scenario,
One of the "OUT" transaction is failed(handshake is NAK) and there is no "PING" transaction for the failed transfer.
Whereas in success scenario whenever "OUT" transaction fails, "PING" transaction is present and data is sent again.
stty command difference on the both the hosts.
Ubuntu 14.04:
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^A; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke
Ubuntu 16.04:
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc
Could anyone please help me out in figuring out this issue?
usb tty cat serial-port stty
 |Â
show 9 more comments
up vote
2
down vote
favorite
I have a development board which will have 3 ACM interfaces when connected to Ubuntu host and i want to transfer data from Host to Device over ttyACM3.
I have followed the following procedure for data transfer,
Precondition:
- Modify
/etc/inittabto remove Linux console on/dev/ttyGS3 - Create a binary file with a minimum length of about 20MBytes
Test Steps:
- DUT side:
stty -F /dev/ttyGS3 raw -echo -echoe -echok -echoctl -echoke - HOST side:
stty -F /dev/ttyACM3 raw -echo -echoe -echok -echoctl -echoke - DUT side:
cat /dev/ttyGS3 > /tmp/rx_pattern.bin - HOST side:
cat ./pattern.bin > /dev/ttyACM3
By following above procedure i see some data(~300 KB) is missed at the DUT side randomly.
I have also used "dd" command for data transfer but still there is a data loss.
But i tried to transfer the same "pattern.bin" file from the Host by using "minicom" application and "cat" command to receive from DUT side, surprisingly i don't see any data loss.
I have took USB Ellisys logs during issue scenario,
One of the "OUT" transaction is failed(handshake is NAK) and there is no "PING" transaction for the failed transfer.
Whereas in success scenario whenever "OUT" transaction fails, "PING" transaction is present and data is sent again.
stty command difference on the both the hosts.
Ubuntu 14.04:
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^A; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke
Ubuntu 16.04:
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc
Could anyone please help me out in figuring out this issue?
usb tty cat serial-port stty
Is the port open in another application as well?
â Ignacio Vazquez-Abrams
Jul 16 at 9:29
No. It is not open by any other application.
â Shivaprasad A Prabhu
Jul 16 at 9:30
Maybe you need to useixon(flow control).
â Ralph Rönnquist
Jul 16 at 11:54
Some serial ports have limited fifo sizes so if the OS takes too long to read the data you get overruns. Dosudo cat /proc/tty/driver/serialand look foroe:for built-in serial ports. Are you just testing the devices or do you intend to do real data transfers over this line?
â meuh
Jul 16 at 12:29
@Ralphixoncommand is not working for me. I see Host could send only few bytes when flow control is enabled.
â Shivaprasad A Prabhu
Jul 17 at 9:26
 |Â
show 9 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a development board which will have 3 ACM interfaces when connected to Ubuntu host and i want to transfer data from Host to Device over ttyACM3.
I have followed the following procedure for data transfer,
Precondition:
- Modify
/etc/inittabto remove Linux console on/dev/ttyGS3 - Create a binary file with a minimum length of about 20MBytes
Test Steps:
- DUT side:
stty -F /dev/ttyGS3 raw -echo -echoe -echok -echoctl -echoke - HOST side:
stty -F /dev/ttyACM3 raw -echo -echoe -echok -echoctl -echoke - DUT side:
cat /dev/ttyGS3 > /tmp/rx_pattern.bin - HOST side:
cat ./pattern.bin > /dev/ttyACM3
By following above procedure i see some data(~300 KB) is missed at the DUT side randomly.
I have also used "dd" command for data transfer but still there is a data loss.
But i tried to transfer the same "pattern.bin" file from the Host by using "minicom" application and "cat" command to receive from DUT side, surprisingly i don't see any data loss.
I have took USB Ellisys logs during issue scenario,
One of the "OUT" transaction is failed(handshake is NAK) and there is no "PING" transaction for the failed transfer.
Whereas in success scenario whenever "OUT" transaction fails, "PING" transaction is present and data is sent again.
stty command difference on the both the hosts.
Ubuntu 14.04:
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^A; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke
Ubuntu 16.04:
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc
Could anyone please help me out in figuring out this issue?
usb tty cat serial-port stty
I have a development board which will have 3 ACM interfaces when connected to Ubuntu host and i want to transfer data from Host to Device over ttyACM3.
I have followed the following procedure for data transfer,
Precondition:
- Modify
/etc/inittabto remove Linux console on/dev/ttyGS3 - Create a binary file with a minimum length of about 20MBytes
Test Steps:
- DUT side:
stty -F /dev/ttyGS3 raw -echo -echoe -echok -echoctl -echoke - HOST side:
stty -F /dev/ttyACM3 raw -echo -echoe -echok -echoctl -echoke - DUT side:
cat /dev/ttyGS3 > /tmp/rx_pattern.bin - HOST side:
cat ./pattern.bin > /dev/ttyACM3
By following above procedure i see some data(~300 KB) is missed at the DUT side randomly.
I have also used "dd" command for data transfer but still there is a data loss.
But i tried to transfer the same "pattern.bin" file from the Host by using "minicom" application and "cat" command to receive from DUT side, surprisingly i don't see any data loss.
I have took USB Ellisys logs during issue scenario,
One of the "OUT" transaction is failed(handshake is NAK) and there is no "PING" transaction for the failed transfer.
Whereas in success scenario whenever "OUT" transaction fails, "PING" transaction is present and data is sent again.
stty command difference on the both the hosts.
Ubuntu 14.04:
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^A; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke
Ubuntu 16.04:
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc
Could anyone please help me out in figuring out this issue?
usb tty cat serial-port stty
edited Jul 23 at 7:05
muru
33.1k576139
33.1k576139
asked Jul 16 at 9:28
Shivaprasad A Prabhu
213
213
Is the port open in another application as well?
â Ignacio Vazquez-Abrams
Jul 16 at 9:29
No. It is not open by any other application.
â Shivaprasad A Prabhu
Jul 16 at 9:30
Maybe you need to useixon(flow control).
â Ralph Rönnquist
Jul 16 at 11:54
Some serial ports have limited fifo sizes so if the OS takes too long to read the data you get overruns. Dosudo cat /proc/tty/driver/serialand look foroe:for built-in serial ports. Are you just testing the devices or do you intend to do real data transfers over this line?
â meuh
Jul 16 at 12:29
@Ralphixoncommand is not working for me. I see Host could send only few bytes when flow control is enabled.
â Shivaprasad A Prabhu
Jul 17 at 9:26
 |Â
show 9 more comments
Is the port open in another application as well?
â Ignacio Vazquez-Abrams
Jul 16 at 9:29
No. It is not open by any other application.
â Shivaprasad A Prabhu
Jul 16 at 9:30
Maybe you need to useixon(flow control).
â Ralph Rönnquist
Jul 16 at 11:54
Some serial ports have limited fifo sizes so if the OS takes too long to read the data you get overruns. Dosudo cat /proc/tty/driver/serialand look foroe:for built-in serial ports. Are you just testing the devices or do you intend to do real data transfers over this line?
â meuh
Jul 16 at 12:29
@Ralphixoncommand is not working for me. I see Host could send only few bytes when flow control is enabled.
â Shivaprasad A Prabhu
Jul 17 at 9:26
Is the port open in another application as well?
â Ignacio Vazquez-Abrams
Jul 16 at 9:29
Is the port open in another application as well?
â Ignacio Vazquez-Abrams
Jul 16 at 9:29
No. It is not open by any other application.
â Shivaprasad A Prabhu
Jul 16 at 9:30
No. It is not open by any other application.
â Shivaprasad A Prabhu
Jul 16 at 9:30
Maybe you need to use
ixon (flow control).â Ralph Rönnquist
Jul 16 at 11:54
Maybe you need to use
ixon (flow control).â Ralph Rönnquist
Jul 16 at 11:54
Some serial ports have limited fifo sizes so if the OS takes too long to read the data you get overruns. Do
sudo cat /proc/tty/driver/serial and look for oe: for built-in serial ports. Are you just testing the devices or do you intend to do real data transfers over this line?â meuh
Jul 16 at 12:29
Some serial ports have limited fifo sizes so if the OS takes too long to read the data you get overruns. Do
sudo cat /proc/tty/driver/serial and look for oe: for built-in serial ports. Are you just testing the devices or do you intend to do real data transfers over this line?â meuh
Jul 16 at 12:29
@Ralph
ixon command is not working for me. I see Host could send only few bytes when flow control is enabled.â Shivaprasad A Prabhu
Jul 17 at 9:26
@Ralph
ixon command is not working for me. I see Host could send only few bytes when flow control is enabled.â Shivaprasad A Prabhu
Jul 17 at 9:26
 |Â
show 9 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f456526%2fdata-loss-over-ttyacm-when-cat-command-is-used-for-data-transfer%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Is the port open in another application as well?
â Ignacio Vazquez-Abrams
Jul 16 at 9:29
No. It is not open by any other application.
â Shivaprasad A Prabhu
Jul 16 at 9:30
Maybe you need to use
ixon(flow control).â Ralph Rönnquist
Jul 16 at 11:54
Some serial ports have limited fifo sizes so if the OS takes too long to read the data you get overruns. Do
sudo cat /proc/tty/driver/serialand look foroe:for built-in serial ports. Are you just testing the devices or do you intend to do real data transfers over this line?â meuh
Jul 16 at 12:29
@Ralph
ixoncommand is not working for me. I see Host could send only few bytes when flow control is enabled.â Shivaprasad A Prabhu
Jul 17 at 9:26