imx6q ecspi slave mode

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

imx6q ecspi slave mode

Jump to solution
2,070 Views
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

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,239 Views
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...

View solution in original post

0 Kudos
3 Replies
1,239 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

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

Thanks a lot,

Alejandro

0 Kudos
1,240 Views
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 Kudos
1,239 Views
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 Kudos