Develop on-device [Was: Re: [fpc-devel] "embedded" again]

Thomas Schatzl tom_at_work at gmx.at
Tue Jan 15 12:01:54 CET 2013


Hi,

On Tue, 2013-01-15 at 10:45 +0100, Michael Schnell wrote:
> On 01/14/2013 08:31 PM, Paul Breneman wrote:
> >
> > This "embedded" thread you started recently has been great.  I've 
> > tried to keep up with how you are using (or hoping to use) FPC on 
> > headless embedded systems for years now.  Thanks, and please continue 
> > to keep us in the feedback loop!
>
> Hmm. Unfortunately I don't seem to be able yet to extract a usable 
> result from this thread.
> 
> There are different ways to use FPC (and Lazarus) to design and test 
> "embedded" projects for "headless" hardware.
> 
> Using a PC to do the biggest part of the software locally, as I 
> described in my original post seems to be commonly agreed upon.
> 
> But how to debug and finetune the stuff in the device itself ?

Do it on the device. Either directly or remote via NX, VNC or even
X-forwarding is fast enough on current devices.

Any of the many Cortex A8/A9/A15 (dual/quad) boards available. E.g.
Exynos 4/5 boards like Odroid-X2 (135 USD)/U2 (90 USD), Arndaleboard
(250 USD), ARMBRIX (135 USD), or any of the i.MX6 boards beginning from
~80 USD iirc. Or any of the Allwinner A10 boards (Hackberry A10 - 65
USD), or "USB-sticks" or mini-PCs that you can get from 40 USD upwards.
Then there are the beagleboard variants, the pandaboard, etc. I think
there are some allwinner a31 (or so; quad-a7) boards cheaply available
too. And probably many others with decent performance and price I guess.

As for future, you can expect Exynos 5 Octa boards (octa core, quad a15
+ quad a7) being available a few months after launch of the first
smartphones/tablets containing it. I assume Samsung will show off the
first devices on Mobile World Congress 2013 end of February (galaxy s4,
galaxy note 3, maybe a new galaxy tab 10) or shortly thereafter.

If you have a little more money, you can get a recent smartphone (e.g.
galaxy note 1/2) and a base station (e.g.
http://www.samsung.com/us/mobile/cell-phones-accessories/EDD-S20JWEGSTA
for the galaxy note 2, but there's one for the regular note too) that
has USB + HDMI connectors too. I think the "lapdocks" available for some
phones can serve a similar purpose. Put a debian chroot on it and off
you go. Or develop natively on Android - the fpc compiler is already
there :)

Or get a chinese not-so-big-brand tablet: for ~200 USD you can get 10"
ones with 2048x1536 ips display and at least usb/bluetooth/wifi + hdmi
out to connect a regular keyboard. (I saw ones for 215 EUR with these
specs when ordering them from Germany, i.e. with taxes, probably
shipping within the EU, etc)

Depending on your exact needs and the money you want to spend, the
devices you can buy now, already offer 1-4 cores at 1-2 Ghz, typically
1-2GB RAM and some (dev boards, mini pcs) even a real SATA connector.
Most of the developer boards also have expansion ports like the rasppi.

At least for the Odroid-X (predecessor for the X2) and allwinner a10
hardware accelerated graphics are available or in development. 

They all are reported to run stock linux. So in the "worst" case, if you
cannot find the prepackaged solutions or don't want to mess with e.g.
Android, just install a debian chroot on them and do an "apt-get install
lazarus" and use NX.

So for ARM (on-device) development, really, there are many excellent
alternatives for the rasppi. If you are not that tight on money or not
really need the rasppi, don't bother with it.

There are so many options at the moment, so actually it's the other way
round, there's so *much* choice that it's hard to find the most suitable
one for a given price point if you search a little.

> The alternatives are
>   a) cross compile using FPC and just run it (debugging via code 
> instrumentation)
>   b) install fpc on the Target and compile and just run it (debugging 
> via code instrumentation)
>   c) cross compile and remote debug using Lazarus
>   d) install Lazarus and FPC on the Target, compile and debug.
> 
> Now the hardware in question in this thread is Thread is
>   1) Raspberry Pi
>   2) a small QNAP NAS
> (To me BeagleBone is a very interesting board, as well, much more 
> "professional" than RPi and with $70 not too expensive)
> All three run Linux on a rather modern ARM.

See above.

*I* have been using such a device for a few months now, and it's fine.
Even Lazarus works fine over dog-slow VNC on such a device (I personally
don't use it, but tried). Don't expect core-i7 performance, but it's
workable. Really, don't bother with a rasppi as a development machine if
you can spare a little more money for an Allwinner A10 for that purpose.

I believe any simulator even on top-end machines is slower than that.

> So at least (a), (b) and (c) are supposed to be possible with these boards.
> (d1) is verified using the hardware graphic of the device but nor 
> recommended at least for the small version of the RPi due to it's very 
> slow X performance.
> (d1) might be possible and recommended with both when installing a 
> remote X system such as NX. I did read a paper about how to install 
> NXfree on RPi (needs configuring and compiling it from the sources) but 
> I don't dare to try this on the QNAP (but I keep it in mind)
> (d2) is only possible with NX (or a similar remoting software)
> 
> (c) seems the most appropriate way to allow for decent debugging 
> performance, but seemingly nobody yet decently tried (or wrote 
> instructions to) to get Lazarus running remote gdb via TCP/IP.
> 

Use "sudo apt-get install lazarus" on the device. Then use VNC, X
forwarding or NX. Or simply connect HDMI output to a monitor, add a
keyboard and mouse and there you have your new desktop.

> > I've used www.nomachine.com some with desktops but I'll have to use 
> > what you linked on my RPi.  Then it might allow my RPi to be a simple 
> > headless embedded system using the ARM Linux stuff here:for
> >   http://www.turbocontrol.com/easyfpgui.htm
> >
> Sorry, I don't get your meaning here. Did you try to install NX-Server 
> on the RPi (as described in the appropriate paper) ? Did it work ? Did 
> you try to try to install Lazarus on the RPi ? Did it work ?

Again:

sudo apt-get install lazarus

taken from

http://wiki.lazarus.freepascal.org/Lazarus_on_Raspberry_Pi

I think there is no need to explain how to setup x-forwarding or VNC.

nx:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=11882

(contains some link how to build + some issue fix)

The instructions to get lazarus and nx running are the same on any other
(arm-based) linux.

Hth,
Thomas





More information about the fpc-devel mailing list