libpruio with recent Debian on BBB?

Can I use libpruio on a BBB with a recent (3.14.33-ti-rXX) kernel?

If so, how do I go about loading libpruio-0A00.dtbo without capemgr?

Thanks,

Brandon

Right now the best thing to do is still downgrade to the 3.8 kernel,
which is in the repo..

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

Regards,

OK, cool. I'll do that.

What's the most likely path in the future? I think I heard something about
capemgr getting ported to 3.19.x, but with some new structure?

Cheers,
Brandon

Right now the best thing to do is still downgrade to the 3.8 kernel,
which is in the repo..

OK, cool. I'll do that.
Downgrading to 3.8.13-bone70 worked, and libpruio seems to work, but not
exactly the way I would expect.

When I try to load libpruio, this happens:

    sudo echo libpruio > /sys/devices/bone_capemgr.9/slots
    echo: write error: No such file or directory

Here's what appears in dmesg:

[ 199.719576] bone-capemgr bone_capemgr.9: part_number 'libpruio', version
'N/A'
[ 199.719757] bone-capemgr bone_capemgr.9: slot #8: generic override
[ 199.719802] bone-capemgr bone_capemgr.9: bone: Using override eeprom
data at slot 8
[ 199.719849] bone-capemgr bone_capemgr.9: slot #8: 'Override Board
Name,00A0,Override Manuf,libpruio'
[ 199.726206] bone-capemgr bone_capemgr.9: slot #8: Requesting part
number/version based 'libpruio-00A0.dtbo
[ 199.726269] bone-capemgr bone_capemgr.9: slot #8: Requesting firmware
'libpruio-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 199.750455] bone-capemgr bone_capemgr.9: failed to load firmware
'libpruio-00A0.dtbo'

The libpruio installation instructions (
http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/_cha_preparation.html)
say that you can also do this:

    sudo echo BB-BONE-PRU-01 > /sys/devices/bone_capemgr.*/slots

This makes this appear in dmesg:

[ 216.578880] bone-capemgr bone_capemgr.9: part_number 'BB-BONE-PRU-01',
version 'N/A'
[ 216.579067] bone-capemgr bone_capemgr.9: slot #9: generic override
[ 216.579112] bone-capemgr bone_capemgr.9: bone: Using override eeprom
data at slot 9
[ 216.579159] bone-capemgr bone_capemgr.9: slot #9: 'Override Board
Name,00A0,Override Manuf,BB-BONE-PRU-01'
[ 216.579411] bone-capemgr bone_capemgr.9: slot #9: Requesting part
number/version based 'BB-BONE-PRU-01-00A0.dtbo
[ 216.579459] bone-capemgr bone_capemgr.9: slot #9: Requesting firmware
'BB-BONE-PRU-01-00A0.dtbo' for board-name 'Override Board Name', version
'00A0'
[ 216.579519] bone-capemgr bone_capemgr.9: slot #9: dtbo
'BB-BONE-PRU-01-00A0.dtbo' loaded; converting to live tree
[ 216.586296] bone-capemgr bone_capemgr.9: slot #9: #2 overlays
[ 216.608605] omap_hwmod: pruss: failed to hardreset
[ 216.625429] bone-capemgr bone_capemgr.9: slot #9: Applied #2 overlays.

The "failed to hardreset" is mildly alarming, but afterwards, uio_pruss
appears in lsmod and the first example works:

sudo src/examples/1
FA40 EE00 EF20 E700 DC70 D680 DA30 EEF0
F3B0 EE50 EF30 E680 DB60 D8B0 D690 EE90
F390 EE00 EF10 E780 DF40 D950 D760 EEC0
F3B0 EEB0 EF90 E7A0 DF00 DE00 D800 EEB0
F350 EE90 EF80 E710 DDB0 DCE0 D7D0 EEC0
F350 EEB0 EFF0 E7C0 DE30 D8C0 D900 EEC0
F400 EE50 EF30 E6B0 DD50 D970 D8D0 EF00
F3E0 EE50 EEF0 E720 DEC0 DD00 DA40 EEB0
F370 EE30 EF20 E720 DC60 DC30 DA10 EEA0
F3C0 EDC0 EF20 E730 E020 DB50 D780 EEC0
F3A0 ED90 EF10 E800 DF80 DD70 D6E0 EEF0
F340 EE90 EFD0 E730 DD10 DA30 D7F0 EEB0
F3D0 EF20 F000 E710 DE10 DAF0 DA90 EED0

I'm not sure why the first method failed while the second worked, but I'll
take it. Hopefully this will be useful to someone else out there. Few more
details at
https://github.com/pingswept/dev-log/blob/master/2015-03-libpruio-on-bbb.markdown

Thanks for the direction, Robert.

Brandon

This is why…

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

But I executed sudo echo libpruio > /sys/devices/bone_capemgr.9/slots as root, not a normal user. Does that make sense?

And if privileged echo were the cause, wouldn’t the second command, sudo echo BB-BONE-PRU-01 > /sys/devices/bone_capemgr.*/slots be affected as well?

Brandon

Actually it makes less sense, you know what sudo does right? Calling it as root is totally redundant.

Right, that’s what I thought. So the mystery of why the error occurs remains.

Brandon

Nope, it doesn't. It's easy to get confused about the context, though:
are you sure you were at root? What did the 'id' command say?

That's why I sometimes do sudo bash before a substantial session that
requires root privileges, to get a temporary root shell.

