S32K148 SPI+DMA ISSUE

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

S32K148 SPI+DMA ISSUE

ソリューションへジャンプ
4,178件の閲覧回数
zhouxiang1
Contributor II

zhouxiang1_0-1686037195470.pngzhouxiang1_0-1686037195470.png

When I use spi+dma as master to transmit 6 bytes, CS is controlled by GPIO, the TX interrupt happens at the end of the forth byte, but not at the end of the last byte. (set CS to HIGH in the TX interrupt) What can I do? Thanks!

0 件の賞賛
返信
1 解決策
4,158件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @zhouxiang1,

By the TX interrupt, I understand this is an interrupt at the end of the DMA transfer.

The DMA transfer completes as soon as the data are transfered to the LPSPI TX FIFO not at the end of the LPSPI transfer.

Why do you need a GPIO CS? The LPSPI module support continuous transfer mode that keeps the CS asserted between frames.

 

Regards,

Daniel

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
4,028件の閲覧回数
zhouxiang1
Contributor II

I solve it. CS is controlled by GPIO, spi transfer is controlled by dma, deactive CS in the LPSPI interrupt (Transfer Complete Interrupt), but not in the dma interrupt.

4,159件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @zhouxiang1,

By the TX interrupt, I understand this is an interrupt at the end of the DMA transfer.

The DMA transfer completes as soon as the data are transfered to the LPSPI TX FIFO not at the end of the LPSPI transfer.

Why do you need a GPIO CS? The LPSPI module support continuous transfer mode that keeps the CS asserted between frames.

 

Regards,

Daniel

0 件の賞賛
返信
4,153件の閲覧回数
zhouxiang1
Contributor II

In some situation, CS need to sync with some other signals. For example, active CS first, and wait a postedge on some GPIO, then start SPI transmition. Could I implement this kind of requirement with hardware CS? 

0 件の賞賛
返信
4,130件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Do you mean Host Request?

danielmartynek_2-1686051813291.pngdanielmartynek_2-1686051813291.png

 

danielmartynek_0-1686051712669.pngdanielmartynek_0-1686051712669.png

 

Thanks,

BR, Daniel

 

 

0 件の賞賛
返信
4,108件の閲覧回数
zhouxiang1
Contributor II

Thanks for your suggestion about TRGMUX, I will read the chapter later. Are there some configurations what I can do to enable a interrupt at the end of LPSPI transfer?

0 件の賞賛
返信