cancel
Showing results for 
Search instead for 
Did you mean: 

Issue Enabling SPI4 on STM32MP157F-DK2 – DTS Uses Correct Pins but Still Fails (PE6 Conflict)

shreyaschandran
Associate II

Hello ST Community,

I'm trying to enable SPI4 on my STM32MP157F-DK2 board to use it for a SPI-based SD card interface.

In my custom device tree overlay, I’ve defined the SPI4 node like this:

&spi4 {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&spi4_pins_b>;
    pinctrl-1 = <&spi4_sleep_pins_b>;
    cs-gpios = <&gpioe 11 0>;
    status = "okay";

    sdcard@0 {
        compatible = "mmc-spi-slot";
        reg = <0>;
        spi-max-frequency = <10000000>;
    };
};

 And in the .dtsi, the pins I’m using are:

spi4_pins_b: spi4-1 {
    pins1 {
        pinmux = <STM32_PINMUX('E', 12, AF5)>, /* SPI4_SCK */
                 <STM32_PINMUX('E', 14, AF5)>; /* SPI4_MOSI */
        bias-disable;
        drive-push-pull;
        slew-rate = <1>;
    };
    pins2 {
        pinmux = <STM32_PINMUX('E', 13, AF5)>; /* SPI4_MISO */
        bias-disable;
    };
};

So, I am not using PE6 (used in spi4_pins_a). However, on boot, dmesg shows this error:

stm32mp157-pinctrl soc:pin-controller@50002000: pin PE6 already requested by 5a001000.display-controller; cannot claim for 44005000.spi
spi_stm32 44005000.spi: Error applying setting, reverse things back
spi_stm32: probe of 44005000.spi failed with error -22

Even though I'm referencing spi4_pins_b, the kernel seems to attempt claiming PE6, which conflicts with the LTDC display controller. Is there any internal fallback or default mapping that causes PE6 to be requested even if it's not in the current pinctrl? 

Any insight or suggestions are appreciated!

Thanks,
Shreyas

0 REPLIES 0