Has anybody had any luck getting SPI to work with the debian image? I’ve followed the advice here and enabled the device tree overlay, but I’m not certain this is sufficient to get SPI working. When I try to enable spi devices in /boot/hw_intfc.conf, I do get some dmesg errors however:
[ 2.132127] rockchip-spi ff1d0000.spi: Failed to request TX DMA channel
[ 2.132137] rockchip-spi ff1d0000.spi: Failed to request RX DMA channel
[ 2.132146] rockchip-spi ff1d0000.spi: no high_speed pinctrl state
There are also no spi devices in /dev, should they show up when SPI is enabled properly, or are one of the other devices the SPI controllers. Btw, I can use i2c just fine.
When you want to use a spi device on rockpi through SPI1 as you mentioned, there are several steps you should do.
Fistly, you need to set spi1 as on, like
intfc:spi1=on
and ensble your your dtbo , like
intfc.dtoverlay=spi1-flash # spi1-flash is the name of your dtbo file without suffic .dtbo
in /boot/hw_confc.conf.
Secondly, place your dtbo file, which is about your spi device (e.g. spi1-flash.dtbo), in /boot/overlays.
Thirdly, if necessary, you need to check whether there is the driver module attached to your spi device in the kernel.
To clarify, I am not trying to use a specific external SPI device. I am looking for low level access to the SPI bus, through some thing like /dev/spidev (which does not exist), so that I can communicate directly to an external circuit that I have built.
@O635789, now the package libmraa-rockpi4 is only for stretch arm64 and bionic arm64. Are your root filesystem of image is 32-bit? if so, won’t find it.
mraa-gpio list mraa-gpio: error while loading shared libraries: libjson-c.so.3: cannot open shared object file: No such file or directory
sudo apt-get install libjson-c3 mraa-gpio list mraa-gpio: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.27’ not found (required by /usr/local/lib/libmraa.so.2)
I’m still googling how to get glibc 2.27…
I hope you could build your packages on Debian ARM64 instead of Ubuntu, if it works on Debian ARM64 the chance is better to work on Ubuntu, not the case the other way around.
EDIT:
I downloaded libmraa source code and built successfully, made a few calls to the library works fine. However, run the tool “mraa-uart list” got error.
interestingly, on one of my two RockPi’s it works without any Problem, on the other one it doesn’t (at least spi. UART works fine on both).
Same Image, same Kernel, lots of reboots…but it won’t work