DTO and GPIO output error

I am trying to run the example blinkled project shown at https://github.com/BestFriendofDoug/PRUSS-C/tree/master/am335x_pru_package/pru_sw/app_loader/lib but I am not getting any output to the GPIO pins. I have set up the dto to output P9.12, and the blinkled.c is using StarterWare programs to toggle P9.12, but there is no output to the pins when the program runs.

The git repo should have everything you need. I occasionally get the below error:
./blinkled

INFO: Starting PRU_memAccess_DDR_PRUsharedRAM example.
INFO: Initializing example.
./blinkled: symbol lookup error: ./blinkled: undefined symbol: prussdrv_load_datafile

Which was solved for me when re-running the Makefile in /root/PRUSS-C/am335x_pru_package/app_loader/interface

Any help on this issue would be appreciated!!

That URL doesn’t point to the source code. Can you simplify the step-by-step a bit further.

I’m curious if http://sourceforge.net/projects/prudebug/ would help know that your code is properly loaded and running.

Here is a link to the readme, which details how to download the repo and execute it: https://github.com/BestFriendofDoug/PRUSS-C

For some reason, the prudebug is not recognizing the executable, even after I downloaded and untar-ed the file see error below:

root@beaglebone:~/prudebug-0.25# ls -l
total 184
-rw-r–r-- 1 debian debian 8698 Mar 8 2014 cmd.c
-rw-r–r-- 1 root debian 1591 Mar 8 2014 cmdinput.c
-rw-r–r-- 1 root root 2264 Mar 8 2014 cmdinput.o
-rw-r–r-- 1 debian debian 10512 Mar 8 2014 cmd.o
-rw-r–r-- 1 debian debian 7302 Mar 8 2014 da.c
-rw-r–r-- 1 root root 8120 Mar 8 2014 da.o
-rw-r–r-- 1 debian debian 1510 Mar 8 2014 LICENSE
-rw-r–r-- 1 debian debian 136 Mar 8 2014 Makefile
-rw-r–r-- 1 debian debian 6176 Mar 8 2014 printhelp.c
-rw-r–r-- 1 debian debian 8484 Mar 8 2014 printhelp.o
-rw-r–r-- 1 debian debian 16769 Mar 8 2014 prudbg.c
-rw-r–r-- 1 debian debian 2607 Mar 8 2014 prudbg.h
-rw-r–r-- 1 root root 13240 Mar 8 2014 prudbg.o
-rwxr-xr-x 1 root root 41276 Mar 8 2014 prudebug
-rw-r–r-- 1 debian debian 9495 Mar 8 2014 README
-rw-r–r-- 1 debian debian 1238 Mar 8 2014 uio.c
-rw-r–r-- 1 debian debian 549 Mar 8 2014 uio.h
-rw-r–r-- 1 root root 2016 Mar 8 2014 uio.o
root@beaglebone:~/prudebug-0.25# sudo ./prudebug
sudo: unable to execute ./prudebug: No such file or directory

A possible and likely cause of this problem is that you are compiling for dynamic linking with the c libraries at run time, and the version of the c library you compiled against, and the c library you are trying to link against at run time, are different and non-compatible. This is a possible problem when cross-compiling.

What version of glibc.so are you compiling with? (The one in your cross-compiler host.)
What version of glibc.so are you trying to dynamically link with at run time? (The one in your BBB.)

Either you need to get the libraries to match, or at least be compatible, or include the compiler libraries as hard linked inside the executable. This will cause your executable to swell up in size, but will guarantee that the c libraries match.

— Graham

I checked the host and BBB and they are as follows:

host:
root@eng-linux-01:/usr/share/ti/cgt-pru/lib# ldd --version
ldd (Ubuntu EGLIBC 2.15-0ubuntu10.5) 2.15
Copyright © 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

root@beaglebone:/usr/share/ti/cgt-pru/lib# ldd --version
ldd (Debian EGLIBC 2.13-38+deb7u4) 2.13
Copyright © 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

So BBB is version 2.13 and host linux is 2.15. I was going to update both versions to 2.19, but when I tried to update on BBB the changes didn’t seem to hold. I performed the below commands:

echo "deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update
apt-get -t sid install libc6 libc6-dev libc6-dbg

and everything ran smoothly, had to restart cron and apache2 for the new libc, (see below for the last few printouts of the install)
Unpacking replacement libc6:armhf ...
Processing triggers for man-db ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up libc6:armhf (2.19-15) ...
Checking for services that may need to be restarted...
Checking init scripts...

