cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Read in uboot - SPI2

Ganesh.T
Associate II

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..

1 REPLY 1
PatrickF
ST Employee

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.

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.