How to get slave details of a module connected to imx6q over SPI?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get slave details of a module connected to imx6q over SPI?

838 Views
sujay1
Contributor V

Hi,

I'm using imx6q reference board with yocto BSP.

I've configured the dts as:

&ecspi1 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 9 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
spidev@0x00 {
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
};

On flashing the image I got /dev/spidev0.0

and when I do echo 1 > /dev/spidev0.0 I can see a spike in the clock line of the module.

Is there any way I can detect a module connected to spidev0.0? 

In i2c we can get the slave address is there anything similar in SPI? Also is there anyway I can do this with a C application?

Labels (1)
Tags (2)
0 Kudos
Reply
3 Replies

764 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sujay

opposite to i2c seems there is no way to detect if module is connected,

as spi does not use addressing during communication. So it always returns

some data.  As for spidev, one can find example on:

VAR-SOM-MX6 SPI - Variscite Wiki 


Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

764 Views
sujay1
Contributor V

Hi Igor,

 

I found this link 

https://www.ite.org/pub/?id=acaf6aca-d1fd-f0ec-86ca-79ad05a7cab6 

for ATC 5201 standards.

 

and on page 53 it states, spi has a basic and expanded address, is this something we have to configure in dts? or is it the slave id?

 

Thanks

0 Kudos
Reply

764 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sujay

this paper describes transportation controller architecture, not

spi protocol.

Best regards
igor

0 Kudos
Reply