Is there an Example of eSCI TX DMA w/ completion interrupt for MPC5634M?

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

Is there an Example of eSCI TX DMA w/ completion interrupt for MPC5634M?

811 Views
AndreiC
Contributor III

Is there any compatible example code of using eSCI with DMA that uses major loop interrupts?

I have a packet of characters of a known length to be transmitted, and I would like a DMA complete indication interrupt.

I seem to almost have it working, but need to check that I'm handling the DMA completion properly. The system reacts like I haven't cleared the interrupt. So I need to know what is required for clearing the interrupt cause, and so forth. A lot of the sample code does the DMA, but doesn't get into the positive completion indication.

Thanks,

Andrei (from The Great White North)

Tags (1)
0 Kudos
5 Replies

683 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, I am afraid we don't have such specific example. Maybe if you describe the issue more is detail we could help better way.

Are you using DMA_CIRQR register for interrupt clearing?

0 Kudos

683 Views
AndreiC
Contributor III

Just to let you know, the problem disappeared when I updated FreeRTOS from version 10.1.0 to version 10.2.1 .

0 Kudos

683 Views
AndreiC
Contributor III

Hmm, too bad. You seem to have nice example snippets hidden in other examples (and it's hard to figure out which processors are basically compatible with others).

Yes I'm using CIRQR, on the entry to the ISR, I use EDMA.CIRQR.R = 18;  To clear the dma irq for esci transmit. (magic numbers to be removed once I get this thing running)

What I'm seeing is a single successful transmission of about 150 bytes, I get the DMA complete interrupt, clear the DMA IRQ with CIRQR, clear any errors with CERQR, set the application buffer index to zero, put a null in the first element of the buffer, and exit from the interrupt routine through the standard IVOR4 context restore. 

But I'm using FreeRTOS and nothing is simple when you are juggling multiple processes. Very quickly after this transmission I get an IVOR1 on task context switch. My experience with this situation usually ended up finding an issue with interrupts happening at inconvenient times, such as not clearing an interrupt and exiting only to have the interrupt reassert immediately.

So, rather than trying to have the uninvolved try and diagnose a problem that could be a bad pointer, buffer overflow or something like that, I figured that I'd look to see if there was an example of how to handle the DMA MAJOR interrupt properly. Do I just have to clear the DMA interrupt, or is there something in the device (eSCI in this case) that I also have to clear so the device doesn't trigger the DMA interrupt?

Thanks,

Andrei

0 Kudos

683 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

In the following thread I have found an example written by colleague doing actually the same:

https://community.nxp.com/thread/502708 

DMA code portion is compatible between MPC5554 and MPC5634M.

0 Kudos

683 Views
AndreiC
Contributor III

Yes, I see.

I ended up writing a very small program that sets up the clocks, sci, dma, and interrupts, very much like the sample you refer to. I didn't turn off the transmitter in the ISR though. I'll have to give that a try.

Without turning the transmitter off, my program ran for 82 million loops, at about 1200 loops per second, until the OSJTAG disconnected (as it usually does).

A

0 Kudos