Recent

Author Topic: Raspberry Pi Zero W  (Read 2949 times)

amarryat

  • New Member
  • *
  • Posts: 12
Raspberry Pi Zero W
« on: November 20, 2017, 06:06:15 pm »
I am unable to install the version from GetLazarus.org using the setup.sh file they have.

The script fails at lazarus/lazbuild with an EAccessViolation.

I am able to install it using sudo apt-get lazarus.  However that is an older version and there are bugs that my compiled program exhibits because of this.

I was able to install the GetLazarus.org version on the Raspberry Pi Model 3B and it works just fine.  Why is there an EAccessViolation when I'm going the exact same procedure on the Zero W?

BTW, I increased the swap file size to 1024 on the Zero W hoping that would fix things but it had no effect.

avra

  • Hero Member
  • *****
  • Posts: 1687
    • Additional info
Re: Raspberry Pi Zero W
« Reply #1 on: November 21, 2017, 09:51:10 am »
Alternatively you can try fpcupdeluxe:
https://github.com/newpascal/fpcupdeluxe
https://github.com/newpascal/fpcupdeluxe/releases

If you run it on RPi it can download and build Lazarus/FPC for you. If you run it on PC it can help you to build Lazarus/FPC ready to cross compile to RPi. It can coexist with existing Lazarus/FPC on the same machine without problems.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Thaddy

  • Hero Member
  • *****
  • Posts: 8927
Re: Raspberry Pi Zero W
« Reply #2 on: November 21, 2017, 10:04:14 am »
Well I have a zero w and did this:
- install fpc (not lazarus) from debian (stretch!)
- rename ppcarm to ppcarmstart
- sudo make clean all install  LIBGCCDIR=/usr/lib/gcc/arm-linux-gnueabihf/6.3.0 PP=/usr/bin/fpc/3.0.2/ppcarmstart GDBMI=1 
- sudo mv  /home/pi/fpc311/rtl/units/arm-linux/* /usr/local/lib/fpc/3.1.1/units/arm-linux
- sudo cp /home/pi/fpc311/compiler/ppcarm /usr/local/bin

After that:
- create a swap of a least 1 MB
- checkout lazarus
- build lazarus: make all install


Note if you use Jessie the root is /usr/local/bin/fpc
Note if you use Stretch the root is /usr/bin/fpc

After all that I install the docked interface and rebuild with make useride
« Last Edit: November 21, 2017, 10:09:13 am by Thaddy »
Most people that want to use threading should learn to patch their jeans first: use a needle.

amarryat

  • New Member
  • *
  • Posts: 12
Re: Raspberry Pi Zero W
« Reply #3 on: November 21, 2017, 07:31:05 pm »
Alternatively you can try fpcupdeluxe:
https://github.com/newpascal/fpcupdeluxe
https://github.com/newpascal/fpcupdeluxe/releases

If you run it on RPi it can download and build Lazarus/FPC for you. If you run it on PC it can help you to build Lazarus/FPC ready to cross compile to RPi. It can coexist with existing Lazarus/FPC on the same machine without problems.

Thanks.  Tried this and once I ran fpcupdeluxe-arm-linux in the terminal, I got the EAccessViolation immediately.

amarryat

  • New Member
  • *
  • Posts: 12
Re: Raspberry Pi Zero W
« Reply #4 on: November 21, 2017, 07:33:51 pm »
Well I have a zero w and did this:
- install fpc (not lazarus) from debian (stretch!)
- rename ppcarm to ppcarmstart
- sudo make clean all install  LIBGCCDIR=/usr/lib/gcc/arm-linux-gnueabihf/6.3.0 PP=/usr/bin/fpc/3.0.2/ppcarmstart GDBMI=1 
- sudo mv  /home/pi/fpc311/rtl/units/arm-linux/* /usr/local/lib/fpc/3.1.1/units/arm-linux
- sudo cp /home/pi/fpc311/compiler/ppcarm /usr/local/bin

After that:
- create a swap of a least 1 MB
- checkout lazarus
- build lazarus: make all install


Note if you use Jessie the root is /usr/local/bin/fpc
Note if you use Stretch the root is /usr/bin/fpc

After all that I install the docked interface and rebuild with make useride

Thanks for the help, but as someone new to this, I'm not able to follow this.  For example, I did sudo apt-get install fpc and then didn't know how to rename ppcarm.  I assumed you meant the folder, so I tried to navigate to it based on where it should be in your line after that - but I cannot find that folder inside either root location.

avra

  • Hero Member
  • *****
  • Posts: 1687
    • Additional info
Re: Raspberry Pi Zero W
« Reply #5 on: November 21, 2017, 11:20:12 pm »
once I ran fpcupdeluxe-arm-linux in the terminal, I got the EAccessViolation immediately.
Did you download to home subdir or elsewhere? Tried with sudo?

Also execute this:
Code: Pascal  [Select]
  1. sudo aptitude install make binutils build-essential gdb subversion zip unzip libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

amarryat

  • New Member
  • *
  • Posts: 12
Re: Raspberry Pi Zero W
« Reply #6 on: November 22, 2017, 05:09:39 pm »
once I ran fpcupdeluxe-arm-linux in the terminal, I got the EAccessViolation immediately.
Did you download to home subdir or elsewhere? Tried with sudo?

Also execute this:
Code: Pascal  [Select]
  1. sudo aptitude install make binutils build-essential gdb subversion zip unzip libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev

I used Chromium and it downloaded to the Downloads folder.  I ran what you posted above, and it did update a few things.  Most of it was already installed though. 


From the Downloads folder, I ran this and here's the result:

sudo ./fpcupdeluxe-arm-linux
An unhandled exception occurred at $00026080:
EAccessViolation: Access violation
  $00026080

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1122
Re: Raspberry Pi Zero W
« Reply #7 on: November 22, 2017, 05:38:23 pm »
The arm version of fpcupdeluxe is made for ARMV7 with a Linux hardfloat.

I guess the Zero has an ARMV6.
Please tell me if you run a hard- or softfloat distro on your Zero.
(most likely soft)

If I know your system-details, I can try to build an ARMV6 version of fpcupdeluxe.

amarryat

  • New Member
  • *
  • Posts: 12
Re: Raspberry Pi Zero W
« Reply #8 on: November 22, 2017, 05:43:44 pm »
The arm version of fpcupdeluxe is made for ARMV7 with a Linux hardfloat.

I guess the Zero has an ARMV6.
Please tell me if you run a hard- or softfloat distro on your Zero.
(most likely soft)

If I know your system-details, I can try to build an ARMV6 version of fpcupdeluxe.

I have no idea what hard or soft float is.  However it is armv6.  I'm assuming the same as the older Pi's since this is a single core processor.

Edit - just Googled and and ran:

dpkg --print-architecture

and it returns armhf which means ARM Hard Float.

sudo apt-get install lazarus works.  It's just the 1.6.2 version and the docking won't work on that.  When you try to install the two packages, it can't find something and fails.

pi@raspberrypi:~/Downloads $ lscpu
Architecture:          armv6l
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
Model:                 7
Model name:            ARMv6-compatible processor rev 7 (v6l)
CPU max MHz:           1000.0000
CPU min MHz:           700.0000
BogoMIPS:              697.95
Flags:                 half thumb fastmult vfp edsp java tls
« Last Edit: November 22, 2017, 05:50:34 pm by amarryat »