<div>I have tried to code it as the attached file, but it does not work well, read return only one char when i input a string from PC serial port tool</div><div>at the same time, testcom1 function also is called more than one time, i dont know why</div><div><br></div><div>RTEMS4.11.3 on stm32f407</div><div><div>//below is the log</div><div><div><span style="font-size: 14px;">[15:01:32.168]收←◆*** Simple COM1 Test ***</span></div><div><span style="font-size: 14px;"><br></span></div><div><span style="font-size: 14px;">Opened COM1, fd=3</span></div><div><span style="font-size: 14px;"><br></span></div><div><span style="font-size: 14px;">fcntl=0</span></div><div><span style="font-size: 14px;">Hello, I'm waiting for input..</span></div><div><span style="font-size: 14px;">\0</span></div><div><span style="font-size: 14px;">[15:01:33.022]收←◆*** Simple COM1 Test ***</span></div><div><span style="font-size: 14px;"><br></span></div><div><span style="font-size: 14px;">Opened COM1, fd=3</span></div><div><span style="font-size: 14px;"><br></span></div><div><span style="font-size: 14px;">fcntl=0</span></div><div><span style="font-size: 14px;">Hello, I'm waiting for input..</span></div><div><span style="font-size: 14px;">\0</span></div><div><span style="font-size: 14px;">[15:01:34.322]收←◆*** Simple COM1 Test ***</span></div><div><span style="font-size: 14px;"><br></span></div><div><span style="font-size: 14px;">Opened COM1, fd=3</span></div><div><span style="font-size: 14px;"><br></span></div><div><span style="font-size: 14px;">fcntl=0</span></div><div><span style="font-size: 14px;">Hello, I'm waiting for input..</span></div><div><span style="font-size: 14px;">\0</span></div><div><span style="font-size: 14px;">[15:01:35.659]收←◆*** Simple COM1 Test ***</span></div><div><span style="font-size: 14px;"><br></span></div><div><span style="font-size: 14px;">Opened COM1, fd=3</span></div><div><span style="font-size: 14px;"><br></span></div><div><span style="font-size: 14px;">fcntl=0</span></div><div><span style="font-size: 14px;">Hello, I'm waiting for input..</span></div><div><span style="font-size: 14px;">\0</span></div><div><span style="font-size: 14px;">[15:01:43.622]发→◇abcdefg</span></div><div><span style="font-size: 14px;">□</span></div></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Joel Sherrill"<joel@rtems.org>;</div><div><b>发送时间:</b> 2019年3月20日(星期三) 晚上7:48</div><div><b>收件人:</b> "787562067"<googcheng@qq.com>;<wbr></div><div><b>抄送:</b> "rtems-users@rtems.org"<users@rtems.org>; <wbr></div><div><b>主题:</b> Re: usart read variable string</div></div><div><br></div><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 20, 2019, 4:48 AM 787562067 <<a href="mailto:googcheng@qq.com">googcheng@qq.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi all</div><div>I want to read usart variable string, but only find an API  <a href="https://github.com/RTEMS/rtems/blob/4af18b34f4193eb1ffa0415d50f952aa781ef2da/bsps/arm/stm32f4/console/usart.c" target="_blank" rel="noreferrer">int usart_read_polled(int minor)</a><br></div><div>is there a simple method to do this like using the idle interrupt</div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Normally applications do not use device specific methods. They use either the normal POSIX methods like read() with termios for settings or the printk() family of methods. </div><div dir="auto"><br></div><div dir="auto">Under the hood, the implementation will either be interrupt driven or polled at each clock tick.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank" rel="noreferrer">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a></blockquote></div></div></div></div>