Error with SPI and universal-cape

142 views
Skip to first unread message

El Smiedro

unread,
Jun 29, 2016, 6:57:49 AM6/29/16
to BeagleBoard

Hi everyone,

obviously it is a little newbie-problem, but after hours of searching and trying I didnt get it to work.

root@beaglebone:~# uname -a
Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux

I have a little project, and I would like to run a dogm-204a-display with the BBB over SPI and python. When I run the following line...

root@beaglebone:~# config-pin -f owncape2.bbio
 overlaycape-universaln
Invalid mode: default
root@beaglebone:~# cat /sys/devices/bone_capemgr.*/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-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-universaln


everything runs without an error. Then I'm trying to run spidev in python, and get the following error:

root@beaglebone:~# python
Python 2.7.3 (default, Jun 21 2016, 21:00:47)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from bbio import*
PyBBIO initialized
>>> SPI1.begin()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/bbio/platform/beaglebone/spi.py", line 38, in begin
    self.open()
  File "/usr/local/lib/python2.7/dist-packages/bbio/platform/beaglebone/spi.py", line 18, in open
    cape_manager.load(overlay, auto_unload=False)
  File "/usr/local/lib/python2.7/dist-packages/bbio/platform/beaglebone/cape_manager.py", line 27, in load
    f.write(overlay)
IOError: [Errno 17] File exists
>>>

----------------------------------------------------------------------------------------------------------------------------------------------------------

When I try the other way:

debian@beaglebone:~$ sudo -i
root@beaglebone:~# cat /sys/devices/bone_capemgr.*/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-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
root@beaglebone:~# python
Python 2.7.3 (default, Jun 21 2016, 21:00:47)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from bbio import*
PyBBIO initialized
>>> SPI1.begin()
>>>
Finished PyBBIO cleanup
root@beaglebone:~# cat /sys/devices/bone_capemgr.*/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-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPIDEV1
root@beaglebone:~# config-pin -f owncape2.bbio
 overlaycape-universaln
bash: line 0: echo: write error: File exists
Error loading device tree overlay file: cape-universaln
root@beaglebone:~#


I get an error by loading cape-universaln. Obviously the two capes are in a conflict with each other, but I cant find a way how to configure them.
Thank you very much for your help

Charles Steinkuehler

unread,
Jun 29, 2016, 11:52:24 AM6/29/16
to beagl...@googlegroups.com
On 6/29/2016 5:57 AM, 'El Smiedro' via BeagleBoard wrote:
>
> I get an error by loading cape-universaln. Obviously the two capes are in a
> conflict with each other, but I cant find a way how to configure them.
> Thank you very much for |your help|

The universal overlay already loads the SPI driver, but apparently
your PyBBIO is trying to load it's own overlay as well. You can
either disable the PyBBIO overlay loading and let the SPI get setup by
the universal overly, or craft a custom device tree for whatever
specific pins your cape needs that doesn't overlap with the SPI pins.

--
Charles Steinkuehler
cha...@steinkuehler.net
Reply all
Reply to author
Forward
0 new messages