I have troubles with enabling SPI on BBB, ofc followed [tutorial from the hipstercircuits.com.](http://hipstercircuits.com/enable-spi-with-device-tree-on-beaglebone-black-copy-paste/) 
I even installed a fresh arch linux to the uSD in case I really messed up system on eMMC.

My settings are:

Since SPI1 has issues with HDMI I disabled anything HDMI related I found.
Not sure about fdfile entry though, found it somewhere on the web. (I also tried without it)
Currently I'm working on the SD card if that matters.

uEnv.txt

```
optargs=quiet coherent_pool=1M fdtfile=am335x-boneblack.dtb capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

```

I took dts file straight from the hipstercircuits.com and compiled it with alarm/dtc-overlay 1.4.1-1 installed via pacman.

After disabling HDMI in uEnv.txt

```
[root@alarm ~]# echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots

```

went ok and I saw:

```
[root@alarm ~]# cat /sys/devices/bone_capemgr.9/slots
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPI1-01

```

I also tried echoing BB-SPIDEV0, BB-SPIDEV1 and BB-SPIDEV1A1 found here:

```
 [root@alarm spi_a]# ls -l /lib/firmware | grep SPI
    -rw-r--r-- 1 root root    1351 Jan 29 17:04 BB-SPI1-01-00A0.dtbo
    -rw-r--r-- 1 root root    1185 Jan 25 01:06 BB-SPIDEV0-00A0.dtbo
    -rw-r--r-- 1 root root    1185 Jan 25 01:06 BB-SPIDEV1-00A0.dtbo
    -rw-r--r-- 1 root root    1185 Jan 25 01:06 BB-SPIDEV1A1-00A0.dtbo

```

Result of the spidev\_test is always the same.

What is more interesting I didn't see anything about P9\_29, P9\_31 etc, which are part of SPI1, in pingroups:

```
[root@alarm ~]# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups
registered pin groups:
group: pinmux_userled_pins
pin 21 (44e10854)
pin 22 (44e10858)
pin 23 (44e1085c)
pin 24 (44e10860)

group: pinmux_rstctl_pins
pin 20 (44e10850)

group: pinmux_i2c0_pins
pin 98 (44e10988)
pin 99 (44e1098c)

group: pinmux_i2c2_pins
pin 94 (44e10978)
pin 95 (44e1097c)

group: pinmux_mmc1_pins
pin 88 (44e10960)

group: pinmux_emmc2_pins
pin 32 (44e10880)
pin 33 (44e10884)
pin 0 (44e10800)
pin 1 (44e10804)
pin 2 (44e10808)
pin 3 (44e1080c)
pin 4 (44e10810)
pin 5 (44e10814)
pin 6 (44e10818)
pin 7 (44e1081c)

group: pinmux_userled_pins
pin 21 (44e10854)
pin 22 (44e10858)
pin 23 (44e1085c)
pin 24 (44e10860)

```

The spidevs are present in /dev

```
[root@alarm ~]# ls -l /dev | grep spi
crw------- 1 root root 153,   1 Jan 29 17:13 spidev1.0
crw------- 1 root root 153,   0 Jan 29 17:13 spidev1.1

```

To test the interface both python method mentioned in the tutorial and spidev\_test.c ([spidev\_test.c](https://www.kernel.org/doc/Documentation/spi/spidev_test.c)) compiled on the BBB were used.

```
[root@alarm ~]# gcc spidev_test.c -o spidev_test

```

In case of python library there is no error but also nothing at the output - not even a clock signal on the SCL line.

spidev\_test returns:

```
[root@alarm spi_a]# ./spidev_test
can't set spi mode: Inappropriate ioctl for device
Aborted (core dumped)
[root@alarm spi_a]# ./spidev_test -D /dev/spidev1.0
can't set spi mode: Inappropriate ioctl for device
Aborted (core dumped)
[root@alarm spi_a]# ./spidev_test -D /dev/spidev1.1
can't set spi mode: Inappropriate ioctl for device
Aborted (core dumped)

```

Do I have to make use of \*.dts and \*.dtb files provided at the beginning of the hipstercircuit's tutorial?

I probably screwed up sth easy. Any ideas what was it?
Did you get it working just like that?
All advices are welcome and will be very appreciated! ;)