Yeah, I’m root, unfortunately:

➜ ~ id
uid=0(root) gid=0(root) groups=0(root)

So back to the issue, have you checked to see why the kernel didn't load it?

dmesg | grep cape

Regards,

@Brandon,

when you use BB-BONE-PRU-01 overlay you won’t have run-time pinmuxing capability.

Ah, I had noticed the 0A00 difference, but I assumed it was intentional! Should have figured that out.

I’ll give it a try on Monday. Thanks for the response.

Brandon

Just an update; yes, the .dtbo file was misnamed.

After renaming the file:

cp /lib/firmware/libpruio-0A00.dtbo /lib/firmware/libpruio-00A0.dtbo

I was able to execute:

sudo echo libpruio > /sys/devices/bone_capemgr.9/slots

That produced this in dmesg:

[ 796.178041] bone-capemgr bone_capemgr.9: part_number ‘libpruio’, version ‘N/A’
[ 796.178221] bone-capemgr bone_capemgr.9: slot #7: generic override
[ 796.178264] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 7
[ 796.178311] bone-capemgr bone_capemgr.9: slot #7: ‘Override Board Name,00A0,Override Manuf,libpruio’
[ 796.184663] bone-capemgr bone_capemgr.9: slot #7: Requesting part number/version based 'libpruio-00A0.dtbo
[ 796.184728] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware ‘libpruio-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 796.191902] bone-capemgr bone_capemgr.9: slot #7: dtbo ‘libpruio-00A0.dtbo’ loaded; converting to live tree
[ 796.320640] bone-capemgr bone_capemgr.9: slot #7: #3 overlays
[ 796.652764] omap_hwmod: pruss: failed to hardreset
[ 796.669190] bone-capemgr bone_capemgr.9: slot #7: Applied #3 overlays.
[ 796.745317] pruss_uio 4a300000.pruss: pins are not configured from the driver

After this, the analog pins worked as expected:

➜ libpruio-0.2 sudo src/examples/1
F6A0 ED00 ED10 E5D0 DD20 DA70 D580 EEB0
F310 EDB0 EE40 E690 DF10 D770 D5B0 EEF0
F280 ED10 ECE0 E5E0 DE40 D840 D8C0 EEC0
F2F0 EC80 ED40 E5C0 DCA0 DBC0 D910 EEA0
F290 ED10 ED60 E5D0 DCD0 D790 D5D0 EE70
F260 ED00 EDA0 E5B0 DD60 D860 D9B0 EEB0
F360 ED70 EE40 E680 DD80 DDF0 DA70 EEE0
F340 ED20 EDE0 E640 DC40 D820 DA20 EEB0
F2D0 EDA0 EDA0 E540 DB20 D870 D7B0 EEB0
F2D0 EDA0 EE30 E650 DE20 DBE0 D950 EEF0
F2B0 ED40 ED80 E550 DC40 DC70 D750 EEB0
F2A0 EDD0 EDF0 E690 DE10 D7D0 D5E0 EEE0
F2A0 ED50 EDF0 E6B0 DE20 D720 D6A0 EEC0

Thanks for the help,

Brandon

Thanks for feedback, Brandon.

I was able to execute:

sudo echo libpruio > /sys/devices/bone_capemgr.9/slots

That produced this in dmesg:

[ 796.652764] omap_hwmod: pruss: failed to hardreset

I also get this message here, but it works for me. (It seems that some driver programmers learned to output error messages at m$.)

After this, the analog pins worked as expected:

ADC always works, no matter which overlay you used to switch the PRUSS on. The question is: can you execute examples with run-time pinmuxing, like button or stepper?

BR

Hi TJF,

It seems that I got excited too soon.

If I load libpruio-00A0.dtbo like this (as root):

echo libpruio > /sys/devices/bone_capemgr.9/slots

the overlay appears to load, but the pins are not configured. Here’s what shows up in dmesg:

[ 136.836467] bone-capemgr bone_capemgr.9: part_number ‘libpruio’, version ‘N/A’
[ 136.836647] bone-capemgr bone_capemgr.9: slot #7: generic override
[ 136.836691] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 7
[ 136.836738] bone-capemgr bone_capemgr.9: slot #7: ‘Override Board Name,00A0,Override Manuf,libpruio’
[ 136.836990] bone-capemgr bone_capemgr.9: slot #7: Requesting part number/version based 'libpruio-00A0.dtbo
[ 136.837037] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware ‘libpruio-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 136.849312] bone-capemgr bone_capemgr.9: slot #7: dtbo ‘libpruio-00A0.dtbo’ loaded; converting to live tree
[ 136.976389] bone-capemgr bone_capemgr.9: slot #7: #3 overlays
[ 137.311770] omap_hwmod: pruss: failed to hardreset
[ 137.328365] pruss_uio 4a300000.pruss: pins are not configured from the driver
[ 137.335639] bone-capemgr bone_capemgr.9: slot #7: Applied #3 overlays.

Subsequently, the ADC works as before, but the button example fails:

➜ libpruio-0.2 sudo src/examples/button
1
sh: echo: I/O error
pin re-configuration failed (pinmux failed: P8_07 → x7F)
press any key to quit

Any suggestions about how to proceed from here? Is it a problem with the uio_pruss module? Or with libpruio?

Brandon

Hi Brandon.

Ah, excellent. I just retested this, and you are exactly correct.

I will await the next release for the pin config stuff.

Thanks!

Brandon