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

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

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

1,543 次查看
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 回复数

1,098 次查看
autolan22
Contributor III

ditto

0 项奖励
回复

1,116 次查看
TysonHu
Contributor II

Same question. Is there any solution?

1,485 次查看
simiongustavo
Contributor I

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