UART DMA Configuration

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

UART DMA Configuration

3,180 次查看
mdrasool_yadwad
Contributor II

Hello

   Guys I could not able to configure for Uart Dma. Can anyone please explain how it should be done.

i am getting very confused

标签 (1)
0 项奖励
回复
5 回复数

3,176 次查看
daweiyou
NXP Employee
NXP Employee

Hi:

I have no Kinetis sample code document, you could search on NXP.com for some kinetis related AN.

But I could see AN for i.MXRT, which has same UART/DMA IP with kinetis. you could refer the attached AN and sample code based on SDK.

0 项奖励
回复

3,171 次查看
mdrasool_yadwad
Contributor II

Can you explain in detail about minor and major loop

0 项奖励
回复

3,163 次查看
mjbcswitzerland
Specialist V

Hi

Kinetis DMA UART reception is explained in some detail in these two video guides:

https://www.youtube.com/watch?v=dNZvvouiqis&list=PLWKlVb_MqDQFZAulrUywU30v869JBYi9Q&index=10

https://www.youtube.com/watch?v=GaoWE-tMRq4&list=PLWKlVb_MqDQFZAulrUywU30v869JBYi9Q&index=11

 

There is a complete UART (Tx and Rx) DMA implementation for all Kinetis parts, with eDMA or simple DMA controllers (like in most KL parts), on UARTs and LPUARTs in the open source uTasker project at https://github.com/uTasker/uTasker-Kinetis
UART user's guide: https://www.utasker.com/docs/uTasker/uTaskerUART.PDF

It also simulates the UART and its DMA operation in Visual Studio for simple understanding of the underlying operations.

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or product development requirements

 

0 项奖励
回复

3,142 次查看
mdrasool_yadwad
Contributor II

Thank you for your response. I want to know the major difference between minor loop and major loop. Can you explain that.

0 项奖励
回复

3,123 次查看
mjbcswitzerland
Specialist V

Hi

For your use you need the minor loop to be set to 1 so that there is a single DMA transfer each time the Tx buffer is empty.

For other applications it is possible for the minor loop to be set to a higher value so that each DMA trigger (of the major loop which defines after how many triggers the complete operation terminates) causes a multiple of minor loop transfers to be executed.

As I noted in the first line, the UART needs the minor loop to be set to 1 and the major loop defines  how many bytes would be sent in total..

Most peripherals (without FIFOs) need the manor loop set to 1 otherwise there will be buffer under or overrun if multiple fast transfers are performed.

* Note however that the eDMA counters are in bytes and so the above is true for byte oriented peripherals. Long word oriented peripherals would, for example, in fact use the value 4 (4 bytes) instead of 1.

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or product development requirements

 

0 项奖励
回复