Bosse_B
Posts: 1382
Joined: Thu Jan 30, 2014 9:53 am

Freepascal crosscompile for RPi on Windows??

Sun Mar 26, 2023 6:38 pm

Does anyone here know how to create a Windows environment for cross-compiling applications that will run on RPi3-RPi4?
I am using FreePascal for most of my programming and to do so for RPi I need to install the dev environment on the RPi itself.
This is a bit convoluted since I have no RPi with a monitor or keyboard etc attached. All 15 of them are headless...
So I would have to code and debug via VNC to the RPi.

So now I wonder if there is someone else here using FreePascal for RPi who has succeeded in setting up a cross-compilation environment for Arm RPi on a Windows host?
And is willing to share how?
Bo Berglund
Sweden

NotRequired
Posts: 397
Joined: Sat Apr 29, 2017 10:36 am
Location: Denmark

Re: Freepascal crosscompile for RPi on Windows??

Sun Mar 26, 2023 6:49 pm

I have not fiddled with cross compiling from Windows to Raspberry / ARM, but I have developed FPC code (with Laz) on Windows / Linux, which is running on a Raspberry. My suggestion is that you install FPC on one of the Pi's and create a script on Windows which will move the code to the Pi with FPC installed, compile it, test the compiled binary and move the working binary to the other Pi's. Most of this should be doable with SSH.
Glowing in the dark!

User avatar
neilgl
Posts: 6095
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Freepascal crosscompile for RPi on Windows??

Sun Mar 26, 2023 6:50 pm

Have you already looked at the Lazarus IDE on Windows (Freepascal) and Ultibo on the pi?

Bosse_B
Posts: 1382
Joined: Thu Jan 30, 2014 9:53 am

Re: Freepascal crosscompile for RPi on Windows??

Sun Mar 26, 2023 7:26 pm

neilgl wrote:
Sun Mar 26, 2023 6:50 pm
Have you already looked at the Lazarus IDE on Windows (Freepascal) and Ultibo on the pi?
Yes, I have used FreePascal/Lazarus on Windows for 10+ years...
And on RPi for some 6-7 years.

No, I have no knowledge of Ultibo...
Never heard of it before.
Bo Berglund
Sweden

User avatar
neilgl
Posts: 6095
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Freepascal crosscompile for RPi on Windows??

Sun Mar 26, 2023 9:34 pm

Try Ultibo you will like it.

User avatar
Gavinmc42
Posts: 7501
Joined: Wed Aug 28, 2013 3:31 am

Re: Freepascal crosscompile for RPi on Windows??

Sun Mar 26, 2023 11:09 pm

https://ultibo.org
You can use the Windows installer exe or Fpcupdeluxe.
https://ultibo.org/download/
https://github.com/LongDirtyAnimAlf/fpc ... e/releases

If you have been using fpc that long Ultibo will easy for you.
I make kernel.img apps with it that are only 3-4MB, no need for Linux and they boot faster.
Easier to code, easier to maintain, faster to debug, faster to mod etc.
Some limitations that may or may not affect your applications.
This limitations are disappearing slowly as things get figured out.

The Ultibo IDE, modified Lazarus runs on Windows/Linux/Pi's.
If you cross compile on Windows/Linux then you will be able to even use fpc on Pico and other Cortex microcontrollers.
https://github.com/michael-ring/pico-fpcexamples

The latest Ultibo Laz/fpc IDE version will compile native fpc apps even on Pi's.
There is some convergence as Laz/fpc Ultibo/embedded gets closer to mainline.

I noticed fpcupdeluxe will run on other OSes.
Have not tried on FreeBSD etc
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Other programming languages”