[fpc-devel] serial port access problem in arm-linux-uclibc-

Nataraj S Narayan natarajsn at gmail.com
Wed Nov 18 14:21:09 CET 2009


Henry

The following in FreeBSD i386:-

 mySerial:=seropen('/dev/cuad0');
   SerSetParams(mySerial,115200,8,NoneParity,1,[]);
   i:=SerRead(mySerial,myStr[0],1);
   write(myStr[0]);
   writeln(i);

Gives me the character i typed from other end (minicom) and '1'. Of
course, i get  one char at a time for each run.

 One arm, getting zero always.


regards

Nataraj



On Wed, Nov 18, 2009 at 6:34 PM, Henry Vermaak <henry.vermaak at gmail.com> wrote:
> 2009/11/18 Nataraj S Narayan <natarajsn at gmail.com>:
>> Hi
>>
>> The following code works well in i386, but not on
>> arm-linux-uclibcgnueabi- , on at91sam9263ek SBC.
>>
>> {$mode objfpc}
>> {$LONGSTRINGS OFF}
>> Program ttt2;
>> uses serial;
>>
>> {nterface}
>>
>> Type
>>  DataBuffer_typ= array[0..9] of char;
>>
>> {mplementation}
>>
>> var
>> mySerial : Longint;
>> myStr    : DataBuffer_typ  ;
>>   i     : integer;
>> begin
>> {   SetLength(myStr,10);}
>>
>>   mySerial:=seropen('/dev/ttyS1');
>>   SerSetParams(mySerial,115200,8,NoneParity,1,[]);
>>   SerRead(mySerial,myStr[0],1);
>>   write(myStr[0]);
>>
>> end.
>>
>> The SBC and PC communicate well  when using  minicom.
>>
>> I compile the code for arm-linux using :-
>>
>> #  /usr/fpc-uclibc/lib/fpc/2.5.1/ppcrossarm -MObjFPC -TLinux -Parmv5
>> -gl -Xd -Xs -l -darm -XParm-linux-uclibcgnueabi- -CfSOFT -CaEABI -darm
>> -gl -O- -CpARMV5  -uUSE_LOCALIZE
>> -Fu/software/fpc-uclibc/lib/fpc/2.5.1/units/arm-linux/*
>> -FL/usr/br-git-rf/lib/ld-uClibc.so.0 -XR/usr/br-git-rf/
>> -Fl/usr/br-git-rf/lib  -Fl/usr/br-git-rf/usr/lib
>> -k"--sysroot=/usr/br-git-rf" ttt2.pas
>>
>> Where do i start checking ?
>
> What goes wrong?  You don't seem to check any return values?
>
> Henry
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>



More information about the fpc-devel mailing list