SPI0 with python

Hi,

I enabled SPI0 in uEnv

optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONE-EMMC-2G,BB-BONELT-HDMIN capemgr.enable_partno=BB-SPI0-01

pingroups shows

group: spi0_pins_s0
pin 84 (44e10950)
pin 85 (44e10954)
pin 86 (44e10958)
pin 87 (44e1095c)

end tried the spitest.c with success

./spidev_test /dev/spidev1.0

spi mode: 0
bits per word: 8
max speed: 1500000 Hz (1500 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D

But my python test script (loop 18-21 patched)
doesnt work. Who can I debug deeper ? Or where is my fault ?

from Adafruit_BBIO.SPI import SPI
import pprint as pp

spi = SPI(0,0)
spi.mode = 0
spi.msh = 1500000
spi.bpw = 16
spi.open(0,0)
print spi.xfer2([0x80,0x50])
spi.close()

→ output [[…]]

And also I’m not able to use a variable for the result
data=spi.xfer2([0x80,0x50])
print data
raises a fault also…

dmesg says…
[ 106.795329] bone-capemgr bone_capemgr.8: part_number ‘ADAFRUIT-SPI0’, version ‘N/A’
[ 106.795439] bone-capemgr bone_capemgr.8: slot #8: generic override
[ 106.795468] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 8
[ 106.795499] bone-capemgr bone_capemgr.8: slot #8: ‘Override Board Name,00A0,Override Manuf,ADAFRUIT-SPI0’
[ 106.795666] bone-capemgr bone_capemgr.8: slot #8: Requesting part number/version based 'ADAFRUIT-SPI0-00A0.dtbo
[ 106.795697] bone-capemgr bone_capemgr.8: slot #8: Requesting firmware ‘ADAFRUIT-SPI0-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 106.800360] bone-capemgr bone_capemgr.8: slot #8: dtbo ‘ADAFRUIT-SPI0-00A0.dtbo’ loaded; converting to live tree
[ 106.800632] bone-capemgr bone_capemgr.8: slot #8: #2 overlays
[ 106.827961] edma-dma-engine edma-dma-engine.0: allocated channel for 0:19
[ 106.828058] edma-dma-engine edma-dma-engine.0: allocated channel for 0:18
[ 106.851422] edma-dma-engine edma-dma-engine.0: allocated channel for 0:17
[ 106.851514] edma-dma-engine edma-dma-engine.0: allocated channel for 0:16
[ 106.853736] bone-capemgr bone_capemgr.8: slot #8: Applied #2 overlays.
root@beaglebone:/home/adtran#

What the heck is my fault ?

uname -a
Linux beaglebone 3.8.13-14647-g7854b7e-dirty #5 SMP Mon Aug 26 15:53:29 CEST 2013 armv7l GNU/Linux

First, don't double load... No reason to load BB-SPI0-01, when
Adafruit_BBIO.SPI will load ADAFRUIT-SPI0-00A0.dtbo..

Regards,

Hmm which one should I leave out.The one from uEnv ? That doesnt work for me.
But I solved this with an backup to the newest Adafruit_BBIO…
and an echo at the boot process (echo BB-SPI0-01 > /sys/devices/bone_capemgr.8/slots)

and a softlink from BB-SPIDEV0-00A0.dtbo (called from Adafruit-BBIO) to BBB-SPI0-00A0.dtbo (loaded from Echo …>)

Now it works as expected…