Recent

Author Topic: Lazarus / RaspberyPi Hardware Library  (Read 74992 times)

Pelican

  • New member
  • *
  • Posts: 5
Re: Lazarus / RaspberyPi Hardware Library
« Reply #45 on: May 26, 2015, 01:40:31 am »
I've downloaded the unit a year ago and it worked on the older Pis but now I have a Pi 2 which needs the new version of the wiringPi but when I try to build any program using that new object files the linker gives me the following error messages:

Code: [Select]
/usr/bin/ld.bfd: wiringPi.o undefined reference to symbol '__aeabi_idiv@@GCC3.5'
//lib/arm-linux-gnueabihf/libgcc_s.so.1: error adding symbols: DSO missing from command line

If I link the lazwiringpi's object file then no error but the gpio function doesn't work.
Could you help me how can I solve this linker issue?
I tried to make the object files by myself - no change.

wiringPi 2.25
Lazarus 0.9.30.4-6

I added to the wrapper more functions in wiringPi (and the spi, i2c and serial functions too) send me an email if you want the sources.

Edit:
I think this is a similar problem, but I have no idea how could I fix this.
http://glandium.org/blog/?p=2510
« Last Edit: May 29, 2015, 12:53:37 pm by Pelican »

Pelican

  • New member
  • *
  • Posts: 5
Re: Lazarus / RaspberyPi Hardware Library
« Reply #46 on: June 14, 2015, 09:34:21 am »
I've updated my Lazarus to v1.5 and fpc to the latest but the problem is still there, cannot compile any code which use the wiringPi.o.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1345
Re: Lazarus / RaspberyPi Hardware Library
« Reply #47 on: June 14, 2015, 09:50:07 am »
Try to add this to the compiler options when compiling for RPi2:
Code: [Select]
-dFPC_ARMHF -CpARMV7A -CaEABIHF -CfVFPv3 -OoFASTMATH
if you use hardfloat for RPi2.

Pelican

  • New member
  • *
  • Posts: 5
Re: Lazarus / RaspberyPi Hardware Library
« Reply #48 on: June 15, 2015, 06:11:05 pm »
Hi,

Thank you for your reply.
I tried to put those to the Project options/Compilation and Linking/Linking/pass to linker...
I've got unrecognized option warning for these options: -CpARMV7A -CaEABIHF -CfVFPv3
I removed them and got a new error message: Error while linking

« Last Edit: June 15, 2015, 06:46:34 pm by Pelican »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1345
Re: Lazarus / RaspberyPi Hardware Library
« Reply #49 on: June 15, 2015, 07:01:00 pm »
Could it be that you have a compiler that does not support hardfloat ?
I presume you need hardfloat due to the info in your post:
Code: [Select]
//lib/arm-linux-gnueabihf/libgcc_s.so.1: error adding symbols: DSO missing from command line
If your compiler does hardfloat, it would support the instructions I gave you.
So, check your compiler would be my advice !

Pelican

  • New member
  • *
  • Posts: 5
Re: Lazarus / RaspberyPi Hardware Library
« Reply #50 on: June 15, 2015, 10:54:36 pm »
This is the compiler: Free Pascal Compiler version 3.1.1 [2015/05/28] for arm
Based on it's help it supports all of the options you gave but I put all those to the linker's option...  :o
How can I give these option to the compiler?
I tried to put Project options/Compiler options/Additions and overrides/Custom and got this error message>

Code: [Select]
Compile Project, Target: homeserver: Exit code 256, Errors: 1, Warnings: 2, Hints: 1
main.pas(8,79) Hint: Unit "wiringPi" not used in Main
homeserver.lpr(21,0) Warning: "crtbegin.o" not found, this will probably cause a linking failure
homeserver.lpr(21,0) Warning: "crtend.o" not found, this will probably cause a linking failure
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
/usr/bin/ld: /home/pi/projects/homeserver/wiringPi.o: undefined reference to symbol '__aeabi_idiv@@GCC_3.5'
//lib/arm-linux-gnueabihf/libgcc_s.so.1: error adding symbols: DSO missing from command line
[8.977] Executing "/usr/bin/ld" with command line "  --dynamic-linker=/lib/ld-linux-armhf.so.3    -L. -o homeserver link.res"
homeserver.lpr(21,0) Error: Error while linking

Edit:

Anyway, I tried the h2wiringpi from the previous page and it seems it's working...

The
{$linklib libwiringPi}
just did the trick.
« Last Edit: June 16, 2015, 12:15:06 am by Pelican »

lazaursrotton

  • Newbie
  • Posts: 3

lazaursrotton

  • Newbie
  • Posts: 3

Pelican

  • New member
  • *
  • Posts: 5
Re: Lazarus / RaspberyPi Hardware Library
« Reply #53 on: June 18, 2015, 11:07:02 pm »
I've put SPI, I2C, serial and other functions to it.
http://pel.hu/down/libwiringpi.pas

kaptindan

  • Newbie
  • Posts: 2
Re: Lazarus / RaspberyPi 2 model B Hardware Library
« Reply #54 on: February 15, 2016, 03:53:43 pm »
Hello, newbe here! I've been working with the Raspberry Pi 2 Model B and trying to access the GPIO....no luck so far using h2wiringPi...any ideas?????

 

TinyPortal © 2005-2018