How do you enable the SPI pins


#1

I am using the resin/beaglebone-node:latest as the base for the image. I need to enable the SPI via the device tree. On a traditional BBB Debian image I would do:

CAPEMGR=$( find /sys/devices/ -name bone_capemgr* | head -n 1 )                 
echo BB-SPI0DEV > $CAPEMGR/slots 

But I get the following error when running within the container on resin:

echo: write error: No such file or directory

And yes, I am running on the latest Kernel which per the Resin documentation supports the cape manager again.

Linux beaglebone-3f0904 4.1.4 #1 SMP PREEMPT Wed Jan 27 20:40:41 CET 2016 armv7l
GNU/Linux

And the CAPEMGR seems to be there and working, which makes me wonder if it is the definition files that are missing

0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
6: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-UART4

And from the logs on the device:

journalctl | grep SPI
Feb 19 05:58:19 beaglebone-3f0904 kernel: bone_capemgr bone_capemgr: part_number
’BB-SPI0DEV’, version 'N/A’
Feb 19 05:58:19 beaglebone-3f0904 kernel: bone_capemgr bone_capemgr: slot #4: ‘O
verride Board Name,00A0,Override Manuf,BB-SPI0DEV’
Feb 19 05:58:19 beaglebone-3f0904 kernel: bone_capemgr bone_capemgr: part_number
’BB-SPIODEV’, version 'N/A’
Feb 19 05:58:19 beaglebone-3f0904 kernel: bone_capemgr bone_capemgr: slot #5: ‘O
verride Board Name,00A0,Override Manuf,BB-SPIODEV’
Feb 19 05:58:19 beaglebone-3f0904 kernel: bone_capemgr bone_capemgr: part_number
’BB-SPI0DEV’, version 'N/A’
Feb 19 05:58:19 beaglebone-3f0904 kernel: bone_capemgr bone_capemgr: slot #7: ‘O
verride Board Name,00A0,Override Manuf,BB-SPI0DEV’
Feb 19 19:14:27 beaglebone-3f0904 kernel: bone_capemgr bone_capemgr: part_number
’BB-SPI0DEV’, version 'N/A’
Feb 19 19:14:27 beaglebone-3f0904 kernel: bone_capemgr bone_capemgr: slot #9: ‘O
verride Board Name,00A0,Override Manuf,BB-SPI0DEV’


#2

Hello,

The device tree overlay we provide for this specific device has:

part-number = "BB-SPI0"
version = “00A0”;

As capemgr maps version 00A0 by default, all you need is to change the identification string.

So, changing your line to “echo BB-SPI0 > $CAPEMGR/slots” should fix your problem.

As a hint, we are using the device tree overlays provided by https://github.com/beagleboard/bb.org-overlays .

Regards,
Andrei