EDMA Channel always busy

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

EDMA Channel always busy

Jump to solution
411 Views
abdrhmn
Contributor I

Hi, what is the main purpose of this changes between these 2? 

Left side is RT1064 code, it is quite old I can't recall which version is that.
Right side is iMX8ulp latest version. 

When I use the right side code, I always went into if condition and return channel busy. Clearing the TCD_CITER_ELINKNO seems can solve the busy issue.

I did try to replace 

 if (EDMA_GetRemainingMajorLoopCount(handle->base, handle->channel) != 0U)
 {
    PRINTF("EDMA_BUSY \r\n");
    return kStatus_EDMA_Busy;
 }

 

with 

if ((tmpCSR != 0UL) && ((tmpCSR & DMA_CSR_DONE_MASK) == 0UL))
{
     return kStatus_EDMA_Busy;
}
 
seems can solve the issue. Is it a bug?
 

abdrhmn_0-1709922007733.png

 

0 Kudos
1 Solution
330 Views
srinivas_chilaka
NXP Employee
NXP Employee

"Comparing the driver versions, I do think that the change to EDMA_SubmitTransfer() checking for CITER != BITER makes sense, but I see how that cause an issue when there is an aborted transfer. I think the correct fix is to change the EMDA_AbortTransfer function so that it clears BITER and CITER along with the CSR. This will prevent an aborted transfer from looking like a major loop in progress to the submit transfer function."

srinivas_chilaka_0-1710476658122.png

 

 

View solution in original post

7 Replies
331 Views
srinivas_chilaka
NXP Employee
NXP Employee

"Comparing the driver versions, I do think that the change to EDMA_SubmitTransfer() checking for CITER != BITER makes sense, but I see how that cause an issue when there is an aborted transfer. I think the correct fix is to change the EMDA_AbortTransfer function so that it clears BITER and CITER along with the CSR. This will prevent an aborted transfer from looking like a major loop in progress to the submit transfer function."

srinivas_chilaka_0-1710476658122.png

 

 

317 Views
abdrhmn
Contributor I

Hi,

I apply this changes to my code, seems to works. thanks!

0 Kudos
324 Views
abdrhmn
Contributor I

Hi, 

Thanks for the feedback. I will try this change at my side and get back to you

0 Kudos
365 Views
Alejandro_Salas
NXP TechSupport
NXP TechSupport

Hello @abdrhmn 

 

It appears is a bug. What processor are you using? RT1064 or iMX8ulp?

 

Best regards.

 

Salas.

0 Kudos
362 Views
abdrhmn
Contributor I

Hi @Alejandro_Salas ,

I'm using iMX8ulp

0 Kudos
355 Views
srinivas_chilaka
NXP Employee
NXP Employee

@abdrhmn @Alejandro_Salas 

 

I have tested SDK example(SDK_2_14_1_EVK-MIMX8ULP\boards\evkmimx8ulp\driver_examples\edma\memory_to_memory), and it is working fine without any issue. 

H/W: iMX8ULP EVK

srinivas_chilaka_0-1710385782216.png

 

May I know which example are you testing? 

0 Kudos
349 Views
abdrhmn
Contributor I

Hi,
The SDK example is working for me too.
The error I faced is not from the example.. it is a customly developed for my organization.

I can't share the full code here but, the scenario is like this.
It's a console like application which using lpuart with edma.
1) It will print a welcome screen (using Lpuart_SendEdma)
2) It will need input from user. (Lpuart_receiveEdma) For example "?" to display help message
3) Use IdleLineInterrupt to process the data.
- if the interrupt flag is set, will clear the interrupt flag
- check status by calling LPUART_TransferGetReceiveCountEDMA()
- if success, will call 
LPUART_TransferAbortReceiveEDMA().

abdrhmn_0-1710387708023.png

it run in a while loop, somehow maybe the next receiving, when it run LPUART_ReceiveEDMA() again
it will always return fail

abdrhmn_1-1710388106421.png

From what I observed, it is because EDMA_GetRemainingMajorLoopCount() return non-zero that make the channel busy. 

abdrhmn_2-1710388203894.png

 

 

 

 

 
0 Kudos