On 8/29/23 14:11, Peter Wallace wrote:
On Tue, 29 Aug 2023, Sebastian Kuzminsky wrote:

On 8/29/23 13:02, Alan Condit wrote:

Have you had any luck getting spi devices to run on Debian 12 Bookworm?
I got spi-bcm2835 to load on boot but so far I havent been able to create
any spi devices.
I did load spi-tools and api-config runs but wont create any spi devices
for me.

Yes, SPI is working for me on RPi4 running Debian Bookworm and LinuxCNC (from debian.org).

I just `loadrt hm2_rpspi` (note, not the generic `hm2_spi`).

I think the issue Alan has is that the dev/spi0 device is not created and perhaps raspi-config is missing or does not work.

Yes, /dev/spi* is missing from Debian's Raspberry Pi image, and unfortunately the raspi-config tool won't help.

The /dev/spi device file is created by the Linux kernel SPI driver, based on the Device Tree Blob (dtb) loaded at boot time. Debian's dtb does not enable the RPi SPI hardware, and I haven't been able to figure out how to make the correct change to it to enable the SPI. Therefore on Debian there are no /dev/spi* devices, so hm2_spi and mesaflash won't work.

I believe the raspi-config tool relies on a non-standard kernel feature in the Raspberry Pi OS kernel which was never upstreamed to the mainline Linux kernel. This feature is called "dynamic dtb overlays", and it lets the user modify the active dtb at runtime, to do things like enable SPI. Because the debian kernel does not have the dynamic device tree overlay feature, the raspi-config tool cannot be used to enable SPI on debian.

The hm2_rpspi HAL driver does not use /dev/spi, instead it enables and talks to the SPI hardware directly, so it works even if the Linux kernel doesn't know about the SPI hardware.


--
Sebastian Kuzminsky


_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to