NXP iMXRT1052 intermittent UART Rx Overrun

Wow I am speechless.
I guess for two reasons.

  1. Two thumbs up to @aggarg for his excellent debugging skill.
  2. Shame on NXP for providing this kind of driver to their customers.

The UART driver is from NXK SDK 2.6. This is really really crazy to write a driver to have its ISR behavior affected by application task priority.
When I reached out to them, they acted very innocent obviously saying that there is no known issue.
I guess this is NOT a bug as long as you keep your UART task(s) to be highest priority task.
I think this is insane. I never thought that NXP would write their driver in such manner.

Thanks @aggarg and @hs2 for your help.