Hi Luis,
Thank you for your quick answer !
I moved resistors R1633, R1634, R1635, R1636 to R1724, R1725, R1726, R1727 and it works like a charm.
I did not change R1731 though.
I still have to handle the CS line as it does not toggle but I think it is due to a misconfiguration in my device tree :
&ecspi4 {
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <1>;
cs-gpios = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi4>;
status = "okay";
spidev@0x00 {
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
};
};
I am pretty new to Embedded Linux development, and device-trees, but I think that the variable cs-gpios is wrong ?
--------------------------------------------------------------------------------------------------------------------------------------------------------
Updated: Following Luis answer permitted me to get the CS pin to work, I put the updated device tree right below.
If anyone is interested in the modifications I had to make to make the spidev work on iMX6UL-EVK :
1 - Device tree (I used Yocto Project)
I disabled fec2, which is Ethernet PHY 2 as it cannot be used anymore in this configuration
#include "imx6ul-14x14-evk.dts"
/ {
spi3 {
status = "okay";
};
};
&fec2 {
status = "disabled";
};
&ecspi4 {
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio2 15 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi4>;
status = "okay";
spidev@0x00 {
compatible = "spidev";
spi-max-frequency = <80000000>;
reg = <0>;
};
};
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog_1>;
imx6ul-evk {
pinctrl_ecspi4: ecspi4grp {
fsl,pins = <
MX6UL_PAD_ENET2_TX_CLK__ECSPI4_MISO 0x100b1
MXUL_PAD_ENET2_TX_EN__ECSPI4_MOSI 0x100b1
MX6UL_PAD_ENET2_TX_DATA1__ECSPI4_SCLK 0x100b1
MX6UL_PAD_ENET2_RX_ER__ECSPI4_SS0 0x10b0
>;
};
};
};
2 - Move resistors R1633, R1634, R1635, R1636 to R1724, R1725, R1726, R1727. These resistors are near J1703 and on the back of the board (in the middle).
3 - Compile spidev_test.c for the iMX6UL and use it as following (remember to short MISO and MOSI pins) :
./a.out -s 1000000 -v
-s indicates the speed in Hz, here 1MHz.
-v is verbose mode (use -h to see all options)
Thank you Luis Casado, and Alvaro Martinez (cf. on this topic) again. I will have a look into CS pin handling tomorrow.
Arnaud