S32K148 SPI+DMA ISSUE

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

S32K148 SPI+DMA ISSUE

跳至解决方案
1,068 次查看
zhouxiang1
Contributor II

zhouxiang1_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 解答
1,048 次查看
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 回复数
918 次查看
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.

1,049 次查看
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 项奖励
1,043 次查看
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 项奖励
1,020 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Do you mean Host Request?

danielmartynek_2-1686051813291.png

 

danielmartynek_0-1686051712669.png

 

Thanks,

BR, Daniel

 

 

0 项奖励
998 次查看
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 项奖励