S32K3XX - DMA transfer block

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

S32K3XX - DMA transfer block

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

Hi,

I'm working with the S32K344 MCU and need to implement block-based data transfers via DMA from peripherals like SPI. My goal is to queue multiple blocks of data for continuous streaming without data loss, starting from the very first data block.

Requirements:

  • Wait until 20 data samples are collected

  • Trigger DMA transfer using the Tx watermark condition

Questions:

In my application, I want to wait until 20 data samples are available, and only then trigger a DMA transfer under the Tx watermark condition.

Could you please advise on:

  • How to configure this properly in S32DS?

  • Any recommended settings in DMA TCD, SPI FIFO, or interrupt configuration?

  • Whether there are any examples or best practices for queuing multiple DMA transfers for seamless streaming?

Thanks in advance for your help!

タグ(1)
0 件の賞賛
返信
1 解決策
3,387件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @DiaDev,

This was already discussed in this thread:

https://community.nxp.com/t5/S32K/S32K3-DMA-Block-Based-Queuing-for-Continuous-Peripheral-Data/m-p/2...

The LPSPI modules have just 4x32 bit RX FIFOs.

danielmartynek_0-1749451966427.png

 

The DMA can be triggered by the LPSPI module when there are 4 words received.

The RTD SPI drivers do not use the FIFO though.

Anyway, there are these RTD examples for your reference:

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-SPI-Transmit-amp-Receive-Using-Inte...

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-Continuous-SPI-Transmit-amp-Receive...

 

BR, Daniel

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
3,388件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @DiaDev,

This was already discussed in this thread:

https://community.nxp.com/t5/S32K/S32K3-DMA-Block-Based-Queuing-for-Continuous-Peripheral-Data/m-p/2...

The LPSPI modules have just 4x32 bit RX FIFOs.

danielmartynek_0-1749451966427.png

 

The DMA can be triggered by the LPSPI module when there are 4 words received.

The RTD SPI drivers do not use the FIFO though.

Anyway, there are these RTD examples for your reference:

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-SPI-Transmit-amp-Receive-Using-Inte...

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-Continuous-SPI-Transmit-amp-Receive...

 

BR, Daniel

 

 

0 件の賞賛
返信
3,303件の閲覧回数
DiaDev
Contributor III
Hi @danielmartynek,
I'm working on the S32K344 platform using the LPSPI module in slave mode with DMA support. My use case is as follows:

The LPSPI slave is expected to receive 40 bytes of data per transfer.

This transfer occurs 5 times in succession, resulting in a total of 200 bytes.

I want the DMA RX interrupt (ISR) to be triggered only after all 5 transfers are complete, i.e., after the full 200 bytes have been received.

In the DMA Configuration, I have enabled:

Global Configuration
Transfer Configuration

My questions:

How can I configure the DMA (using RTD) to accumulate these 5 transfers and trigger an interrupt only after receiving the total 200 bytes?

If this is not possible, would I need to handle each 40-byte transfer individually in the DMA RX ISR and use a counter in software to detect when 5 transfers have completed? If so, how can this be implemented?

Any guidance would be greatly appreciated.

Thanks in advance!
タグ(2)
0 件の賞賛
返信
3,297件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @DiaDev,

This is not possible. The DMA does not have any buffer.

Although the LPSPI does have a buffer, it is just 4x32bit, and the RTD MCAL/IP SPI drivers do not use it.

You don't need to configure the DMA if you use RTD.

The SPI drivers configures the DMA - Refer to the examples I linked here.

 

BR, Daniel 

0 件の賞賛
返信
3,284件の閲覧回数
DiaDev
Contributor III
Then can you share me link?
0 件の賞賛
返信
3,260件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @DiaDev,

There are two examples linked in this thread already by me.