For instructions on fixing the bug, look in the appendix at the bottom of the page
So I’m hacking away on the Replicape, trying to figure out why the print stops just after the first layer when run through the PRU. I’m debugging left right and centre when it starts to dawn on me that perhaps the problem is not a part of my code at all.. You know that feeling? Someone else has made a boo boo!
In this case it was the prussdrv that was the culprit. I noticed that it sent more events than what was actually occurring. This bug has been documented before on the TI e2e forum, but there is no official support for BeagleBone so I guess that’s why no one has picked up on it:
The guy who sent in the bug also attached a patch! The PyPRUSS library has now been patched up and so for anyone relying on events from the PRU to pace their work, this should work much better!
In aiding me in the persuit of this bug I have found a couple of good resources. First, the uio_pruss.c source code on line:
And secondly a very nice howto on userspace I/O drivers:
The PyPRUSS library has now been updated to include this change. To update, simply go to the PyPRUSS folder and do a
followed by a
python setyp.py install
Appendix A: Compiling the prussdrv library as a shared object
A precompiled version is available here: libprussdrv.so. It goes in /usr/local/lib/
The PyPRUSS library requires a dynamically linked version of the pruss firmware loader.
This is mostly for documentation purposes, so I can forget about it with a clear conscience. Tkae note that the
git clone git://github.com/beagleboard/am335x_pru_package.git cd am335x_pru_package
Jason Krinder has responded to this bug which is great, but for now it needs to be patched manually:
wget http://e2e.ti.com/cfs-file.ashx/__key/telligent-evolution-components-attachments/00-791-00-00-00-23-97-35/attachments.tar.gz tar -xzf attachments.tar.gz patch -p1 < 0001-Fix-for-duplicated-interrupts-when-interrupts-are-se.patch
Move to the right dir:
gcc -I. -Wall -I../include -c -fPIC -O3 -mtune=cortex-a8 -march=armv7-a -shared -o prussdrv.o prussdrv.c
And then link:
gcc -shared -o libprussdrv.so prussdrv.o