imx6q ecspi slave mode

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

imx6q ecspi slave mode

跳至解决方案
3,240 次查看
andrewyerokhin
Contributor II

Hello everyone,

I'm trying to enable ecspi1 slave mode on imx6q, linux kernel version is 3.0.35. I used following patch:

i.MX6 ESPI slave mode support patch based on rel_imx_3.0.35_4.1.0

Everything works almost fine for 32bpw, except for one problem. First word of each message from IMX is 0x00000000, independent of what actualy was sent from IMX. I verified that spi driver on IMX stores correct values to TXDATA register, and TXCNT field of TESTREG matches the number of words stored in tx fifo. But MISO line remains low when first word is being transmitted.

Looks like this is hardware problem. Is it possible to workaround it somehow?

Thanks a lot

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
2,409 次查看
andrewyerokhin
Contributor II

Hello,

Thanks for your reply. Problem is solved now, this was mostly my mistake.

The reason was that iMX SPI transmitter requires chipselect edges to be generated by spi master, even when SS_CTL=0. That wasn't clear to me after reading IMX6DQRM.

After I configured spi master to change SS level between transfers, all transmission problems gone away:)

Talking about "polarity changes" on the miso line, well, probably that was a garbage from TxFIFO sent by spi transmitter...

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,409 次查看
alejandrolozan1
NXP Employee
NXP Employee

Hi,

PengFushi, Do you have an idea of what could be the problem?

Thanks a lot,

Alejandro

0 项奖励
回复
2,410 次查看
andrewyerokhin
Contributor II

Hello,

Thanks for your reply. Problem is solved now, this was mostly my mistake.

The reason was that iMX SPI transmitter requires chipselect edges to be generated by spi master, even when SS_CTL=0. That wasn't clear to me after reading IMX6DQRM.

After I configured spi master to change SS level between transfers, all transmission problems gone away:)

Talking about "polarity changes" on the miso line, well, probably that was a garbage from TxFIFO sent by spi transmitter...

0 项奖励
回复
2,409 次查看
andrewyerokhin
Contributor II

Some additional details:

1) Spi master device is omap am33, and it operates properly. I checked that, connecting it's mosi and miso to each other.

2) First word disappears only from miso line of IMX, mosi line is good.

3) Polarity of signal on miso line becomes high in inactive state after few transfers. This behaviour should be controlled with DATA_CTL field of CONFIGREG, but looks like it not depends at all on value of that field... So first word of each message from IMX is read as 0x00000000, but after few transfers it becomes 0xffffffff.

Did someone faced such problem with spi on imx6q?

Or did someone succeeded to enable spi slave mode on imx6q?:)

Thanks

0 项奖励
回复