The Beaglebone Black is a great little controller board that can be used for many different things, it has two SPI BUS’s (Serial Peripheral Interface) that can be used to communicate with different chips, allowing you to create and develop a wide range of devices such as scrolling LED Matrix’s or a simple EEPROM.
Unfortunately the Beaglebone Black does not have these pins enabled by default, you will need to enable them yourself to use them in any of your projects.
Now before you get started make sure you have a Beaglebone Black REV. C and you are running the Ubuntu Console image provided by RobertCNelson located at Beaglebone Black Ubuntu Wiki and your Beaglebone uses the U-Boot v2017.01 or newer. If so then you should be able to follow the below steps to enable any of the SPI Bus’s.
1.) SSH Into your BBB.
power up your Beaglebone Black REV. C and from your computer SSH into it.
2.) Open uEnv.txt.
Now you need to edit your uEnv.txt so that the SPI Bus will be enabled at boot automatically.
$ sudo nano /boot/uEnv.txt
3.) Enable SPI Pins.
Edit the file by adding one or both of the lines below to the ‘U-Boot Overlays’ section of the file depending on which Bus you need to enable, adding both lines will enable both the SPI Bus’s.
uboot_overlay_addr4=/lib/firmware/BB-SPIDEV0-00A0.dtbo
uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo
###U-Boot Overlays###
cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable
uboot_overlay_addr4=/lib/firmware/BB-SPIDEV0-00A0.dtbo
uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo
4.) Reboot.
Now simply reboot your Beaglebone Black.
$ sudo reboot now
5.) SSH Into Your BBB.
Log back into your Beaglebone Black.
6.) List Pins.
Use this command to list all the available pins.
$ cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups
7.) Locate Pin Group.
Now part way up the long list you should find where one or both of the SPI pins are listed, depending on what you enabled.
group: pinmux_bb_spi0_pins
pin 84 (PIN84)
pin 85 (PIN85)
pin 86 (PIN86)
pin 87 (PIN87)group: pinmux_bb_spi1_pins
pin 100 (PIN100)
pin 101 (PIN101)
pin 102 (PIN102)
pin 103 (PIN103)
Congratulations!! you now have your SPI pins enabled on your Beaglebone Black REV.C