DMA transfer timeout

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

DMA transfer timeout

1,553 次查看
thediptendu
Contributor I

Hello,

I am using i.MX8 hardware and I am using DMA interface to transfer data. But I have to poll till transfer completes. I am planning to implement timeout for DMA transfer. what would be the ideal timeout I will use? 

Thanks in advance.

0 项奖励
回复
5 回复数

1,526 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @thediptendu!
Thank you for contacting NXP Support!

There are eDMA example code in the path like M4_SDK/boards/mekmimx8qx/driver_examples/edma and boards/mekmimx8qx/driver_examples/flexcan/loopback_edma_transfer. In these example code, we can see that after we start the eDMA transfer, we need to wait for the complete signal to be true to know that the transfer is done.

During the time that eDMA is transferring, actually the program don't need to poll the complete signal in a loop, and it can do other things. (In the example code, it don't have other things to do, so that's why it's waiting in a while loop) But when the program want to know whether the eDMA transfer is done before it can start the next transfer, it need to wait for the complete signal to be true.

So I guess the "timeout" customer want is actually a timer, like the one in boards/mekmimx8qx/driver_examples/tpm/timer, so that they can check the eDMA complete signal after a period of time.

Best Regards!

Chavira

0 项奖励
回复

1,521 次查看
thediptendu
Contributor I

Hello Chavira,

Thanks for replying. If we are waiting in while loop, then we are continuously waiting. what if the signal never becomes true? in that scenario, the code is stuck there. So my intention to implement a timeout and return FAIL if it does not come out of the loop.

>> During the time that eDMA is transferring, actually the program don't need to poll the complete signal in a loop, and it can do other things.

How we can do other things while polling a signal?

>> M4_SDK/boards/mekmimx8qx/driver_examples/edma and boards/mekmimx8qx/driver_examples/flexcan/loopback_edma_transfer.

Please send me the link to refer.

Thanks,

Diptendu

0 项奖励
回复

1,492 次查看
Chavira
NXP TechSupport
NXP TechSupport

HI @thediptendu!

Then you can set up a timer. When the timer is triggered, it will check the eDMA complete signal. And by doing this, it don't need to poll the complete signal in a loop.

https://github.com/nxp-mcuxpresso/mcux-sdk-examples/tree/main/mekmimx8qx/driver_examples/edma

https://github.com/nxp-mcuxpresso/mcux-sdk-examples/tree/main/mekmimx8qx/driver_examples/flexcan/loo...

Best Regards!

Chavira

0 项奖励
回复

1,483 次查看
thediptendu
Contributor I
破坏者
Hi Chavira,

Implementing timer will lead to design change in my code and at this point of time, I feel it is not good idea. So I am wondering if any timeout I can use while polling. Do you have any suggestion?
Thanks,
Diptendu
0 项奖励
回复

1,474 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @thediptendu!

Sorry but I don't see there is other ways to implement such timeout.

Best regards!

Chavira

0 项奖励
回复