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

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

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

Jump to solution
624 Views
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 Kudos
Reply
1 Solution
518 Views
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

 

View solution in original post

0 Kudos
Reply
7 Replies
611 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @gufengzi,

Did you enable the DMA interrupts in the PLATFORM configurator?

 

Thank you

0 Kudos
Reply
608 Views
gufengzi
Contributor III

I already checked DMATCD0_IRQn.

interrupt_enabled.jpg

0 Kudos
Reply
589 Views
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 Kudos
Reply
581 Views
gufengzi
Contributor III

do you think the handler is Dma0_Ch0_IRQHander?

I already configured it.

dma_handler.jpg

0 Kudos
Reply
562 Views
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 Kudos
Reply
550 Views
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 Kudos
Reply
519 Views
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 Kudos
Reply