IMXRT1024 LPUART EDMA Loopback Example Without Console/Keyboard Intervention

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

IMXRT1024 LPUART EDMA Loopback Example Without Console/Keyboard Intervention

跳至解决方案
1,028 次查看
Lukas_Frank
Senior Contributor I

Hi all,

 

I am just trying to observe my receive buffer in continuous transfer while I changing transmit buffer content with SDK example (lpuart_edma_transfer). So here are my main changes in SDK example:

 

uint16_t iteratorXfer;

while (1)
{
	/* If RX is idle and g_rxBuffer is empty, start to read data to g_rxBuffer. */
	if ((!rxOnGoing) && rxBufferEmpty)
	{
		rxOnGoing = true;
		LPUART_ReceiveEDMA(DEMO_LPUART, &g_lpuartEdmaHandle, &receiveXfer);
	}

	/* If TX is idle and g_txBuffer is full, start to send data. */
	if ((!txOnGoing) && txBufferFull)
	{
		txOnGoing = true;
		LPUART_SendEDMA(DEMO_LPUART, &g_lpuartEdmaHandle, &sendXfer);
	}

	/* If g_txBuffer is empty and g_rxBuffer is full, copy g_rxBuffer to g_txBuffer. */
	if ((!rxBufferEmpty) && (!txBufferFull))
	{
		//memcpy(g_txBuffer, g_rxBuffer, ECHO_BUFFER_LENGTH);
		for(iteratorXfer=0; iteratorXfer< sendXfer.dataSize; iteratorXfer++)
		{
			g_txBuffer[iteratorXfer] = iteratorXfer % 2;
		}
		sendXfer.data     = g_txBuffer;
		sendXfer.dataSize = sizeof(g_txBuffer) - 1;

		rxBufferEmpty = true;
		txBufferFull  = true;
	}
}

 

I just want to observe the data changes in the memory addresses. But this example expects us to input with the keyboard. I do not want keyboard intervention. I am just trying the simulate a real-life scenario in debug time. What should I do? 

 

Thanks and Regards.

标记 (1)
0 项奖励
回复
1 解答
1,016 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
It needs to configure a DMA channel to store the UART received data to RAM, then you can observe the data changes in the RAM.
According to your statement, you don't want to use the keyboard to input the character to the UART, I think it's okay, however, you need to use another tool or board to transmit the characters to the UART to replace the keyboard.
Hope this is clear.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,017 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
It needs to configure a DMA channel to store the UART received data to RAM, then you can observe the data changes in the RAM.
According to your statement, you don't want to use the keyboard to input the character to the UART, I think it's okay, however, you need to use another tool or board to transmit the characters to the UART to replace the keyboard.
Hope this is clear.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复