cancel
Showing results for 
Search instead for 
Did you mean: 

The SPI on the STM32MP257F-DK board doesn't work after the device tree setup

LeonSu
Associate III

Hello Everyone

linux kernel version: 6.6.78

After configuring the device tree, I can see the SPI device /dev/spidev6.0 on the STM32MP257F-DK board. However, when I run spidev_test[1], it returns the error message "Invalid argument."

I tried using an oscilloscope to measure the signals on the CLK, MOSI, and MISO pins separately, but no signals were detected.

Please give me some suggestions to help me fixed it. Thanks in advance.

//------------------------------------------------------------------------------------------------------

the SPI device tree setting as following:

Path:

~/STM32MPU-Ecosystem-v6.6/Developer-Package/BSP/sources/ostl-linux/linux-stm32mp-6.6.78-stm32mp-r2-r0/linux-6.6.78/arch/arm64/boot/dts/st/stm32mp257f-dk.dts

aliases {
                serial0 = &usart2;
                serial1 = &usart6;
                serial2 = &usart1;
                ethernet0 = &eth1;
                spi6 = &spi6;
        };

&spi6 { 
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&spi6_pins_a>;
        pinctrl-1 = <&spi6_sleep_pins_a>;
        status = "okay";

        spidev@0{
                compatible = "rohm,dh2228fv";
                reg = <0>;
                spi-max-frequency = <10000000>;
        };
};

 

reference:

1.How to use SPI from Linux userland with spidev, https://wiki.st.com/stm32mpu/wiki/How_to_use_SPI_from_Linux_userland_with_spidev.

                               

0 REPLIES 0