Skip to content

Commit 71ab330

Browse files
authored
Adjusting SPI doc for older Raspberry Pi OS version (#1304)
* Adjusting SPI doc for older Raspberry Pi OS version
1 parent f22be18 commit 71ab330

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Documentation/raspi-spi.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ This will enable SPI0 where those are the pins which will be selected, only Soft
7272

7373
## Enabling any SPI with any Chip Select
7474

75-
In order to activate Chip Select, you'll need to add a specific dtoverlay on the `/boot/config.txt` file. If you've used the previous way of activating SPI0, you should not comment the line `dtparam=spi=on` and add what follows using the `dtoverlay`configurations.
75+
In order to activate Chip Select, you'll need to add a specific dtoverlay on the `/boot/config.txt` file. If you've used the previous way of activating SPI0, you should comment the line `dtparam=spi=on` and add what follows using the `dtoverlay`configurations.
7676

7777
Here is the table with the different options for SP0 and SP1 (please refer to the [Raspberry Pi documentation](https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/) to activate other SPI)
7878

@@ -99,6 +99,18 @@ dtoverlay=spi0-1cs,cs0_pin=27,no_miso
9999

100100
There is only for SPI0 that you can use, in both cases with 1 or 2 Chip Select pin the `no_miso`option.
101101

102+
**Important note**: Those overlays are only supported in the very last Raspberry Pi OS. You will get the `System.IO.IOException: Error 2. Can not open SPI device file '/dev/spidev0.0'` error message if you are using them on an older version. You can use `spi0-cs` where in the previous examples you had `spi0-2cs` or `spi0-1cs`.
103+
104+
As an alternative, you can as well use the following command line: `sudo raspi-config nonint do_spi 0 `
105+
106+
So the first example will now give:
107+
108+
```text
109+
dtoverlay=spi0-cs,cs0_pin=27,cs1_pin=22
110+
```
111+
112+
In older version, no_miso is not supported neither. And you will always get 2 chip select activated and you don't have a way to only select one.
113+
102114
# SPI1 to SPI6
103115

104116
The following dtoverlay definition can be [found here](https://github.com/raspberrypi/linux/blob/04c8e47067d4873c584395e5cb260b4f170a99ea/arch/arm/boot/dts/overlays/README#L1167).

0 commit comments

Comments
 (0)