Part Number: CC2340R5-Q1
Hello,
I am using the CC2340R5-Q1 and developing software with SDK version 9.14. Currently I am developing a product for a customer and implementing/verifying UART functionality. As part of abnormal-condition checks, I intentionally input malformed data and want to decide how the software should respond when the CC2340R5-Q1 detects an error. To do that I am investigating how the CC2340R5-Q1 detects UART errors. I have observed the following behavior:
- When receiving UART data that has no stop bit, the event callback function is not called. Instead, the read callback function is invoked.
- In the read callback function, the status is reported as normal/OK.
My questions are:
- If malformed data (in this case data without a stop bit) is received, should the event callback function be called?
- How can I detect this condition as an error in software?
void Isr_Uart_Rx(UART2_Handle handle, void *buf, size_t count, void *userArg, int_fast16_t status)
{
GPIO_toggle(CONFIG_GPIO_DIO13);
uart_status = status;
UART2_read(uart2_handle, &uart2_buf[0], (size_t)5, NULL);
}
void Isr_Uart_Event(UART2_Handle handle, uint32_t event, uint32_t data, void *userArg)
{
GPIO_toggle(CONFIG_GPIO_DIO0);
uart_event = event;
uart_event_data = data;
}
void Uart_Setup(void)
{
UART2_Params uart2_params;
UART2_Params_init(&uart2_params);
uart2_params.readMode = UART2_Mode_CALLBACK;
uart2_params.readCallback = Isr_Uart_Rx;
uart2_params.readReturnMode = UART2_ReadReturnMode_PARTIAL;
uart2_params.eventCallback = Isr_Uart_Event;
uart2_params.eventMask = UART2_EVENT_FRAMING | UART2_EVENT_PARITY | UART2_EVENT_BREAK | UART2_EVENT_OVERRUN;
uart2_params.baudRate = 500000;
uart2_handle = UART2_open(CONFIG_UART2_0, &uart2_params);
UART2_read(uart2_handle, &uart2_buf[0], (size_t)5, NULL);
}

I will attach the code I checked and the oscilloscope waveform for your reference.Thank you for yourhelp.