SPI Communication Issue with MISO/MOSI on i.MX8MP for LED Board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI Communication Issue with MISO/MOSI on i.MX8MP for LED Board

706 Views
MJD
Contributor III

 

Hi NXP Team,

We are working on a custom board with the i.MX8MP processor and are trying to establish SPI communication with an LED board connected via the following pins:

  • UART3_CTS_3V3 = ECSPI1_MISO = LED_DOUT_3V3
  • UART3_RXD_3V3 = ECSPI1_MOSI = LED_DIN_3V3

We have the following device tree configuration:

269 &ecspi1 {

 270     pinctrl-names = "default";

 271     pinctrl-0 = <&pinctrl_ecspi1>;

 272     status = "okay";

 273 

 274     leds-gpio@1 {

 275         compatible = "custom,leds-gpio"; /* Update to your specific LED driver */

 276         reg = <1>; /* SPI chip select 0 */

 278         spi-max-frequency = <1200000>; /* 1 MHz */

 279         status = "okay";

282         leds {

 283             compatible = "spi,rgb-leds";

 284             led-names = "red", "green", "blue";

 285             led-count = <8>; /* Adjust based on the number of LEDs */

 286         };

 287     };

 288 };

1154         pinctrl_ecspi1: ecspi1grp {

1155                 fsl,pins = <

1157                         MX8MP_IOMUXC_ECSPI1_MOSI__ECSPI1_MOSI   0x00

1158                         MX8MP_IOMUXC_ECSPI1_MISO__ECSPI1_MISO   0x00

1159                  >;

1160        };

Current Issues:

  1. No Chip Select (CS) or SCLK Connection
    The LED board is only connected to the MISO and MOSI pins, without a CS pin or SCLK connection. Can SPI communication be achieved with only these two pins?

  2. Driver Initialization
    The SPI driver initializes without errors, as seen in the logs:

    [ 142.944595] LED count not specified in DT, defaulting to 8 [ 142.950130] Sending data to RGB LEDs... [ 142.950655] SPI data sent successfully [ 142.950669] leds-gpio spi1.1: RGB LED SPI driver initialized [ 142.956376] RGB LED SPI driver initialized
  3. Device Testing Fails
    The device appears under /sys/bus/spi/devices/spi1.0:

    root@imx8mp-lpddr4-evk:~# cat /sys/bus/spi/devices/spi1.0/modalias spi:leds-gpio

    However, when attempting to test the device using spidev_test, it fails:

    root@imx8mp-lpddr4-evk:~# spidev_test -D /dev/spidev1.0 -v
    can't open device: No such file Aborted
  4. No LEDs in /sys/class/leds
    The LEDs are not exposed under /sys/class/leds, and I cannot control them directly:

    root@imx8mp-lpddr4-evk:~# ls /sys/class/leds/
    mmc1:: mmc2::

Questions:

  1. Is the above DTS configuration correct for SPI communication over MISO and MOSI without CS or SCLK?
  2. Can SPI communication with the LED board be established using only MISO and MOSI?
  3. How can I resolve the issue with the device node /dev/spidev1.0 not being accessible?
  4. What changes are required to expose the LEDs in /sys/class/leds for direct control?

Any guidance or suggestions would be greatly appreciated.

Thank you,

0 Kudos
Reply
1 Reply

677 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

Both CS and SCLK are typically essential, along with MOSI and MISO. Without these, the communication protocol would not function correctly.

Best Regards,
Zhiming

0 Kudos
Reply