Enable the SPI interface

Im trying since 2 week to enable the SPI interface on a RockPI S.
Sadly without any success…

Im not able to get a /dev/spi* device in the debian image.
I tryed several things:

No matter what i try, it dosn’t work.
Is there a Official way to enable & access any SPI interface?

The documentation on the RockPi S wiki is more than thin.

The modification from other guides like RockPi 4 dosn’t work either.
Nor i have any overlays in /boot/overlays, nor the directory itself.

Can someone please enlighten me what to do ?!

Thanks for any help!

We are looking at it now.

We found a error for our debian image,because of the directory /boot/ in root partition
have files, the boot partition has not mount.
You change configure file:/boot/hw_intfc.conf is in root partition.
You need:

$ sudo mount /dev/mmcblk0p4 /mnt/
$ sudo vim /mnt/hw_intfc.conf

Change:

intfc:spi2=on

Reboot your ROCK Pi S and then you can get the directory/sys/class/spi_master/spi2.
But we found a bug, if you open the spi0 kernel can’t boot in normal.
We will fix this bug and update image on wiki.

Thanks for your research!

But i have no hw_intfc.conf file. I have only a “hw_intfc.conf.bkp” file.
I created the file, and added “intfc:spi2=on”, but it dosn’t do anything after a reboot.

The changes under /boot/hw_intfc.conf are persistent, but the file/path /sys/class/spi_master/spi2 does not exists

Did your image is got from RockpiS downloads?

Off course!

When can i expect the updated debian image ?

I have this issue as well, except that there is a /boot/hw_intfc.conf file, but it doesn’t seem to be used at all.

I have the same issue as well need to get SPI to CAN working.

@Bharadwaaj_Ramakrish

I used the rockpis_debian_buster_server_arm64_20210924_0412-gpt.img.gz

with /boot/uEnv.txt

verbosity=7
fdtfile=rockchip/rk3308-rock-pi-s.dtb
overlays=rk3308-spi-spidev  rk3308-i2c2
param_spidev_spi_bus=2
param_spidev_max_freq=10000000
rootuuid=2a975457-7408-4fda-bd37-22b8d2df5b6f
initrdsize=0x5caa89
kernelversion=4.4.143-69-rockchip-g8ccef796d27d
initrdimg=initrd.img-4.4.143-69-rockchip-g8ccef796d27d
kernelimg=vmlinuz-4.4.143-69-rockchip-g8ccef796d27d
import spidev
spi = spidev.SpiDev()
spi.open(2, 0)
spi.max_speed_hz = 10000000
to_send = [0x01, 0x02, 0x03]
spi.xfer(to_send)

and SPI works perfectly