Issue using UART with and without DMA

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

Issue using UART with and without DMA

Jump to solution
1,655 Views
biafra
Senior Contributor I

Hi everyone,

 

I've found an issue using DMA with UART.

Up 'til now I've used MK66 on my projects, with SDK 2.6.0, handling two serial connections using UARTs, one with DMA (115200 bps) and one without it (4800 bps): all was working fine.

From now on I'm going to use RT1064, with SDK 2.11.0, handling the same two serial connections using LPUARTs, and the problems have started. After few debugging hours, I've discovered that the problem is in the new SDK, and it's the same for both MK66 and RT1064.

For MK66 in SDK 2.6.0 (and up to SDK 2.9.0) in the UART_TransferCreateHandle() there is the instruction:

s_uartIsr = UART_TransferHandleIRQ;

that sets the s_uartIsr variable to the irq handling function. This is the only assignment to the s_uartIsr variable.

Starting from SDK 2.10.0, in addition to the instruction above, in the UART_TransferCreateHandleEDMA() there is the instruction:

s_uartIsr = UART_TransferEdmaHandleIRQ;

So, if I use one UART with DMA and another without it, the s_uartIsr is assigned two times with different values, but it is used in both cases leading to a fault.

I know that a workaround is to use or not to use DMA on both peripherals, but I think that the solution is to have a s_uartIsr array variable, one for every peripheral.

 

Many thanks

Biafra

 

1 Solution
1,619 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @biafra ,

Yes, you are right. The driver gives a single interrupt service function pointer to all LPUART IRQhandler. This leads to inflexibility in use. I think it's easy for you to modify the code. I'll report it to software team.

 

Regards,

Jing

View solution in original post

2 Replies
1,620 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @biafra ,

Yes, you are right. The driver gives a single interrupt service function pointer to all LPUART IRQhandler. This leads to inflexibility in use. I think it's easy for you to modify the code. I'll report it to software team.

 

Regards,

Jing

1,616 Views
biafra
Senior Contributor I

Hi @jingpan,

 

Many thanks for your answer.

Sure, it's easy to modify the code.

The main purpose of my post was right to report it to developers team.

 

Many thank

Biafra