Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-04

LazSerial from OLPM, is it working on Linux?

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I was under the assumption that LazSerial, which is available from Online Package Manager in the Lazarus IDE is crossplatform. But it seems like this is not the case, at least not for Raspbian Buster as target.

I have worked on porting a project in Windows (Delphi 2007) to FPC/Lazarus on Windows in order to then move to Linux.

I am using FPC 3.0.4/Lazarus 2.0.8 on Windows and Raspbian Buster. I have replaced the AsyncPro serial port with LazSerial.

What happens is that after I was done moving from Delphi 2007 to FPC/Lazarus in Windows 10 I went to my RPi4 installation and used OLPM to install the LazSerial package there, but it failed!

During the compile of the package the process stops with errors in lazsynaser.pas:

lazsynaser.pas(252,15) Error: Identifier not found "B500000"
lazsynaser.pas(252,22) Error: Illegal expression
lazsynaser.pas(253,14) Error: Identifier not found "B576000"
lazsynaser.pas(253,21) Error: Illegal expression
... the list continues...

The section of code in the source file generating the errors looks like this:

Rates: array[0..MaxRates, 0..1] of cardinal =
(
(0, B0),
(50, B50),
(75, B75),
.....

      {$IFDEF UNIX}
        ,(500000, B500000), <==ERRORS start here
        (576000, B576000),
        (921600, B921600),
        (1000000, B1000000),
        (1152000, B1152000),
        (1500000, B1500000),
        (2000000, B2000000),
        (2500000, B2500000),
        (3000000, B3000000),
        (3500000, B3500000),
        (4000000, B4000000)
      {$ENDIF}

The rates above the first error are defined in termios.inc in the compiler rtl sources.

So now I wonder if this is a problem with my installation or if it is not possible to run LazSerial on this platform?

Or is there a problem with LazSerial in connection with the release version 3.0.4 of FPC?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund

Seems like my post via GMANE did not make it to the list, so mailing instead…

I was under the assumption that LazSerial, which is available from Online Package Manager in the Lazarus IDE is cross-platform. But it seems like this is not the case, at least not for Raspbian Buster as target.

I have worked on porting a project in Windows (Delphi 2007) to FPC/Lazarus on Windows in order to then move to Linux.

I am using FPC 3.0.4/Lazarus 2.0.8 on Windows and Raspbian Buster. I have replaced the AsyncPro serial port with LazSerial.

What happens is that after I was done moving from Delphi 2007 to FPC/Lazarus in Windows 10 I went to my RPi4 installation and used OLPM to install the LazSerial package there, but it failed!

During the compile of the package the process stops with errors in lazsynaser.pas:

lazsynaser.pas(252,15) Error: Identifier not found "B500000"
lazsynaser.pas(252,22) Error: Illegal expression
lazsynaser.pas(253,14) Error: Identifier not found "B576000"
lazsynaser.pas(253,21) Error: Illegal expression
... the list continues...

The section of code in the source file generating the errors looks like this:

Rates: array[0..MaxRates, 0..1] of cardinal =
(
(0, B0),
(50, B50),
(75, B75),
.....

      {$IFDEF UNIX}
        ,(500000, B500000), <==ERRORS start here
        (576000, B576000),
        (921600, B921600),
        (1000000, B1000000),
        (1152000, B1152000),
        (1500000, B1500000),
        (2000000, B2000000),
        (2500000, B2500000),
        (3000000, B3000000),
        (3500000, B3500000),
        (4000000, B4000000)
      {$ENDIF}

The rates above the first error are defined in termios.inc in the compiler rtl sources.

So now I wonder if this is a problem with my installation or if it is not possible to run LazSerial on this platform?

Or is there a problem with LazSerial in connection with the release version 3.0.4 of FPC?

Bo Berglund Developer in Sweden

Reply by email

Luca Olivetti
to Bo Berglund

El 28/4/20 a les 23:23, Bo Berglund via lazarus ha escrit:

Show quoted text 6 lines
The rates above the first error are defined in termios.inc in the compiler rtl sources. So now I wonder if this is a problem with my installation or if it is not possible to run LazSerial on this platform? Or is there a problem with LazSerial in connection with the release version 3.0.4 of FPC?

I'm using laz_synapse/synaser from the ararat synapse svn repository instead of the version that comes from the package manager and it compiles just fine. Mind me, I'm using fpc 3.2.0rc1 but I checked and the same definition is also in fpc 3.0.4 (and 2.6.4). I would have noticed if it didn't compile since I've been using ararat synapse, like, forever (most of the times with windows but also linux).

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email

Bo Berglund
to Bo Berglund: Seems like my post via GMANE did not make it to the list, so mailing instead… I was…
Bo Berglund wrote 5 lines
The rates above the first error are defined in termios.inc in the compiler rtl sources. So now I wonder if this is a problem with my installation or if it is not possible to run LazSerial on this platform? Or is there a problem with LazSerial in connection with the release version 3.0.4 of FPC?

UPDATE:
While this list (or GMANE) was down I have investigated the problem using the Lazarus Forum instead.

Cause of problem:
lazsynaser.pas included in the LazSerial package was not set up to handle the ARM cpu used in Raspberry Pi. So some conditionals needed to be added for that cpu and then the package installed without errors.

Solution:
With help from the forum I modified the unit and then I also supplied the updated LazSerial package to the OPM maintainer, who updated the package on line.
So now the install from OPM works fine also on a Raspberry PI!

Case closed.

Bo Berglund Developer in Sweden

Reply by email

Balázs Székely
to Luca Olivetti: El 28/4/20 a les 23:23, Bo Berglund via lazarus ha escrit: I'm using laz_synapse/synaser…

Hi Luca,

Package laz_synapse from OPM is exactly the same with the one from the ararat synapse svn repository(just checked).
Bo is talking about package LazSerial, which is maintained by forum user "Jurasic Pork", I don't know his real name.
The two packages are not the same, although Lazserial uses synaser from synapse. I don't know other details about LazSerial( I don't use it personally).
Bo made some improvement on LazSerial yesterday, which allow the package to work on Raspberry Pi.

regards,
Balázs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200430/1cb389de/attachment.html>

Reply by email

Balázs Székely
to Balázs Székely

Bo you were faster. :)

AM Balázs Székely wrote 15 lines
Hi Luca, Package laz_synapse from OPM is exactly the same with the one from the ararat synapse svn repository(just checked). Bo is talking about package LazSerial, which is maintained by forum user "Jurasic Pork", I don't know his real name. The two packages are not the same, although Lazserial uses synaser from synapse. I don't know other details about LazSerial( I don't use it personally). Bo made some improvement on LazSerial yesterday, which allow the package to work on Raspberry Pi. regards, Balázs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200430/ed5ac8e2/attachment.html>

Reply by email

Luca Olivetti
to Balázs Székely: Package laz_synapse from OPM is exactly the same with the one from the ararat synapse svn…

El 30/4/20 a les 10:39, Balázs Székely via lazarus ha escrit:

Show quoted text 6 lines
Hi Luca, Package laz_synapse from OPM is exactly the same with the one from the ararat synapse svn repository(just checked). Bo is talking about package LazSerial, which is maintained by forum user "Jurasic Pork", I don't know his real name.

Ah, OK, I saw lazsynaser.pas and I though it was the same thing packaged a different way. I didn't notice that lazsynaser.pas is not the same as synaser.pas.

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email