Restarting services possibly affected by the upgrade:
  cron: restarting...done.
  apache2: restarting...done.

Services restarted successfully.
Selecting previously unselected package libc6-dbg:armhf.
(Reading database ... 53831 files and directories currently installed.)
Unpacking libc6-dbg:armhf (from .../libc6-dbg_2.19-15_armhf.deb) ...
Setting up libc-dev-bin (2.19-15) ...
Setting up libc6-dev:armhf (2.19-15) ...
Setting up libc6-dbg:armhf (2.19-15) ...

but then I checked the libc.a version again and it was still 2.13

root@beaglebone:/usr/share# ldd --version
ldd (Debian EGLIBC 2.13-38+deb7u4) 2.13

So I’m not sure what I’m doing wrong there. I may need to include the compiler libraries as hard linked inside the executable, if this doesn’t work

I checked the host and BBB and they are as follows:

host:
root@eng-linux-01:/usr/share/ti/cgt-pru/lib# ldd --version
ldd (Ubuntu EGLIBC 2.15-0ubuntu10.5) 2.15
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

root@beaglebone:/usr/share/ti/cgt-pru/lib# ldd --version
ldd (Debian EGLIBC 2.13-38+deb7u4) 2.13
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

So BBB is version 2.13 and host linux is 2.15. I was going to update both
versions to 2.19, but when I tried to update on BBB the changes didn't seem
to hold. I performed the below commands:

echo "deb Index of /debian sid main" >> /etc/apt/sources.list
apt-get update
apt-get -t sid install libc6 libc6-dev libc6-dbg

and everything ran smoothly, had to restart cron and apache2 for the new
libc, (see below for the last few printouts of the install)
Unpacking replacement libc6:armhf ...
Processing triggers for man-db ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up libc6:armhf (2.19-15) ...
Checking for services that may need to be restarted...
Checking init scripts...

Restarting services possibly affected by the upgrade:
  cron: restarting...done.
  apache2: restarting...done.

Services restarted successfully.
Selecting previously unselected package libc6-dbg:armhf.
(Reading database ... 53831 files and directories currently installed.)
Unpacking libc6-dbg:armhf (from .../libc6-dbg_2.19-15_armhf.deb) ...
Setting up libc-dev-bin (2.19-15) ...
Setting up libc6-dev:armhf (2.19-15) ...
Setting up libc6-dbg:armhf (2.19-15) ...

but then I checked the libc.a version again and it was still 2.13

root@beaglebone:/usr/share# ldd --version
ldd (Debian EGLIBC 2.13-38+deb7u4) 2.13

ldd comes from:
https://packages.debian.org/wheezy/libc-bin

So I'm not sure what I'm doing wrong there. I may need to include the
compiler libraries as hard linked inside the executable, if this doesn't
work

Btw, instead of hacking up a wheezy image, with sid binaries, just use
a jessie snapshot instead:

http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Jessie_Snapshot

As we are about a month away from jessie's release..

Regards,

I agree with Robert.

Debian 8, including the jessie snapshots come with glibc 2.19 installed.

The library used by the current GCC compiler is 2.19.

— Graham

Is the Jessie snapshot similar to flashing an image? Is there documentation on what it comes with? I will be running programs in the future that may have specific

Great I’ll get that up and running then

Exactly the same... microSD/Standalone & Flasher images..

Regards,

I flashed the Jessie snapshot to my beaglebone, and got the updated (2.19) glibc files, but I can’t find the bone_capemgr.* directory to enable a device tree? Does that come with the Jessie snapshot? Let me know, thanks!

Downgrade to v3.8.x:

sudo apt-get update ; sudo apt-get install linux-image-3.8.13-bone71 ;
sudo reboot

Regards,

got it downgraded, bone_capemgr.* directories available and uio_pruss module available. Unfortunately, ran the blinkled program with the updated BBB glibc and still no output to the pins. The cross compilation specs are as follows: glibc 2.15 for the linux machine, and glibe 2.19 for the BBB, so they should be compatible. Any further thoughts on why this is not putting out to the pins?

  1. Open the Makefile in the prudebug-0.25 folder
  2. Modify the CC variable to ‘gcc’
  3. Save and close the Makefile
  4. run the command ‘make --always-make’

Makefile was created for compilation from another system to a specific arm gcc implementation, when setting it as gcc, it will run with whatever native compiler is registered on your system (BBB has the arm-linux-gnuabihf-gcc) . Also, we need to force the rebuild of the binaries because the developer included the executables in the download so the make utility will not rebuild binaries unless forced.