LPSPI after Lpspi_Ip_AsyncTransmit stays in BUSY state

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPSPI after Lpspi_Ip_AsyncTransmit stays in BUSY state

ソリューションへジャンプ
3,403件の閲覧回数
sstelmak
Contributor III

Lpspi_Ip_AsyncTransmit() call gets executed once with expected  SPI waveforms.

Other calls are rejected because drives stays in LPSPI_IP_BUSY state.

I have a workaround to call Lpspi_Ip_Cancel() when BUSY state is reported:

if (Lpspi_Ip_GetStatus() == LPSPI_IP_BUSY) Lpspi_Ip_Cancel();

Lpspi_Ip_AsyncTransmit();

This works but I won't want to keep using that cancel call.

What can keep driver in BUSY state even after all needed data are properly Tx/Rx by SPI?

I use RTD 4.0.0, SPI with Tx/Rx DMA channels. DMA does not have global/transfer/scatter configs, also no interrupt callback.

 

 

ラベル(1)
0 件の賞賛
返信
1 解決策
2,362件の閲覧回数
sstelmak
Contributor III

I ended up with writing my own function using synchronous transmit as example. It was possible to use fifo and have function that does not use interrupts(well, almost) and dma and returns immediately. That works similar to Lpspi_Ip_AsyncTransmit for my project.

元の投稿で解決策を見る

8 返答(返信)
2,363件の閲覧回数
sstelmak
Contributor III

I ended up with writing my own function using synchronous transmit as example. It was possible to use fifo and have function that does not use interrupts(well, almost) and dma and returns immediately. That works similar to Lpspi_Ip_AsyncTransmit for my project.

2,375件の閲覧回数
prasadrashinkar
Contributor II

Hello Daniel,

We have the same issue For S32k44, configured LPSPI using EB tresos and tried to transmit data using Lpspi_Ip_AsyncTransmit()

call gets executed once Other calls are rejected because the drives stays in LPSPI_IP_BUSY state .

Can please share Example project of S32K344(with EB tresos configuration) for Lpspi_Ip_AsyncTransmit(); using Dma ?

 

タグ(3)
0 件の賞賛
返信
2,368件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Please create a new thread,

 

Thank you,

Daniel

0 件の賞賛
返信
3,383件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @sstelmak,

I understand the driver never becomes IDLE after the transfer.

It would help if you could share the project so that I can test it.

Did you enable DMA interrups in the IntCtrl_Ip driver?

 

Regards,

Daniel

0 件の賞賛
返信
3,372件の閲覧回数
sstelmak
Contributor III

Hello,

I can't post entire project per company policies, it would be ok to email it directly.

Attached is the mex and few relevant c files. 

DMA or SPI interrupts are not configured. This is because I have restriction for micro throughput and looking for possibility to skip unnecessary calls.

 

0 件の賞賛
返信
3,361件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @sstelmak,

The driver requires the DMA interrupts.

Have a look at the Lpspi_Flexio_Ip_Transfer_S32K344 example, where the FlexIO_SPI driver uses DMA.

 

BR, Daniel

0 件の賞賛
返信
3,339件の閲覧回数
sstelmak
Contributor III

Hello,

I added DMA ISRs (I use same DMA channels as the example) to IntCtrl_Ip

sstelmak_1-1721932993339.png

Nothing changed after that, and I didn't see that any of those interrupts were called.

 

 

 

 

0 件の賞賛
返信
3,322件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Try enabling Global config in the in the DMA driver.

Please share the whole project (or a test project that can demonstrate the issue,) so that I can test it.

 

 

Thank you,

BR, Daniel

0 件の賞賛
返信