Posts: 8
Joined: Fri Jun 26, 2015 2:51 pm
Contact: ICQ

FPC/Lazarus Compiling Questions

Sun Apr 15, 2018 9:16 pm

In my possession is the original RPi B+ (July 2014 release) and the new RPi 3B (Feb 2016 release) (Not Plus). (In this thread, I'll state B+ and 3B as the appropriate RPi machine I'm referring to)

I've spent my day getting FPC+Lazarus installed on my Win8.1 machine and have used fcupdeluxe to get this B+ machine ready to go with some console level applications (I basically want to make a clock out of it with some basic weather info, pull info from the local bus schedules, etc, all via console mode)

I've got the Lazarus going and building to the ARM processor for Linux OS. I've build a basic Hello World application with a new console type project, ran it on the B+ and I get an unhandled exception. For funzies, I copied the project1 file over directly from the B+ to the 3B and it executed no problems.

The B+ is running
pi@RPiBPlus ~ $ cat /etc/debian_version

The 3B is running
pi@RPi3B:~ $ cat /etc/debian_version

What do I need to do to convince Lazarus on Win8 to build for the B+? Its the device that has a small LCD that I want on my night stand. Is there something on the 3B that the B+ doesn't have?

--After a bit--
I went a step further, found that I had FP installed on the B+, rewrote HelloWorld and recompiled, and executed without issue. Also copied binary over to the 3B and it worked there.

User avatar
Posts: 38902
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: FPC/Lazarus Compiling Questions

Sun Apr 15, 2018 9:38 pm

What ARM processor architecture are you cross-compiling for? Your B+ has an ARM6, your 3B (not plus) has an ARM8. You WILL get segfaults if you try to run ARM8 code on an ARM6.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Posts: 8
Joined: Fri Jun 26, 2015 2:51 pm
Contact: ICQ

Re: FPC/Lazarus Compiling Questions

Sun Apr 15, 2018 9:56 pm

Laz was set to use the default up until your suggestion. I then set it to use ARMV6*, and the binary still does not run on the B+. I've taken the CPU down to v3 and still, it doesn't compile. ARMV7 and ARMV7M doesn't seem to want to compile. Not sure why yet.

I then started looking at the units, and it seems to be the CRT unit that is messing up the build. If I remove that, then I get a successful run on both the B+ and 3B.

I'm executing the HelloWorld app through both TTY as well as through an SSH session via Putty and getting similar results.

*Checked against https://en.wikipedia.org/wiki/Raspberry ... ifications

Right now, the only unit I'm using is sysutils. Adding CRT bombs on the B+, but the exact same binary executes on the 3B. If I compile without the CRT unit I get successful results on both B+ and 3B.

This is the entirety of the code:

Code: Select all

program HelloWorld;

uses crt,sysutils;


edit: Just to add to this, I didn't catch the V8 thing. I don't have the ability to compile against V8 in what fpupdeluxe installed for me. But even then, I'm interested in compiling for the B+ at this time, which is the V6 as you stated. So now my target is CRT and why its giving me problems.

Return to “Other programming languages”