this code is output to the IDE monitor, but not to the USB COM. If I put this code on a UNO, I can get it with another program, just not with the Portenta Machine controller.
It appears like any calls to Serial.print(), including Serial.println and likewise Serial.write(buffer, cnt), will remain in these calls, until the last byte is queued to the underlying UART. Here is ...