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

1 REPLY 1
Kevin HUBER
ST Employee

Hello @shreyaschandran 

 

Do you still have this issue ?

Regarding the error encountered, by default on MP15 board, the PE6 pin is used by SPI4 :

spi4_pins_a: spi4-0 {
    pins {
      pinmux = <STM32_PINMUX('E', 12, AF5)>, /* SPI4_SCK */
<STM32_PINMUX('E', 6, AF5)>;  /* SPI4_MOSI */
      bias-disable;
      drive-push-pull;
      slew-rate = <1>;
    };

As you said, in your case it seems to be an issue with the way you are doing the overwrite of spi4 node.

If you still encounter the issue, please can you send me the complete dtb file that you are using. I will take a look at it.

 

BR,

Kevin

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.