S32K314 UART DMA transfer, how to call Lpuart_1_Uart_Ip_DmaTxCompleteCallback();

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

S32K314 UART DMA transfer, how to call Lpuart_1_Uart_Ip_DmaTxCompleteCallback();

跳至解决方案
823 次查看
gufengzi
Contributor III

with S32K314, I am debugging Uart_AsyncSend on PIN140/PTC7/LPUART1_TX.

I plan to use DMA mode, the MCAL is generated with tresos studio 28.2

I can captuer the UART output data with oscilloscope, and the data is right what I send out.

But unfortunately, only one time transfer is OK. 

After one time transfer, UartState/IsTxBusy is always '1'.

BytesRemaining is always the data length of what I sent and won't decrease, although the data already appeared on oscilloscope screen.
I think it is caused by Lpuart_1_Uart_Ip_DmaTxCompleteCallback().
After one major DMA loop, Lpuart_1_Uart_Ip_DmaTxCompleteCallback() will be triggered by interrupt. Is it right?
With PE debugger, I can not get the breakpoint in  Lpuart_1_Uart_Ip_DmaTxCompleteCallback().
So I think there must be any errors to trigger Lpuart_1_Uart_Ip_DmaTxCompleteCallback().
could you tell me how to trigger Lpuart_1_Uart_Ip_DmaTxCompleteCallback() after UART DMA transfer completed? 
Thanks

IsTxBusy.jpgcallback.jpgEB_CFG.jpg

 

 

0 项奖励
回复
1 解答
717 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @gufengzi,

The RM driver is the Resource driver in your RTD 2.0.3 configurator.

Anyway, the NVIC ISER registers are configured in Platform_Init().

Do you call the function?

 

Thank you,

BR, Daniel

 

在原帖中查看解决方案

0 项奖励
回复
7 回复数
810 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @gufengzi,

Did you enable the DMA interrupts in the PLATFORM configurator?

 

Thank you

0 项奖励
回复
807 次查看
gufengzi
Contributor III

I already checked DMATCD0_IRQn.

interrupt_enabled.jpg

0 项奖励
回复
788 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @gufengzi,

I don't see the handler funtions in the screenshot you posted.

 

An example is attached to the case, it is for S32DS, but the configurator is very similar.

 

Regards,

Daniel

0 项奖励
回复
780 次查看
gufengzi
Contributor III

do you think the handler is Dma0_Ch0_IRQHander?

I already configured it.

dma_handler.jpg

0 项奖励
回复
761 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Thank you, that looks correct.

What about the DMAMUX configuration in the RM configurator, can you share it?

Or can you share the whole project so that I can check it and test it on my side?

If you don't want to share it here, consider creating a support ticket.

 

Regards,

Daniel

0 项奖励
回复
749 次查看
gufengzi
Contributor III

hello Daniel,

I can not find DMAMUX and RM in my EB project.

Sorry the whole project can not be shared. how to create a support ticket?

Additionally, after I set 0xE000E100 to "1",  it works well. 

I think the reason is that I did not set the corresponding NVIC_ISER correctly.

Could you tell me how to set NVIC_ISER bit in EB project?

ThanksE000E100.jpg

EB.jpgMCL.jpg

0 项奖励
回复
718 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @gufengzi,

The RM driver is the Resource driver in your RTD 2.0.3 configurator.

Anyway, the NVIC ISER registers are configured in Platform_Init().

Do you call the function?

 

Thank you,

BR, Daniel

 

0 项奖励
回复