It looks like you have a four-digit seven-segment display connected to a Max7219 IC through SPI and you're experiencing issues. The suggestions you received are valid steps to troubleshoot the problem. Here's a response you might use:
SThank you for your email. I appreciate your assistance in troubleshooting the connectivity issue with the four-digit seven-segment display connected to the Max7219 IC through SPI.
1.SPI DTS Node:
Here is the SPI DTS node we are currently using:
//imx8qm-apalis-v1.1.dtsi
/* Apalis SPI1 */
&lpspi0 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpspi0>;
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <2>;
cs-gpios = <&lsio_gpio3 5 GPIO_ACTIVE_LOW>, <&lsio_gpio5 26 GPIO_ACTIVE_LOW>;
spidev0: spi@0 {
compatible = "toradex,evalspi";
reg = <0>;
spi-max-frequency = <12000000>;
};
spidev2: spi@1 {
compatible = "toradex,evalspi";
reg = <1>;
spi-max-frequency = <12000000>;
};
};
/* Apalis SPI2 */
&lpspi2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpspi2>;
#address-cells = <1>;
#size-cells = <0>;
cs-gpios = <&lsio_gpio3 10 GPIO_ACTIVE_LOW>;
spidev1: spi@0 {
compatible = "toradex,evalspi";
reg = <0>;
spi-max-frequency = <4000000>;
};
};
//imx8-ss-dma.dtsi
lpspi0: spi@5a000000 {
compatible = "fsl,imx7ulp-spi";
reg = <0x5a000000 0x10000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;
clocks = <&spi0_lpcg 0>,
<&spi0_lpcg 1>;
clock-names = "per", "ipg";
assigned-clocks = <&clk IMX_SC_R_SPI_0 IMX_SC_PM_CLK_PER>;
assigned-clock-rates = <24000000>;
power-domains = <&pd IMX_SC_R_SPI_0>;
dma-names = "tx","rx";
dmas = <&edma2 1 0 0>, <&edma2 0 0 1>;
status = "disabled";
};
lpspi2: spi@5a020000 {
compatible = "fsl,imx7ulp-spi";
reg = <0x5a020000 0x10000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;
clocks = <&spi2_lpcg 0>,
<&spi2_lpcg 1>;
clock-names = "per", "ipg";
assigned-clocks = <&clk IMX_SC_R_SPI_2 IMX_SC_PM_CLK_PER>;
assigned-clock-rates = <60000000>;
power-domains = <&pd IMX_SC_R_SPI_2>;
dma-names = "tx","rx";
dmas = <&edma2 5 0 0>, <&edma2 4 0 1>;
status = "disabled";
};
lpspi3: spi@5a030000 {
compatible = "fsl,imx7ulp-spi";
reg = <0x5a030000 0x10000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;
clocks = <&spi3_lpcg 0>,
<&spi3_lpcg 1>;
clock-names = "per", "ipg";
assigned-clocks = <&clk IMX_SC_R_SPI_3 IMX_SC_PM_CLK_PER>;
assigned-clock-rates = <60000000>;
power-domains = <&pd IMX_SC_R_SPI_3>;
dma-names = "tx","rx";
dmas = <&edma2 7 0 0>, <&edma2 6 0 1>;
status = "disabled";
};
imx8qm-aplis-ixora-v1.1.dtsi
/* Apalis SPI1 */
&lpspi0 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpspi0>;
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <2>;
cs-gpios = <&lsio_gpio3 5 GPIO_ACTIVE_LOW>, <&lsio_gpio5 26 GPIO_ACTIVE_LOW>;
spidev0: spi@0 {
compatible = "toradex,evalspi";
reg = <0>;
spi-max-frequency = <12000000>;
};
spidev2: spi@1 {
compatible = "toradex,evalspi";
reg = <1>;
spi-max-frequency = <12000000>;
};
};
/* Apalis SPI2 */
&lpspi2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpspi2>;
#address-cells = <1>;
#size-cells = <0>;
cs-gpios = <&lsio_gpio3 10 GPIO_ACTIVE_LOW>;
spidev1: spi@0 {
compatible = "toradex,evalspi";
reg = <0>;
spi-max-frequency = <4000000>;
};
};
2. Sensor Kernel Driver
We have loaded the sensor kernel driver as part of our setup.
we have attached the DTS node configuration for SPI for your reference.
Regarding the Userspace code.
plz visit this link
https://drive.google.com/drive/folders/167INqQY44oQ3vN3TN9Tc-fnV63oIlOcF?usp=sharing
Despite these steps, we are currently facing challenges in obtaining the expected output. We would appreciate any insights or further guidance you can provide.
Thank you for your time and assistance.