beagleboard / am335x_pru_package

331 stars 181 forks source link

Linking error when attempting to run example app #24

Closed MantisClone closed 10 years ago

MantisClone commented 10 years ago

I ran the following code:

 cd am335x_pru_package/pru_sw/app_loader/interface
 CROSS_COMPILE="" make
 cd ../../utils/pasm_source
 ./linuxbuild
 mv ../../utils/pasm ../../utils/pasm_2
 cd ../../example_apps/
 CROSS_COMPILE="" make
 echo BB-BONE-PRU-01 > /sys/devices/bone_capemgr.8/slots
 modprobe uio_pruss
 cd bin
 ./PRU_memAccess_DDR_PRUsharedRAM

and on the last command I'm seeing the following linking error and I have no idea how to deal with it.

root@beaglebone:~/am335x_pru_package/pru_sw/example_apps/bin# ./PRU_memAccess_DDR_PRUsharedRAM
./PRU_memAccess_DDR_PRUsharedRAM: error while loading shared libraries: libprussdrv.so: cannot open shared object file: No such file or directory
root@beaglebone:~/am335x_pru_package/pru_sw/example_apps/bin#

And Yes, my PRU is enabled:

root@beaglebone:~/am335x_pru_package/pru_sw/example_apps/bin# cat /sys/devices/bone_capemgr.8/slots
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BeagleG
 8: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-PRU-01
root@beaglebone:~/am335x_pru_package/pru_sw/example_apps/bin#
fhunleth commented 10 years ago

My setup is different from yours so I can't give you an exact answer, but your problem is just that libprussdrv.so isn't in the shared library search path. You can either copy libprussdrv.so to /usr/lib or set your LD_LIBRARY_PATH to point to its location.

MantisClone commented 10 years ago

Thank you! That worked.

olsonse commented 10 years ago

I had actually meant to change the examples to link to the prussdrv lib statically... The so was mainly added for the Python support.