Hi everyone,
I'm working on an NXP project that involves reading ADC values and transmitting them over UART, and receiving responses from a co processor over UART. I'm using the FRDM-MCXW71 evaluation board and have encountered an issue where the UART RX read flags don't seem to work as expected when sending data to the RX line.
Context
- Platform: FRDM-MCXW71 evaluation board (details in code below).
- UART Configuration:
- Baud rate (9600) and other settings are correctly configured using LPUART_GetDefaultConfig.
- TX and RX are both enabled.
Problem
The RX read flag (kLPUART_RxDataRegFullFlag) isn't triggering during runtime when I send data to the RX pin. This suggests that incoming data isn't being flagged for processing even though the UART peripheral is initialized and configured correctly.
What Works
When I switch to using blocking reads via LPUART_ReadBlocking, the UART receives data without any issues. This confirms that the hardware setup and basic UART functionality are working fine.
Here’s the working example using LPUART_ReadBlocking:
uint8_t data[10];
LPUART_ReadBlocking(LPUART0, data, sizeof(data));
PRINTF("Received: %s", data);
What I Tried
- Ensured that RX is enabled (config.enableRx = true).
- Verified interrupt configurations (though they aren't relevant for blocking reads).
- Confirmed the TX functionality works perfectly, and RX behaves as expected in blocking mode.
Code Snippet
Here’s the part of the UART setup code:
static void configureLPUART(void)
{
lpuart_config_t config;
LPUART_GetDefaultConfig(&config);
config.baudRate_Bps = UART_BAUD_RATE;
config.enableTx = true;
config.enableRx = true;
LPUART_Init(LPUART0, &config, DEMO_LPUART_CLK_FREQ);
LPUART_EnableInterrupts(LPUART0, kLPUART_RxDataRegFullInterruptEnable);
}
However, checking LPUART_GetStatusFlags(LPUART0) & kLPUART_RxDataRegFullFlag doesn't seem to indicate any data received, even when valid data is sent to RX.
Mex config
andrtnnr_0-1734880060734.png
Question
Has anyone experienced similar issues with the RX flags not being triggered? Could this be related to clock settings, buffer configuration, .mex config or something I might be overlooking in the LPUART setup?
Any insights would be greatly appreciated!
Thanks in advance!
Andrew