SPI Set up for BeagleBone Black.

This will give us some clues:

sudo /opt/scripts/tools/version.sh

Regards,

I got this:

root@beaglebone:~# sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[31292bce1d4b35b497cc7a013d6d57e7e1f4f5c4]
eeprom:[A335BNLT00C03917BBBK1D19]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-06-17]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2016.01-00001-g4eb802e]:[location: dd MBR]
kernel:[4.14.49-ti-r54]
nodejs:[v6.14.3]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/BB-SPIDEV0-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.4.20180611.0-0rcnee0~stretch+20180611]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[roboticscape]:[0.4.4-git20180608.0-0rcnee0~stretch+20180609]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.033991] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.035166] gpio-of-helper ocp:cape-universal: ready
END

u-boot in the eMMC is blocking overlays from working properly..

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=10

and reboot..

Regards,

Thank you for your patient explanation! It just worked!

Hi Jinao,

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 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]))
spi_dev.close()

Any help is appreciated.

hi Jinao,
when I booted my BBB, I could able to see /dev/spidev*. But When I try to connect any slave devices, communication is not working.
Do I need to follow any of the steps you used even though spi devices are available in /dev/ ?
How could you able to send data to and from SPI devices?

The Adafruit library tries to access /dev/spidev-X.Y
Can you run ls /dev/spidev* and check if the spi port you’re using is there?

I actually having a very similar problem and saw that your post is relatively new.