Hi @Lukas_Frank
Welcome to the RT world.
Your test result is totally correct, as you are new to the UART, let me tell you some of my experience.
1. LPUART receive is the 4 datawords in the receive FIFO Buffer depth in default
You receive: lpuaaaaaaaaa...
It because you have send: Lpuart polling example Board will send back received characters
So, the receive will remember your first lpua, then when you receive call it, and your code is:
while (1)
{
LPUART_ReadBlocking(DEMO_LPUART, &ch, 1);
LPUART_WriteBlocking(DEMO_LPUART, &ch, 1);
}
Now, your receive will sendout the received data again, send means receive, so you will always get a, as your loopback send a.
2. About the LPUART testing, normally, we don't use the loopback function, we will use the external UART directly to test it. So you totally can use your MIMXRT1024-EVK on board Virtual COM port to test the SDK project, then you will find it works OK.
3. to your loop back, you also can write the code like this:
uint8_t txbuff[] = "1234";
uint8_t rxbuff[20] = {0};
/*******************************************************************************
* Code
******************************************************************************/
void LPUART_Loopback_Mode_Enable(LPUART_Type *base, bool enable)
{
if(enable)
{
base->CTRL |= LPUART_CTRL_LOOPS_MASK;
//base->CTRL |= LPUART_CTRL_RSRC_MASK;
}
else
{
base->CTRL &= ~LPUART_CTRL_LOOPS_MASK;
base->CTRL &= ~LPUART_CTRL_RSRC_MASK;
}
}
/*!
* @brief Main function
*/
int main(void)
{
uint8_t ch;
lpuart_config_t config;
uint16_t delay_cnt=0;
BOARD_ConfigMPU();
BOARD_InitPins();
BOARD_BootClockRUN();
/*
* config.baudRate_Bps = 115200U;
* config.parityMode = kLPUART_ParityDisabled;
* config.stopBitCount = kLPUART_OneStopBit;
* config.txFifoWatermark = 0;
* config.rxFifoWatermark = 0;
* config.enableTx = false;
* config.enableRx = false;
*/
LPUART_GetDefaultConfig(&config);
config.baudRate_Bps = BOARD_DEBUG_UART_BAUDRATE;
config.enableTx = true;
config.enableRx = true;
LPUART_Init(DEMO_LPUART, &config, DEMO_LPUART_CLK_FREQ);
LPUART_Loopback_Mode_Enable(DEMO_LPUART,true);
LPUART_WriteBlocking(DEMO_LPUART, txbuff, sizeof(txbuff) - 1);
while (1)
{
for(delay_cnt=0; delay_cnt<60000;delay_cnt++);
LPUART_ReadBlocking(DEMO_LPUART, &ch, 1);
LPUART_WriteBlocking(DEMO_LPUART, &ch, 1);
}
}
Then you will receive the result like this:

Wish it helps you!
Best Regards,
kerry