Enabling SPI in BBB, Debian Stretch

1,198 views
Skip to first unread message

Jon Lundstrom

unread,
Mar 29, 2018, 11:35:23 AM3/29/18
to BeagleBoard
I'm trying to enable SPI on my BBB but constantly fail following the advises I find in the forums.

It seems like echoing anything into /sys/devices/platform/bone_capemgr/slots is obsolete. Instead I should set up in /boot/uEnv.txt, but how? What should I add in that file?

I've tried:
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0
or:
optargs=quiet drm.debug=7 capemgr.enable_partno=BB-SPI0-01

...but I still don't get anything named spi* under /dev/ (yes, I've rebooted)

ls -l /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory

I would be happy with only one SPI, like SPI0 so I wouldn't have to bother with disabling HDMI.

This is the state of my setup: sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[ea6ea9fca05f36f5044398884375b0231348d6e2]
eeprom:[A335BNLT000C1750BBBG0574]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-01-28]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.01-00002-g9aa111a004]
kernel:[4.9.78-ti-r94]
nodejs:[v6.12.3]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20180126.0-0rcnee0~stretch+20180126]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee2~stretch+20180104]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]
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]
dmesg | grep pinctrl-single
[    1.380806] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
END


Anyone out there, who knows what to do?

Robert Nelson

unread,
Mar 29, 2018, 11:40:43 AM3/29/18
to Beagle Board, j.b.lu...@gmail.com
On Thu, Mar 29, 2018 at 10:35 AM, Jon Lundstrom <j.b.lu...@gmail.com> wrote:
> I'm trying to enable SPI on my BBB but constantly fail following the advises
> I find in the forums.
>
> It seems like echoing anything into /sys/devices/platform/bone_capemgr/slots
> is obsolete. Instead I should set up in /boot/uEnv.txt, but how? What should
> I add in that file?
>
> I've tried:
> cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0
> or:
> optargs=quiet drm.debug=7 capemgr.enable_partno=BB-SPI0-01

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

uboot_overlay_addr0=/lib/firmware/BB-SPIDEV0-00A0.dtbo

Regards,

--
Robert Nelson
https://rcn-ee.com/

evilwulfie

unread,
Mar 29, 2018, 11:47:36 AM3/29/18
to beagl...@googlegroups.com
Development goes so fast. Too bad the people who posted BBB infos don't
update their web pages.

Jon Lundstrom

unread,
Apr 3, 2018, 11:26:26 AM4/3/18
to BeagleBoard

Thank you Robert,

That did the trick.

However, it has the side-effect of turning my display all black.
I use a Newhaven display cape and according to its User Guide, there should be no conflict for these SPI-pins.
(http://www.newhavendisplay.com/userguides/NHD-7.0CTP-CAPE_User_Guide.pdf)

So I had a look at the assigned pins in /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups and see that following group is added (using diff):

> group: pinmux_bb_spi0_pins
> pin 84 (PIN84)
> pin 85 (PIN85)
> pin 86 (PIN86)
> pin 87 (PIN87)

which seems in order, but following groups were removed:

< group: pinmux_bb_lcd_pwm_backlight_pins
< pin 18 (PIN18)

< group: pinmux_bb_lcd_lcd_pins
< pin 40 (PIN40)
< pin 41 (PIN41)
< pin 42 (PIN42)
< pin 43 (PIN43)
< pin 44 (PIN44)
< pin 45 (PIN45)
< pin 46 (PIN46)
< pin 47 (PIN47)
< pin 48 (PIN48)
< pin 49 (PIN49)
< pin 50 (PIN50)
< pin 51 (PIN51)
< pin 52 (PIN52)
< pin 53 (PIN53)
< pin 54 (PIN54)
< pin 55 (PIN55)
< pin 15 (PIN15)
< pin 14 (PIN14)
< pin 13 (PIN13)
< pin 12 (PIN12)
< pin 11 (PIN11)
< pin 10 (PIN10)
< pin 9 (PIN9)
< pin 8 (PIN8)
< pin 56 (PIN56)
< pin 57 (PIN57)
< pin 58 (PIN58)
< pin 59 (PIN59)
< pin 35 (PIN35)

< group: pinmux_edt_ft5x06_pins
< pin 105 (PIN105)

I don't know about the last group (PIN105) but the other two groups most certainly affect the display function.

I haven't seen the corresponding .dts-file for BB-SPIDEV0-00A0.dtbo, but I tried making my own that should not touch these pins: Still, the same result (same pin groups are removed).

There seems to be some mechanism that disables the display pins when adding an overlay to the uEnv.txt.

Robert, as an expert in BBB, do you have answer to this?

Best regards,
Jon Lundström.

Robert Nelson

unread,
Apr 3, 2018, 11:32:17 AM4/3/18
to Beagle Board, Jon Lundstrom
Well, addr0 -> addr3 is for eeprom detected capes, so change:

uboot_overlay_addr0=/lib/firmware/BB-SPIDEV0-00A0.dtbo

to

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

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

Jon Lundstrom

unread,
Apr 4, 2018, 5:13:04 AM4/4/18
to BeagleBoard

Thanks again, Robert,

The display now works and I've been able to loop the SPI back to the BBB.

I'm grateful for your help,
/Jon.
Reply all
Reply to author
Forward
0 new messages