i.MX6 SPI Slave mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
9,184件の閲覧回数
stevekwon
Contributor II

I'm wanting to use the SPI in slave mode (as a platform_device) in Linux 3.0.35.  Is this possible?  I've set the SPI registers (slave mode, CPOL/CPHA etc) but I don't seem to be getting anything in ECSPIx_RXDATA register when the master on the other side is sending data.  I've checked the SPI lines and it seems valid.

Here are my SPI register values:

ECSPI2_CONREG= 0x01f00001
ECSPI2_CONFREG= 0x00000000
ECSPI2_INTREG= 0x00000024
ECSPI2_DMAREG= 0x00010001
ECSPI2_STATREG= 0x00000003

Is there anything obviously wrong in the register values or do I need to set registers other than the SPI specific registers to make it work?

ラベル(7)
タグ(4)
1 解決策
4,278件の閲覧回数
cheersalam
Contributor II

You are not setting Chip Select signal polarity. Set the value of SS_POL as 1 (Active high) on ECSPIx_CONFIGREG register for slave mode.

元の投稿で解決策を見る

0 件の賞賛
返信
10 返答(返信)
4,278件の閲覧回数
cheersalam
Contributor II

Steve

If you set burst length as 32 then you will get second word as zeros. And it happens again after 128 words.

I played with all the registers and the results are all same. ss_ctl is not supported in slave mode. this issue is something deeper.

I am still trying to find a solution for it.

If you find something interesting please update us.

Alam

0 件の賞賛
返信
4,279件の閲覧回数
cheersalam
Contributor II

You are not setting Chip Select signal polarity. Set the value of SS_POL as 1 (Active high) on ECSPIx_CONFIGREG register for slave mode.

0 件の賞賛
返信
4,278件の閲覧回数
sebimohan
Contributor III

Hi Mohammad Alam

   I am writing a custom driver to enable spi slave in i.MX6 using DMA.  Do we need to enable any type of clock configuration or clock form i.MX6 side for spi slave to work?

Thanks

Sebi

0 件の賞賛
返信
4,278件の閲覧回数
robert99
Contributor I

Hello Sebi,

I'm just curious about your success writing an i.MX6 SPI Slave driver supporting DMA? Can you give me a brief conclusion about your experiences?

Thank's a lot,

Robert

0 件の賞賛
返信
4,278件の閲覧回数
peterw
Contributor III

Hi Seb,

I also started with a custom SPI driver using the DMA. Can you share your SPI slave configurations?

Thanks

Peter

0 件の賞賛
返信
4,278件の閲覧回数
robert99
Contributor I

Hello Peter,

I'm just curious about your success writing an i.MX6 SPI Slave driver supporting DMA? Can you give me a brief conclusion about your experiences?

Thank's a lot,

Robert

0 件の賞賛
返信
4,278件の閲覧回数
kiruthikavarada
Contributor III

Hi Steve,

  Can you share your custom SPI slave driver using DMA on IMX6

  My email is kiruthikanv@gmail.com

 

Thanks,

Kiruthika

0 件の賞賛
返信
4,278件の閲覧回数
robert99
Contributor I

Hello Kiruthika,

I'm just curious about your success writing an i.MX6 SPI Slave driver supporting DMA? Can you give me a brief conclusion about your experiences?

Thank's a lot,

Robert

0 件の賞賛
返信
4,278件の閲覧回数
YixingKong
Senior Contributor IV

Steve, please click Correct Answer/Helpful Answer if your question had been answered.

Thanks,

Yixing

0 件の賞賛
返信
4,278件の閲覧回数
fushi_peng
NXP Employee
NXP Employee

Is the BURST_LENGTH data had received from bus ?

Did  you fixed TX_FIFO before receive data ?

Can you check the  interrupt  of RFEN RDREN RREN  , is these  triggered? 

0 件の賞賛
返信