2021-05-06 09:56 AM
Hi ,
Actally i want to read a PISO shifht register as spi slave.
Device Tree:
spi2_pins_a: spi2-0 {
pins1 {
pinmux = <STM32_PINMUX('A', 9, GPIO)>, /* uart8_tx */
<STM32_PINMUX('I', 2, GPIO)>, /* uart8_tx */
<STM32_PINMUX('I', 3, GPIO)>, /* uart8_tx */
<STM32_PINMUX('G', 2, GPIO)>; /* uart8_tx */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
};
&spi2 {
compatible = "spi-gpio";
pinctrl-names = "default";
pinctrl-0 = <&spi2_pins_a>;
cs-gpios = <&gpiog 2 0>;
gpio-sck = <&gpioa 9 0>;
gpio-mosi = <&gpioi 3 0>;
gpio-miso = <&gpioi 2 0>;
spi-delay-us = <1>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
};
Here i have tried to use soft_spi driver ..
But getting error like this...
STM32MP> sspi 2:0.1 10
Invalid bus 2 (err=-19)
STM32MP> sspi 2:0.0 10
Invalid bus 2 (err=-19)
STM32MP>
Please help on this..
2021-05-07 01:34 AM
Hi,
I think your SPI2 DT node is not well formed, see examples on https://wiki.st.com/stm32mpu/wiki/SPI_device_tree_configuration#DT_configuration_-28board_level-29
For pinmux, best is tu use CubeMx to generate it and copy/paste the spi2_pins generated lines on your own file. Note that Chip Select is not part of spi2_pins.
Regards.