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:
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?
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
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
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:
- Is the above DTS configuration correct for SPI communication over MISO and MOSI without CS or SCLK?
- Can SPI communication with the LED board be established using only MISO and MOSI?
- How can I resolve the issue with the device node /dev/spidev1.0 not being accessible?
- 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,