Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6814

Beginners • Disabling SPI 0 interface to make GPIO 8 available

$
0
0
We have a Compute Module 4 (CM4) based hardware ready in which MCP2518FDT chip is connected to the SPI 1 interface. Below pins are used for SPI 1:
SPI_MOSI ==> GPIO20
SPI_MISO ==> GPIO19
SPI_CLK ==> GPIO21
SPI_CE0 ==> GPIO18

The interrupt pin of MCP2518FDT is connected with the GPIO8 of the CM4. The following dtoverlay is added in config.txt to enable the driver for this IC:

Code:

dtoverlay=mcp251xfd,spi1-0,oscillator=20000000,interrupt=8
Since GPIO8 is default chip select for SPI 0 so the driver is not getting initialized properly. I have tried disabling the SPI 0 interface using the below two methods.

1- adding the below line in the config.txt file located in the /boot/firmware directory

Code:

dtparam=spi=off
2- creating a custom device tree overlay (disable-spi0.dts) to disable the SPI 0 interface

Code:

/dts-v1/;/plugin/;/ {    compatible = "brcm,bcm2711";    fragment@0 {        target = <&spi0>;        __overlay__ {            status = "disabled";        };    };};
the dts file was compiled to generate disable-spi0.dtbo file and the following line was added to config.txt

Code:

dtoverlay=disable-spi0
None of the above two method disables the SPI 0 interface.

3- I have also tried assigning some other unused GPIOs to the chip select pins for SPI 0 but still GPIO7 and GPIO 8 somehow get assigned to SPI0 and not available to use with SPI 1 interface for MCP2518FDT.

Please propose a working solution to fix this issue.

Statistics: Posted by Abdul Samad — Fri Mar 07, 2025 9:33 am — Replies 0 — Views 14



Viewing all articles
Browse latest Browse all 6814

Trending Articles