Hello all,
I am using S32K3X4EVB-Q172 development board. I have succesfully implemented interrupt based UART receive however I want to use DMA but i could not find any example. Is there any example of using DMA with UART?
I am using latest MCAL SDK.
Best regards,
Solved! Go to Solution.
Hi,
this could be caused by cache. Try to either invalidate the address for the cache of the send buffer or place the buffer in a noncacheable memory.
#pragma GCC section bss ".mcal_bss_no_cacheable"
uint8_t tx_data[15];
#pragma GCC section bss
BR, Petr
Hello NXP TechSupport,
may I ask another question?
According to this example,
there is only UART1 for receiving and sending data in while loop,
if I add another UART3(interrupt mode) for communicating with this UART1, even if the DMA callback was triggered with event "LPUART_UART_IP_EVENT_END_TRANSFER", my buffer(Rx_Buffer) is still keeping empty, I don't know what's wrong with my procedures.
please help me, thanks~
*This code flow below is fine while interrupt mode.
while(1)
{
lpuartStatus = Lpuart_Uart_Ip_AsyncReceive(UART_LPUART_INTERNAL_CHANNEL_1, Rx_Buffer, length);
if (LPUART_UART_IP_STATUS_SUCCESS != lpuartStatus)
{
return FALSE;
}
//Async send would be OVERRUN during 1.8Mbps baud rate
lpuartStatus = Lpuart_Uart_Ip_SyncSend(UART_LPUART_INTERNAL_CHANNEL_3, Tx_Buffer,length,1000);
if (LPUART_UART_IP_STATUS_SUCCESS != lpuartStatus)
{
return FALSE;
}
do
{
lpuartStatus = Lpuart_Uart_Ip_GetReceiveStatus(UART_LPUART_INTERNAL_CHANNEL_1, &remainingBytes);
} while (LPUART_UART_IP_STATUS_BUSY == lpuartStatus && 0 < T_timeout--);
}
(updated)
If I change the priority of DMA channel(UART RX) from 0 to 2, I can receive part of some message from UART3, like below attachment.
Hi,
this could be caused by cache. Try to either invalidate the address for the cache of the send buffer or place the buffer in a noncacheable memory.
#pragma GCC section bss ".mcal_bss_no_cacheable"
uint8_t tx_data[15];
#pragma GCC section bss
BR, Petr
Thank you so much. I will check this example further.