cancel
Showing results for 
Search instead for 
Did you mean: 

Enable SPI4 on Linux Side of STM32MP157C-DK2

DBuer
Associate II

I would like to access a SPI Device (Ethercat Shield) over the Arduino Headers (SPI4). What do i have to do to get the /dev/spidev... device file in Linux ?

Sorry, but i'm still confused what is enabled, what do i have to enable in DTS files and when i have to rebuild the kernel (that works 🙂 )

Thanks Daniel

1 ACCEPTED SOLUTION

Accepted Solutions
AntonioST
ST Employee

You can use this DT fragment to enable spidev on spi4

&spi4 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&spi4_pins_a>;
	pinctrl-1 = <&spi4_sleep_pins_a>;
	status = "okay";
	cs-gpios = <&gpioe 11 0>;
 
	spidev@0{
		compatible = "spidev";
		reg = <0>;
		spi-max-frequency = <4000000>;
		#address-cells = <1>;
		#size-cells = <0>;
	};
};

View solution in original post

2 REPLIES 2
AntonioST
ST Employee

You can use this DT fragment to enable spidev on spi4

&spi4 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&spi4_pins_a>;
	pinctrl-1 = <&spi4_sleep_pins_a>;
	status = "okay";
	cs-gpios = <&gpioe 11 0>;
 
	spidev@0{
		compatible = "spidev";
		reg = <0>;
		spi-max-frequency = <4000000>;
		#address-cells = <1>;
		#size-cells = <0>;
	};
};

DBuer
Associate II

Thanks a lot