Hello James,
This reply is based on my experience of Renesas RX and RL78. (i.e. I don’t know i.MX but the reason might be the same…)
Q) Does your ‘RingBuffer’ implementation at task side has the following steps to avoid simultaneous operation between task side and ISR side?
(1) Mask the UART interrupt by setting ‘UART interrupt mask register’ = ‘1’
(2) Do some operations (such as getting data bytes from RingBuffer)
(3) Unmask the UART interrupt by setting ‘UART interrupt mask register’ = ‘0’
(*) The reason why ‘UART interrupt mask register’ is used is to avoid a global interrupt disabled period. I think that this method is widely used in case of NON-RTOS based application.
But the following steps of (0) and (4) are necessary in case of RTOS based application.
(0) Enter critical section
(1) Mask the UART interrupt by setting ‘UART interrupt mask register’ = ‘1’
(2) Do some operations (such as getting data bytes from RingBuffer)
(3) Unmask the UART interrupt by setting ‘UART interrupt mask register’ = ‘0’
(4) Exit critical section
If implementation lacks the steps of (0) and (4), the task doing this steps may be switched to other task during step (2) and then the UART interrupt may be masked very long time.
I wonder that this might be the reason of your problem.
Best regards,
NoMaY