spi0 interface on Beagle bone black

Hi All,

I am trying to configure SPI0 on the beagle bone black. I am using Adafruit library. BB is connected to a FPGA which has a slave device.
When I run the following code snippet after configure the pins to spi, I always get 255 an my slave device is not receiving any data.

The following is configurations:
config-pin p9_17 spi_cs
config-pin p9_18 spi
config-pin p9_21 spi
config-pin p9_22 spi_sclk

the following is the code I am using:

def Read_spi_address(bus, device):
from Adafruit_BBIO.SPI import SPI
import Adafruit_BBIO.GPIO as GPIO
import time

spi_dev = SPI(bus, device)
print("testing SPI\n")
# configure SPI
spi_dev.msh = 5000000
spi_dev.bpw = 8   # data width of 8 bits
spi_dev.lsbfirst = False
spi_dev.mode = 0
spi_dev.cshigh = False
spi_dev.threewire = False
spi_dev.open(bus, device)
print("spi speed is:" + str(spi_dev.msh))

print(spi_dev.xfer2([50, 60, 70, 80]))

Any help is appreciated.

Are you sure the spidevices are ok?
What is the result of ls /dev/spi*
If there is nothing, tried modprobe spidev and rerun the ls /dev/spi*
Must exists one or 2 devices there

Hi Juvinski,
Yes, SPI devices are available.