we have 20 bytes of data to be received from another controller. So in the ISR, is as below
if(event == UART_EVENT_RX_FULL){
if(buffer[buffer_id] == 0x01){
buffer_id = 1;
LPUART_DRV_SetRxBuffer(INST_LPUART_2, &buffer[1], 19U);
}
else if(buffer_id == 1){
copy_to_local_buffer();
buffer_id = 0;
LPUART_DRV_SetRxBuffer(INST_LPUART_2, &buffer[0], 1U);
Notify_task();
}
else{
buffer_neg++;
}
}
}
but if we receive 21 bytes, for continuously few times, then the UART is not hitting the ISR at all. Please help in this regards.
Hi,
how was LPUART_DRV_ReceiveData called and do you also check for end of transfer anyhow/anywhere? Is a buffer_id modified or incremented anywhere too?
You can try to add UART_EVENT_END_TRANSFER event as well to know LPUART_DRV_ReceiveData will be needed to call again to allow further receiving.
BR, Petr