Various Serial.prinln block the FreeRROS code

I have arduino UNO and Iam working with FreeRTOS structure.

I have a problem. In first time a Serial.println("text") with a large text. My arduino blocks and not run nothing. The "L" LED of arduino blink fast and constantly. This occurs despite having only one Serial.println.

On the other hand if I have a Serial.println("text") with short text It's fuction. But.....
if I put more than 8 serial.print(), 9 or 10 with short text then occur the same: My arduino blocks and not run nothing. The "L" LED of arduino blink fast and constantly.

I don't know what happend...... Can You help me. Thankss

Serial is using interrupts and a relatively small 64 byte buffer. if you try to put things into the buffer faster than the hardware can spit them out (so depends on your baud speed of the serial) then the buffer fills up and the Serial.print command actually waits for the buffer to empty and becomes blocking.

That blocking connected to interruptions probably prevents the RT system to schedule the various tasks.

there is a non blocking call availableForWrite() giving you the number of bytes (characters) available for writing in the serial buffer without blocking the write operation.

so your code needs to be smart and check that before sending tons of info to the Serial line.

J-M-L:
Serial is using interrupts and a relatively small 64 byte buffer. if you try to put things into the buffer faster than the hardware can spit them out (so depends on your baud speed of the serial) then the buffer fills up and the Serial.print command actually waits for the buffer to empty and becomes blocking.

That blocking connected to interruptions probably prevents the RT system to schedule the various tasks.

there is a non blocking call availableForWrite() giving you the number of bytes (characters) available for writing in the serial buffer without blocking the write operation.

so your code needs to be smart and check that before sending tons of info to the Serial line.

Thks, Im going to prove it