Hi,
I’m trying to change the chip select pins for SPI0 by applying a device tree overlay. However it looks like the configuration is not getting applied correctly. or being ignored. I’m using:
Device: Raspberry Pi 4 (using 64bit OS)
Host OS: balenaOS 2.85.2+rev3 (development)
Supervisor: 12.10.10
Local mode
Here are the steps I’ve taken:
-
I flashed a new image, modified the
config.txt
, and then booted the device for the first time. When I rancat /mnt/boot/config.txt
, my changes could not be seen not. It looks like the default configuration from the fleet/application was used instead. -
Then I updated the device configuration using the dashboard. These changes do appear in
/mnt/boot/config.txt
after a reboot.Device configuration
RESIN_HOST_CONFIG_dtparam="spi=on" RESIN_HOST_CONFIG_dtoverlay="spi0-2cs,cs0_pin=04,cs1_pin=27"
/mnt/boot/config.txt
disable_splash=0 dtoverlay=spi0-2cs,cs0_pin=04,cs1_pin=27 dtparam=spi=on enable_uart=1 gpu_mem=396 arm_64bit=1 avoid_warnings=1
-
In an application container, I used Python and pigpio to send some data on the main SPI bus, channel 0, SPI mode 3.
import pigpio pi = pigpio.pi() h = pi.spi_open(0, 50000, 3) pi.spi_write(h, b'\x21\x00\x00\x00\x00')
On a scope, it can be seen that the RPI is still using the default chip select pin (GPIO 8) and not the pin configured in the
config.txt
file (GPIO 4).
Do you know why this could be happening? Is there another way to test/print how SPI0 is configured on the RPI4?
Thanks!