OKMX6UL-C2 nand 256m 添加SPI驱动不能正常工作
本帖最后由 Xiaoooo 于 2019-12-7 18:35 编辑使用OKMX6UL-C2 nand 256m添加了两路SPI驱动,烧录后显示了spidev0.0和spidev1.0,但是使用测试代码输出全为0,连接我们自己的设备通信也不成功。设备树文件:
&ecspi1 {
compatible = "fsl,imx51-ecspi";
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 26 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
spidev@0{
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
status = "okay";
};
};
&ecspi2 {
compatible = "fsl,imx51-ecspi";
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";
spidev@0{
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
status = "okay";
};
};
pinctrl_ecspi1: ecspi1grp {
fsl,pins = <
MX6UL_PAD_CSI_DATA07__ECSPI1_MISO 0x100b1
MX6UL_PAD_CSI_DATA06__ECSPI1_MOSI 0x100b1
MX6UL_PAD_CSI_DATA04__ECSPI1_SCLK 0x100b1
MX6UL_PAD_CSI_DATA05__ECSPI1_SS0 0x100b1
>;
};
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX6UL_PAD_CSI_DATA03__ECSPI2_MISO 0x100b1
MX6UL_PAD_CSI_DATA02__ECSPI2_MOSI 0x100b1
MX6UL_PAD_CSI_DATA00__ECSPI2_SCLK 0x100b1
MX6UL_PAD_CSI_DATA01__ECSPI2_SS0 0x100b1
>;
};
您是按照应用笔记上的办法改的是吧,引脚的其他复用是否关掉了,看一下硬件是否有问题,如果还不行,把修改内容都发给我,我再看看
页:
[1]