<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} .ms-cui-menu {background-color:#ffffff;border:1px rgb(171, 171, 171) solid;font-family:'Segoe UI WPC', 'Segoe UI', Tahoma, 'Microsoft Sans Serif', Verdana, sans-serif;font-size:11pt;color:rgb(51, 51, 51);} .ms-cui-menusection-title {display:none;} .ms-cui-ctl {vertical-align:text-top;text-decoration:none;color:rgb(51, 51, 51);} .ms-cui-ctl-on {background-color:rgb(223, 237, 250);opacity: 0.8;} .ms-cui-img-cont-float {display:inline-block;margin-top:2px} .ms-cui-smenu-inner {padding-top:0px;} .ms-owa-paste-option-icon {margin: 2px 4px 0px 4px;vertical-align:sub;padding-bottom: 2px;display:inline-block;} .ms-rtePasteFlyout-option:hover {background-color:rgb(223, 237, 250) !important;opacity:1 !important;} .ms-rtePasteFlyout-option {padding:8px 4px 8px 4px;outline:none;} .ms-cui-menusection {float:left; width:85px;height:24px;overflow:hidden}--></style>
</head>
<body>
<div style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hello,<br>
</p>
<p>for data transmission we are using a xmodem protocol.<br>
</p>
<p>We experienced that bytes are lost when sending binary data from PC to a LEON3 system running RTEMS 4.11<br>
</p>
<p>When reducing the baudrate the data transmission looks ok.<br>
</p>
<p><br>
</p>
<p>That is how we use the console driver (path: /dev/console ):<br>
</p>
<p><br>
</p>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>int fd = open( devname, O_RDWR);</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>if (fd < 0) {</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>return -errno;</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>}</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>struct termios settings;</div>
<div><br>
</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>tcgetattr( fd, &settings);<br>
</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>cfmakeraw( &settings);</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>cfsetspeed( &settings, B4800);</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>settings.c_cc[VMIN] = 0;</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>settings.c_cc[VTIME] = 5;</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>int err = tcsetattr( fd, TCSANOW, &settings);</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>tcflush(fd, TCIOFLUSH);<br>
</div>
<p><br>
</p>
<p><br>
</p>
<p>But desired is B115200<br>
</p>
<p><br>
</p>
<p>If we set it to the higher speed we see that bytes are missing. We scope the receiver using this:<br>
</p>
<p><br>
</p>
<div>static int mygetc( char *c)</div>
<div>{</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>int g_debugfd = get_debugfd();<br>
</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>int ret = read( g_debugfd, c, 1);</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>if ((ret > 0) && (log_rx_ptr < sizeof(log_rx))) {</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>log_rx[log_rx_ptr++] = *c;</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>}</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>if(ret == 1)</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>return 0;</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space: pre;"></span>return -1;</div>
<div>}<br>
</div>
<div><br>
</div>
<div><br>
​Has anyone else experienced this behavior?</div>
<div><br>
<br>
</div>
</div>
</body>
</html>