How to enable spi on BBB running Ubuntu 18.04

I am new to the SPI pins on a Beaglebone Black and wish to learn how to use them. with very little luck finding any documentation on how to enable them when searching the web, i did find a few examples however it seams that they were outdated guides or perhaps not even the right operating system that i am using.

I would like to know how to enable the SPI pins on my BBB that is running Ubuntu 18.04. so if any one knows of any current documentation or could help me, i would be grateful.

Thank you
Miles Dyson

@milesbdyson, please run this script so we can determine your setup, so we can better answer how to enable spi on the bbb…

sudo /opt/scripts/tools/version.sh

Regards,

git:/opt/scripts/:[4d42f40945874258a2d236d9427dbd14b3801ca6]
eeprom:[A335BNLT000C1316BBBK1210]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[rcn-ee.net console Ubuntu Image 2018-06-08]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
kernel:[4.14.44-ti-r51]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20190610.0-0rcnee0~bionic+20190610]
pkg:[bb-wl18xx-firmware]:[1.20190227.1-0rcnee0~bionic+20190227]
pkg:[kmod]:[24-1ubuntu3.2rcnee0~bionic+20190208]
WARNING:pkg:[roboticscape]:[NOT_INSTALLED]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet cape_universal=enable]
dmesg | grep pinctrl-single
[ 1.167744] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.174577] gpio-of-helper ocp:cape-universal: ready
END

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

That should be new enough to just edit /boot/uEnv.txt and add these options:

uboot_overlay_addr4=/lib/firmware/BB-SPIDEV0-00A0.dtbo
uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo

https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays

Regards,

1 Like

Perfect… thank you, that was exactly what i needed and now have the SPI0 pins enabled… as allays it has bin my pleasure communicating with you… you are a great asset to this TechForum. :+1: