[Lazarus] Cross-compiling for Raspberry Pi2

Bo Berglund bo.berglund at gmail.com
Mon Sep 21 16:42:15 CEST 2015


On Mon, 21 Sep 2015 10:24:59 +0200, Michael Schnell
<mschnell at lumino.de> wrote:

>On 09/18/2015 03:44 PM, Bo Berglund wrote:
>> Now we need to shrink and ruggedize the system ...
>
>IMHO a Pi is nit suitable to "ruggedize" a system. The Pi is made for 
>education purpose not for embedded use. It's stability, EDS immunity,  
>and temperature range is not suitable for this. If there is any security 
>issue with this project you should choose another ARM Linux system. 
>There are lots of them that offer better specifications for embedded 
>use.

I believe you are partially correct, but in this case I thought of
activating the watchdog on the Pi thus ensuring that if it hangs it
will come back on-line within short.
The work is now on making a prototype and if the hardware is not up to
the task we will be able later to change it if the need arises and the
system is accepted as such.
I take your comment as meaning there are other platforms where FPC
also runs, right?

>Moreover Wifi is not usable for decent embedded application. it is 
>very prone to be temporarily unavailable by environmental influence 
>(such as microwave ovens and other Wifi routers nearby).

Don't have much choice here...
The intrument has already been modified by replacing the serial port
by an internal WiFi AP module which connects to the instrument via
RS232 and the outside world will get access via a TCP port on the AP
host. This was done to make it possible to use Android tablets for
managing the instrument.
OTOH, the whole monitoring system will be enclosed in an aluminum box
so outside WiFi disturbances are probably not going to enter into the
system.

>
>> yesterday I realized that it would be a large task to re-invent the
>> software on the Pi using for example python since I am not at all
>> familiar with that language....
>To me it is a very viable idea to use the well tested Delphi code and 
>port the Project to fpc/Lazarus.
>
That was my second realization after first thinking it might be "easy"
to code in some Linux friendly language. After all we had a working
Delphi system, albeit running as a windows service.

But then I looked up the existing sources to check what was involved
and it turned out to be at least 4 different rather big unit files
implementing various aspects of the data handling. So porting the
object-pascal code became the probably most efficient way of doing
thus.
Only one unit deals with the physical layer and it has already a
conditional to specify what kind of com port is used. That is where I
have to tie in the conditional for TCP/IP comm using whatever socket
implementation I find most suitable.

Unfortunately since the existing code is built on non-blocking serial
communications and events to handle the data reception I am at a loss
right now concerning what TCP socket component to use.
Indy is blocking, synapse is blocking and ICS being non-blocking is
not open for commercial use and even so not really maintained for FPC
either...

Still looking...

-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list