Issue using UART with and without DMA

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

Issue using UART with and without DMA

跳至解决方案
2,715 次查看
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 解答
2,679 次查看
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

在原帖中查看解决方案

2 回复数
2,680 次查看
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

2,676 次查看
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