Recent

Author Topic: RasPi Pico - needs 'old' FPC ?  (Read 637 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2289
    • tomboy-ng, a rewrite of the classic Tomboy
RasPi Pico - needs 'old' FPC ?
« on: January 30, 2023, 05:54:02 am »
Folks, I though I'd have a play with a Pico purchased well over a year ago...

At the time, some great work was done by MiR, **s://wiki.freepascal.org/ARM_Embedded_Tutorial_-_FPC_and_the_Raspberry_Pi_Pico but some tricks were involved and you needed to use fpcupdelux.

However, that no longer works, the Pico button on  fpcupdelux selects Lazarus Trunk and fpc source from here - **s://gitlab.com/michael-ring/freepascal-sources - that seems to be pre 3.2.2 and a few additions. And trunk Lazarus has symbols that pre fpc3.2.2 don't have, see log below. Even Lazarus Fixes builds fine, just not trunk.

Questions :
  • Does anyone know if the things MiR (Michael) teased out for the Pico made it into FPC3.2.2 or, more likely, main ?
  • And the FPC make commands to build a Pico compatible compiler ? 


I think its not a MUST to have a special build Lazarus as long as we have a Pico compatible cross compiler but I don't see where that is ....

Thanks, Davo

This is where the Trunk Lazarus fails -
Code: [Select]
/home/dbannon/Pico2/fpc/bin/x86_64-linux/fpc.sh -gl -Sic -Fu../packager/units/x86_64-linux -Fu../components/lazutils/lib/x86_64-linux -Fu../components/freetype/lib/x86_64-linux -Fu. -Funonwin32 -Fuforms -Fuwidgetset -Fiinclude -FE. -FUunits/x86_64-linux -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/9 -vw-n-h-l-d-u-t-p-c- -g -gl -dx86_64 alllclunits.pp
Target OS: Linux for x86-64
Compiling alllclunits.pp
Compiling checklst.pas
make: *** [Makefile:3814: lazbuild] Error 2
Compiling lcltype.pp
lcltype.pp(1430,36) Error: Identifier not found "LF_FULLFACESIZE"
lcltype.pp(1430,51) Error: Illegal expression
lcltype.pp(1431,32) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(1431,43) Error: Illegal expression
lcltype.pp(2314,26) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(2314,41) Error: Can't evaluate constant expression
lcltype.pp(2331,26) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(2331,41) Error: Can't evaluate constant expression
lcltype.pp(2378,27) Error: Identifier not found "LF_FULLFACESIZE"
lcltype.pp(2378,46) Error: Can't evaluate constant expression
lcltype.pp(2379,24) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(2379,39) Error: Can't evaluate constant expression
lcltype.pp(2384,27) Error: Identifier not found "LF_FULLFACESIZE"
lcltype.pp(2384,46) Error: Can't evaluate constant expression
lcltype.pp(2385,24) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(2385,39) Error: Can't evaluate constant expression
lcltype.pp(2405,27) Error: Identifier not found "LF_FULLFACESIZE"
lcltype.pp(2405,46) Error: Can't evaluate constant expression
lcltype.pp(2406,24) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(2406,39) Error: Can't evaluate constant expression
lcltype.pp(2407,25) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(2407,40) Error: Can't evaluate constant expression
lcltype.pp(2412,27) Error: Identifier not found "LF_FULLFACESIZE"
lcltype.pp(2412,46) Error: Can't evaluate constant expression
lcltype.pp(2413,24) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(2413,39) Error: Can't evaluate constant expression
lcltype.pp(2414,25) Error: Identifier not found "LF_FACESIZE"
lcltype.pp(2414,40) Error: Can't evaluate constant expression
lcltype.pp(2652,25) Error: String length is larger than array of char length
lcltype.pp(3010,1) Fatal: There were 29 errors compiling module, stopping
Fatal: Compilation aborted
Error: /home/dbannon/Pico2/fpc/bin/x86_64-linux/ppcx64 returned an error exitcode
fpcupdeluxe: ERROR: Lazarus Native Installer (BuildModuleCustom: Lazbuild): make returned exit status #512.


ERROR: Fpcupdeluxe fatal error !
Sequencer (UserIDE): Failure running fpcupdeluxe: error executing sequence UserIDE
Sequencer (Lazarus): Failure running fpcupdeluxe: error executing sequence Lazarus
Sequencer (Only): Failure running fpcupdeluxe: error executing sequence Only
« Last Edit: January 30, 2023, 07:13:58 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

MarkMLl

  • Hero Member
  • *****
  • Posts: 5863
Re: RasPi Pico - needs 'old' FPC ?
« Reply #1 on: January 30, 2023, 08:40:37 am »
The only thing I can usefully say at the moment is that when I looked at this briefly it was Lazarus 2.3.0 which claimed to be using FPC 3.3.1.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10492
  • FPC developer.
Re: RasPi Pico - needs 'old' FPC ?
« Reply #2 on: January 30, 2023, 09:53:31 am »
This can happen with old FPC trunk compilers and newer lazarus sources, or vice versa.

Make sure everything is from this year.

Origin:  some symbols moved from Lazarus to system.uitypes.  Lazarus has been fixed to work with both 3.2.2 and trunk, but assumes trunk is from AFTER the change. (which was in the week before christmas or so)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1594
Re: RasPi Pico - needs 'old' FPC ?
« Reply #3 on: January 30, 2023, 11:36:07 am »
Correct.
Please use a Lazarus with hash 0ae37a90 or earlier.
Add the hash in Setup+, Lazarus hash/tag. I hope this will work.
Sidenote.
This change will be included into fpcupdeluxe, with a new version (to be released).
« Last Edit: January 30, 2023, 11:39:28 am by DonAlfredo »

dbannon

  • Hero Member
  • *****
  • Posts: 2289
    • tomboy-ng, a rewrite of the classic Tomboy
Re: RasPi Pico - needs 'old' FPC ?
« Reply #4 on: January 30, 2023, 11:40:12 am »
Hmm, perhaps I was unclear. The combination of Lazarus Trunk and a FPC forked from FPC3.2.0 does not work. And, honestly, that does not surprise me.

Lazarus Trunk compiles fine with FPC 3.2.2 and the forked FPC will build <= Lazarus Fixes.

What I was asking is if the things that MiR was adding to the FPC fork have made their way into the real FPC Main ? And will be usable in the future ?

If not, I guess we I need to ask if its sensible to plan a project on Pico and FPC. Its OK now but a risk long term.

Davo

EDIT: Our messages crossed, Thanks Don, good to know. But the real question remains, will new releases of FPC work with Pico (ie without using the forked FPC on Michael's git page).
« Last Edit: January 30, 2023, 11:42:46 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

ccrause

  • Hero Member
  • *****
  • Posts: 688
Re: RasPi Pico - needs 'old' FPC ?
« Reply #5 on: January 30, 2023, 12:29:58 pm »
What I was asking is if the things that MiR was adding to the FPC fork have made their way into the real FPC Main ? And will be usable in the future ?
The RP2040 specific patches are not in main yet.  I don't see any patch/MR to support this on Gitlab, hopefully MIR will be so gracious as to extract the necessary patches and submit that to the main repository :-[

dbannon

  • Hero Member
  • *****
  • Posts: 2289
    • tomboy-ng, a rewrite of the classic Tomboy
Re: RasPi Pico - needs 'old' FPC ?
« Reply #6 on: January 30, 2023, 11:23:59 pm »
Thanks ccrause, that is what I suspected.
I will contact MiR and suggest he consider that approach.

And maybe look into any license attached to his modifications ....

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

 

TinyPortal © 2005-2018