cancel
Showing results for 
Search instead for 
Did you mean: 

Why clear the DMAR bit in UART DMA receive interrupt subroutine

MStuc.1
Associate II

Why should I clear the DMAR bit in the UART DMA receive interrupt subroutine?

At the moment I disable the DMA TC interrupt and the DMA Mode for reception (DMAR) at the top of my interrupt routine.

At the end of the subroutine I enable the uart dma receiver again.

This code works well.

But If I do not disable the DMA Mode for reception (DMAR) it does no longer work properly but I don't know why this makes such a difference?

Any thought on that topic?

Kind regards Mathias

3 REPLIES 3
TDK
Guru

The answer to your question will depend on your code. You certainly don't need to clear it in general. If you're receiving a fixed length message, you should clear it and re-initialize the next transfer.

If you feel a post has answered your question, please click "Accept as Solution".
MStuc.1
Associate II

Thanks for the reply!

Yes, I receive a fixed length message. But still, why should I clear it. It is nothing written that this flag resets something?

> The answer to your question will depend on your code.

JW