S32K148 SPI+DMA ISSUE

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

S32K148 SPI+DMA ISSUE

Jump to solution
1,545 Views
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 Kudos
Reply
1 Solution
1,525 Views
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

View solution in original post

0 Kudos
Reply
5 Replies
1,395 Views
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,526 Views
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 Kudos
Reply
1,520 Views
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 Kudos
Reply
1,497 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Do you mean Host Request?

danielmartynek_2-1686051813291.png

 

danielmartynek_0-1686051712669.png

 

Thanks,

BR, Daniel

 

 

0 Kudos
Reply
1,475 Views
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 Kudos
Reply