problems with PRU on BBB with Angstrom 2013-06-06

[sorry for the crosspost---I was told this is the right group]

I have a problem with the am335x_pru_package on my BBB with the latest
load of Angstrom BBB-eMMC-flasher-2013.06.06.img that I downloaded
from the website and burned to the eMMC.

The OS runs fine and I can SSH to it, but the uio_pruss module doesn't
work---even Jacek's script fails because it can't write the magic
'cape-bone-nixie' string to the slots file.

The write syscall fails. I thought maybe it's a problem with shell
noclobber, so I wrote a file /tmp/x with the magic string
"cape-bone-nixie\n", and cp it to /sys/devices/bone_capemgr.9/slots.
This is what happens:

open("/sys/devices/bone_capemgr.9/slots", O_WRONLY|O_TRUNC|O_LARGEFILE) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0
read(3, "cape-bone-nixie\n", 32768) = 16
write(4, "cape-bone-nixie\n", 16) = -1 EEXIST (File exists)

It doesn't seem to be related to permissions (file is rw for owner root).

How does one successfully load the uio_pruss module in this version?

What is the kernel version? I've just tested examples from the pru
package and they work fine with today's kernel.
Try to run "opkg update; opkg upgrade" and check again. You may want
to unmount /tmp for the upgrade, it may overflow when there are many
packages to download.

j.

What other capes do you have loaded according to:

  cat /sys/devices/bone_capemgr.*/slots

In addition to the PRU, it looks like the nixie overlay is trying to use
PWM and some GPIO pins. If any of these resources were allocated
previously to other capes (including the 'virtual' on-board HDMI and
eMMC capes) you get the "file exists" error you describe and you are
unable to "write" the slots file.

- --
Charles Steinkuehler
charles@steinkuehler.net

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

root@beaglebone:~# uname -a
Linux beaglebone 3.8.13 #1 SMP Wed Jun 5 11:21:00 CEST 2013 armv7l GNU/Linux

I did a successful opkg update; opkg upgrade (still the same kernel
after the upgrade)---this did not improve things.

Looking at /lib/firmware/cape-boneblack-hdmi-00A0.dts claims exclusive
use of P9.25, P8.45, P8.46, P9.31, P9.29 and P8.45 and P8.45, which
are also used by bone-cape-nixie; is that what causes the conflict?

Pantelis' 3.8 kernel document
https://docs.google.com/document/d/17P54kZkZO_-JtTjrFuVz-Cp_RMMg7GB_8W9JK9sLKfA/pub
seems to claim that capes have priority over onboard peripherals...

Try to disable HDMI and then apply the nixie overlay.

j.

Looking at /lib/firmware/cape-boneblack-hdmi-00A0.dts claims
exclusive use of P9.25, P8.45, P8.46, P9.31, P9.29 and P8.45 and
P8.45, which are also used by bone-cape-nixie; is that what causes
the conflict?

Almost certainly, yes.

Pantelis' 3.8 kernel document
Beaglebone and the 3.8 Kernel

seems to claim that capes have priority over onboard peripherals...

Perhaps if your cape has an EEPROM and a _supported_ overlay.

The only cape I have with an EEPROM is the BeBoPr board, and it's not
officially supported. I have to disable loading the HDMI and eMMC
drivers using the capemgr.disable_partno command line option or I
cannot load the overlay for the BeBoPr.

- --
Charles Steinkuehler
charles@steinkuehler.net

I see---the HDMI cape has the magic L (5: ff:P-O-L Bone-Black-HDMI)

I see a method that involves turning it off via boot-time kernel commandline:
http://circuitco.com/support/index.php?title=Weather_Cape_Work-Around

There really isn't any way to do it at runtime?

BTW, it occurred to me that since previously one _could_ install it,
perhaps that's also the problem with the PRUSS module: it only gets in
randomly because checks that should have blocked it, failed---and the
real solution is to figure out the underlying resouce conflict.

To conclude this thread, I am happy to report that I got everything to
work again.

First of all, the uEnv.txt changes are required but as the others
noted, /boot/uEnv.txt isn't actually used in Angstrom--I mounted the
first eMMC partition and edited the file there, disabling both the
HDMI and HDMIN (no sound) capes. That disabled them, and Jacek's
script successfully loads uio_pruss. A simple 'modprobe uio_pruss'
still does not work, though.

Works for me :smiley:

uname -a: Linux beaglebone 3.8.13 #1 SMP Tue Jun 18 02:11:09 EDT 2013
armv7l GNU/Linux
opkg list kernel: kernel - 3.8.13-r23a.22 - linux-mainline version 3.8.13-r23a

j.