SPI Chip select issue on lx2160a based custom board

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

SPI Chip select issue on lx2160a based custom board

跳至解决方案
329 次查看
shivam_kumar
Contributor I

Dear Team,

We are currently facing an issue with the SPI interface. The chip select (CS) line is expected to remain high by default; however, it is observed to be low, and there is some unexpected toggling during the boot process.

For your reference, we have attached the Device Tree Source (DTS) node,, and necessary changes are made in the RCW.

 

DTS File

&dspi2 {
status = "okay";
spidev@1 {
status = "okay";
compatible = "spidev"; # we have also tried setting the compatibility to rohm,dh2228fv
reg = <1>;
spi-max-frequency = <15000000>;
};
};

 

RCW Fields.

IIC5_PMUX=3

SDHC1_DIR_PMUX=3
SDHC1_DS_PMUX=2

Please Note: CLK, MOSI are generated correctly but CS isn't working the same.

 

164b13c4.pngc02260f5.png

 

SPI3_SOUT i.e. SPI 3 is used in the board.

The Yellow is Chip select, Green Data(MOSI), Pink Clock and Blue DIO (MISO)

This is a zoomed out image to show the time gap between Chip select Going low and the Incoming Data

0dea127f.png

 

Zoomed in version green as MOSI and yellow as Clock.

why is SPI driver is generating so much delay between CS-CLK.

e4ad65a2.png

Thanks,
Shivam

0 项奖励
回复
1 解答
170 次查看
yipingwang
NXP TechSupport
NXP TechSupport

SDHC1_DS_PMUX configuration:

Configures the functionality on SDHC1_DS
0b00 - SDHC1_DS
0b01 - GPIO_4[29]
0b10 - SPI3_SCK
0b11 - Reserved

SDHC1 and SPI3 cannot work at the same time.

在原帖中查看解决方案

0 项奖励
回复
5 回复数
314 次查看
yipingwang
NXP TechSupport
NXP TechSupport

RCW configuration:

SDHC1_DIR_PMUX=3, SDHC1_DS_PMUX=2, SDHC1_DS_PMUX=2

Please open CONFIG_SPI, CONFIG_SPI_FSL_DSPI and CONFIG_SPI_SPIDEV. 

They are have been opened in arm64 defconfig.

Moreover, dts need modification, as below, under dspi node:

spidev0: spi@0

{

reg = <0>;

compatible = "rohm,dh2228fv";

spi-max-frequency = <3000000>;

};

0 项奖励
回复
289 次查看
shivam_kumar
Contributor I

Hey Mr Wang,

We have made the changes and still the SPI behaves the same way

here is a screen shot from PCS1

shivam_kumar_0-1761126404790.png

scale:- 1s/div

this is the full capture from Power on -> Uboot

thank you

0 项奖励
回复
266 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following dts configuration:

spidev@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "rohm,dh2228fv";
spi-cpol;
spi-cpha;
reg = <1>;
spi-max-frequency = <4000000>;

}

Please go to Linux Kernel and try the following command.

spidev_test -D /dev/spidev2.1 -H -O -s 16000000 -v -p "\x00\x00\x00\x00"

 

0 项奖励
回复
236 次查看
shivam_kumar
Contributor I

Heyy yipingwang,

We booted the board via emmc with all the changes and now the CS is working fine. However, CS with SD card BOOT is still not working.
Let us know what you think about it and further steps.

Thank you

0 项奖励
回复
171 次查看
yipingwang
NXP TechSupport
NXP TechSupport

SDHC1_DS_PMUX configuration:

Configures the functionality on SDHC1_DS
0b00 - SDHC1_DS
0b01 - GPIO_4[29]
0b10 - SPI3_SCK
0b11 - Reserved

SDHC1 and SPI3 cannot work at the same time.

0 项奖励
回复