Recent

Author Topic: Lazarus cross-compiler for embedded arm  (Read 2884 times)

dbannon

  • Hero Member
  • *****
  • Posts: 3568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus cross-compiler for embedded arm
« Reply #15 on: September 29, 2025, 10:57:56 am »
Compilation attempt of blinking example ended up successfully. I have one more small question about the configuration in Lazarus:
if I start new project (for Pico) it would be nice to check someting in the project that this is for Pico, so then all necesarry options like
Quote
-Wpraspi_pico
-godwarfsets
-godwarfcpp
-Xu
I wouldn't have to add them manually; they would be added automatically after selecting a project for Pico. I'm not sure if am I making myself clear? Maybe I've even seen it somewhere before, but I forgot how to do it...

I am not aware of  specific define for the Pico but CPUARM should be defined. So, possibly, if you are not doing any other ARM work, you could add

Code: [Select]
#ifdef CPUARM
-Wpraspi_pico
-godwarfsets
-godwarfcpp
-Xu
#endif

into your fpc.cfg file. Untested !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

krolikbest

  • Sr. Member
  • ****
  • Posts: 272
Re: Lazarus cross-compiler for embedded arm
« Reply #16 on: September 29, 2025, 08:33:50 pm »
Good point, although I compile to RPi 3/4 as well, but maybe it can be distinguished somehow with a compilation directive too?
Btw, I installed in my trunk Fpc/Lazarus  pas2js rtl/WCL. It was not simply..Somehow, the pas2js version installed with fpcupdeluxe compiled the project, but opening project1.html in the browser didn't look right. I removed that version and manually installed version 2.2.0. I have the same version installed in Lazarus 2.2.6. Now, if I have a moment, I'll connect a LAN adapter to my PICO and try to write an HTTP server with gui made with pas2js :)

dbannon

  • Hero Member
  • *****
  • Posts: 3568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus cross-compiler for embedded arm
« Reply #17 on: September 30, 2025, 07:11:43 am »
Good point, although I compile to RPi 3/4 as well, but maybe it can be distinguished somehow with a compilation directive too?

Hmm, RasPi3 is 64bit but because of limited hardware, some people recommend using the 32bit OS. I don't, so, I can depend on #ifdef CPUAARCH64  I'd expect there to be some define specific for the Pico but I cannot find it, might be a case of reading through the source ?

I have never touch pas2js, no idea I am afraid.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018