How to get SPI0 working

Other hardware discussion
Post Reply
dusinnhht
Posts: 2
Joined: Wed Oct 23, 2019 2:43 pm

How to get SPI0 working

Post by dusinnhht »

Hi!

I'd like to use SPI0 on the StereoPi. I use the standard and latest Raspbian. I enabled SPI with raspi-config and rebooted several times, but ls /dev/spi* doesn't give any result.
Then I enabled SPI1 (added dtoverlay=spi1-3cs to /boot/config.txt), and it seems to be working. (I now have /dev/spidev1.0, /dev/spidev1.1 and /dev/spidev1.2) Pinout is here: https://pinout.xyz/

Did anyone have any luck enabling SPI0?

dusinnhht
Posts: 2
Joined: Wed Oct 23, 2019 2:43 pm

Re: How to get SPI0 working

Post by dusinnhht »

I just noticed, that SPI1 is in fact SPI0, at least it drives the pins for SPI0. It's weird, because when I connected SPI1's Mosi with Miso it passed the test. But what I connected to SPI1 bus didn't work, so I checked the other pins with oscilloscope and noticed that SPI0 pins are driven (also? I didn't check SPI1, just wanted to get over with the project, but I still dont have /dev/spidev0.*)

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: How to get SPI0 working

Post by Realizator »

Hi dusinnhht,
Which pins are you using for SPI0?
If we'll look inside Compute Module datasheet, page 18 and 19, we can see that SPI0 can bu used either at GPIO 7-10 (ALT0), or at GPIO 35-39 (ALT0).
And if we'll look inside our device tree configuration (dt-blob.dts), we can see that some of these pins are used for the second camera control.

To check this hypothesis, please try to rename dt-blob.bin in your /BOOT partition and run your tests. With no dt-blob.bin our StereoPi will act exaxtly as a classic Raspberry Pi.
If this will work for you, we'll try to slightly modify dt-blob for you, to release the pins you need.
Eugene a.k.a. Realizator

Post Reply