How to use s32k146 uart + dma to receive data which the length is variable?

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

How to use s32k146 uart + dma to receive data which the length is variable?

1,456 Views
biyangdong
Contributor II

Hi:

I have too many uart data to receive, and the frame length is not sure, and I do not want so many uart interrupt, so I want use DMA, but the dam generally should give the numbers of  received data,i get some idears  which is uesd in stm32.

Roughly follow the following steps:

step1:  enbale the uart dma receive

step2:  set the dma receive buffer data number with a larger number than your send,and the dma will store the data to buffer without stop

step3: once you complete a frame data,the bus is idle,it will be trigger the idle interrupt

step4: in the uart idle interrupt handler functions,you can calculate how many bytes you have received

step5: deal with the received data,and clean the flags,than received the next frames

I have some problems about this resolves:

1. if the method above is suitable for s32k14x too?

2. i cant find the idle interrupt in the mapping,how i can create a idle interrupt and do some logical processing in the IRQHandler functions?

11111.png2222.png3333.png

3. how can I get the dma store buffer data number when the idle interrupt is triggered?

4.is there example about the  uart + idle interrupt + dma ?

thank you for your reply。

3 Replies

1,011 Views
autolan22
Contributor III

ditto

0 Kudos
Reply

1,029 Views
TysonHu
Contributor II

Same question. Is there any solution?

1,398 Views
simiongustavo
Contributor I

Hello, I have the same problem, did you manage to find a solution?