using SPI2 with imx6ullevk user space

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

using SPI2 with imx6ullevk user space

771 Views
fabio_poiatti
Contributor III

I would like to use SPI2 connected to accelerometer LSM6DSL.

I modified the DTS file including

&ecspi2 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 22 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2_1 &pinctrl_ecspi2_cs_1>;
status = "okay";

spidev2@0x00 {
compatible = "spidev";
spi-max-frequency = <5000000>;
reg = <0>;
};
};

pinctrl_ecspi2_cs_1: ecspi2_cs_grp-1 {
fsl,pins = <
MX6UL_PAD_CSI_DATA01__GPIO4_IO22 0x10b0
>;
};

pinctrl_ecspi2_1: ecspi2grp-1 {
fsl,pins = <
MX6UL_PAD_CSI_DATA02__ECSPI2_MOSI 0x100b1
MX6UL_PAD_CSI_DATA03__ECSPI2_MISO 0x100b1
MX6UL_PAD_CSI_DATA00__ECSPI2_SCLK 0x100b1
>;
};

I see /dev/spidev1.0 .... but how can I try to communicate with the accelerometer?

Can I read and write on SPI like an USB or UART etc. with some command in user space like

cat < /dev/spidev1.0 

?

0 Kudos
Reply
2 Replies

719 Views
igorpadykov
NXP Employee
NXP Employee

Hi Fabio

one can check variscite spidev tutorial:

DART-6UL SPI - Variscite Wiki 

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

0 Kudos
Reply

719 Views
fabio_poiatti
Contributor III

thanks

0 Kudos
Reply