<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1">Ewald,<br>
<br>
It does not fix it :-(<br>
The weird thing is, now even if I run the trimmed down version compiled
with 2.6.2, it also freezes.<br>
But running <br>
sudo minicom -b 9600 -o -D /dev/ttyAMA0 <br>
has no problem at all.<br>
<br>
I tried sudo -i<br>
then startx <br>
to run X window as root then execute the program, still freezes on
connect to /dev/ttyAMA0<br>
<br>
It is so weird :-(<br>
<br>
Dennis<br>
</font><br>
Ewald wrote:
<blockquote
cite="mid:A944E0F8-45BA-4DDF-B3BA-40926B12CE0D@yellowcouch.org"
type="cite">
<div>
<div>On 08 Jul 2013, at 12:09, Dennis Poon wrote:</div>
<blockquote type="cite">
<div bgcolor="#ffffff" text="#000000"><font class="Apple-style-span"
color="#000000"><br>
</font><font class="Apple-style-span" size="4">However, when I
extract the relevant code from that example and use the
normal fpc compiler (2.6.0) instead of the pparm (2.6.2) and special fp
lib inside that zip, my program freezes on synapser.pas
TBlockSerial.Connect</font><br>
<font class="Apple-style-span" size="4">at the line of
fopen(FDevice, 0_RDWR or 0_SYNC).</font><br>
</div>
</blockquote>
<div><br>
</div>
Well, I recently had a similar issue, on Mac OS X and an USB to Serial
converter (which had an FTDI chipset) -- maybe this issue is similar.
The fix was really quite easy, but it took me a while to find out.</div>
<div><br>
</div>
<div>Assume your fpOpen() call returns a handle called `Handle`. Now
add the following lines after your open call:</div>
<div><br>
</div>
<div>===Code===</div>
<div>Var Attr: TTermios;</div>
<div><br>
</div>
<div>tcgetattr(Handle, @Attr);</div>
<div><br>
</div>
<div>Attr.c_cflag:= Attr.c_cflag or CREAD or CLOCAL;<span
class="Apple-tab-span" style="white-space: pre;"> </span>// -->
This is the line that fixed the issue</div>
<div>//Do fix your other attributes here aswell, like ispeed, ospeed,
etc...</div>
<div><br>
</div>
<div>tcsetattr(Handle, TCSADRAIN, @Attr);<span class="Apple-tab-span"
style="white-space: pre;"> </span>// Take a look at the documentation
of this call to see what constant (TCSADRAIN) you want to use.</div>
<div>===EOC===</div>
<div><br>
</div>
<div>Hope it helps!</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word;">
<div style="word-wrap: break-word;">
<div style="word-wrap: break-word;"><span class="Apple-style-span"
style="border-collapse: separate; font-family: Helvetica; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<div style="word-wrap: break-word;">
<div
style="font-size: medium; color: rgb(0, 0, 0); font-style: normal;">--</div>
<div
style="font-size: medium; color: rgb(0, 0, 0); font-style: normal;">Ewald</div>
</div>
</span></div>
</div>
</div>
</div>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a></pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<p class="" avgcert="" color="#000000" align="left">No virus found in
this message.<br>
Checked by AVG - <a moz-do-not-send="true" href="http://www.avg.com">www.avg.com</a><br>
Version: 2013.0.3345 / Virus Database: 3204/6473 - Release Date:
07/08/13</p>
</blockquote>
</body>
</html>