Hi.
While I am using LPUART_RTOS_Receive, I`ve got Error code 1309 (kStatus_LPUART_RxHardwareOverrun), It means that ev value from xEventGroupWaitBits is RTOS_LPUART_HARDWARE_BUFFER_OVERRUN
Of cource, It is very rare case, 4~6 times in 12hours test
Saying the circumstance,
I.MX RT 1020 EVK board
1. Baudrate, 19200 bps
2. FreeRTOSConfig.h
#define configUSE_PREEMPTION 1
#define configCPU_CLOCK_HZ (SystemCoreClock) // maybe 500Mhz ??
#define configTICK_RATE_HZ ((TickType_t)1000) // 1 tick, 1ms
#define configUSE_TIME_SLICING 1 // Around 10 tasks having same priority, exist.
3. When I call this function,
// timeout value first byte100ms, next byte 3ms
LPUART_RTOS_SetRxTimeout(m_hSerial, timeout, 1);
// I receive data by one Byte , Byte by Byte, using while (~~), about 30~ 40byte variant Length.
int lpuart_result = LPUART_RTOS_Receive(m_hSerial, (unsigned char*)buffer, 1, &n);
For solving this overrun Error, What am I supposed to do ?
As I think, Is this problem from the Speed of moving data from UART buffer to Ring buffer ?
So.
1. Do I need to change configTICK_RATE_HZ value ??
2. Before calling LPUART_RTOS_Receive, Do I have to set priority of This Task, Higher ?
OfCourse, when Exit LPUART_RTOS_Receive, restore priority value of that task.
3. or... change something arguement from FreeRTOS ??
4. change code?? RX interrupt handler code ? LPUART interrupt priority ?(using NVIC set priority)
Please advice to me
Solved! Go to Solution.
Hello,
Thank you in advance for contacting NXP support.
In this case can you please help me with some extra details.
Also I will recommend for this case to give a look into our RT1020 SDK examples we have an LPUART_freeRTOS included that can be useful as a reference.
Please let me know this information.
I am sorry , I can not send the code. right now. I don`t have authority,
From, answer of Q2, I found improvement point, so I am doing this job , test.
thank you for the answer, If I need more help, I will upload question more detaily , as new topic
Hello,
Thank you in advance for contacting NXP support.
In this case can you please help me with some extra details.
Also I will recommend for this case to give a look into our RT1020 SDK examples we have an LPUART_freeRTOS included that can be useful as a reference.
Please let me know this information.