uC / OS-II is preferable, but only in one direction - it will preempt a stream with a lower priority to allow a stream with a higher priority, but will not do the opposite. That is, threads with a higher priority must explicitly give up CPU control in order to allow threads with a lower priority. I am sure that your serial stream has higher priority than the HTTP stream, and that serFgetc() does not give up control at all (via OSMboxPend or OSTimeDly or some other procedure).
Try to either make the serial stream a downstream stream in the system, or put something in its code so that it can refuse to control the processor. (For example, waiting on a semaphore when there are no characters available, which semaphore you can send from an interrupt available for data.) Either should work.
source share