Skip to main content
Associate III
April 24, 2025
Question

STM32MP135D-FK Custom Device Tree – No /dev/spidevX.Y After Adding SPI5

  • April 24, 2025
  • 1 reply
  • 799 views

Hi all,

I'm working with the STM32MP135D-FK board and have created a custom machine for Yocto, using the openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06 release. I generated the base Device Tree using STM32CubeMX, and I'm trying to enable SPI5 with spidev interface.

Here's the relevant section of my Device Tree (in stm32mp135d-myboard.dts): 

&spi5 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi5_pins_mx>;
pinctrl-1 = <&spi5_sleep_pins_mx>;
status = "okay";
cs-gpios = <&gpiof 10 GPIO_ACTIVE_LOW>;

spidev@0 {
compatible = "linux,spidev";
reg = <0>; /* CS #0 */
spi-max-frequency = <10000000>;
status = "okay";
};
};

/* Active (default) state */
spi5_pins_mx: spi5-0 {
pins1 {
pinmux = <STM32_PINMUX('F', 7, AF5)>, /* SPI5_SCK */
<STM32_PINMUX('F', 9, AF5)>; /* SPI5_MOSI */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};

pins2 {
pinmux = <STM32_PINMUX('F', 8, AF5)>; /* SPI5_MISO */
bias-disable;
};
};

/* Sleep state */
spi5_sleep_pins_mx: spi5-sleep-0 {
pins {
pinmux = <STM32_PINMUX('F', 7, ANALOG)>, /* SPI5_SCK */
<STM32_PINMUX('F', 8, ANALOG)>, /* SPI5_MISO */
<STM32_PINMUX('F', 9, ANALOG)>; /* SPI5_MOSI */
};
};

After building and flashing the st-image-weston, I don’t see any spidevX.Y device node in /dev.

Questions:

  1. Is my Device Tree configuration for spidev on SPI5 correct?

  2. Are there additional steps needed ?

  3. Steps to How to use device tree ? Screenshot from 2025-04-24 13-43-36.png

Thanks in advance for your help!

1 reply

Christophe Guibout
ST Employee
April 24, 2025

Hello @Midhul_Pk,

 

I would recommand to have a look into the kernel logs (dmesg) and check is spi driver is probed : I guess an error is returned which could be a good starting point to investigate.

BR,

Christophe

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.
Midhul_PkAuthor
Associate III
April 24, 2025

hello ,  @Christophe Guibout 

.

  

Christophe Guibout
ST Employee
April 25, 2025

Hi @Midhul_Pk,

So, maybe a dumb question : are you sure the DTB you built with SPI5 enabled is the one loaded by the linux kernel running on the board ?

Did you check if the are some pinctrl issues in the kernel logs (CubeMx should take care about that, but I have no better idea).

BR,

Christophe

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.