Ooohh I so dislike speculating from an absence of facts, but still feel I might contribute here, or at least get my wrong ideas rejected.
I have made myself a small serial library that uses active polling and watching millis()
to send characters using Serial.print.
My experiments showed Serial.print
(and presumably Serial.write
) to BLOCK when sending more than one char.
It takes "no" time to send a single character, but you can not send another until that one has pulsed its way out of the serial line, ie I have to wait for second/baudrate before attempting the next character send, or I will block again.
So I simply call my serial output package in the loop()
and have a different output routine that simply stacks the characters strings in a buffer (that the active poll routine will output in due time).
This is simple singlethreaded code, no interrupts, no reentrant code nor locking datastructures to worry about