In the testing that I've done it seems that using Serial and SerialUSB at the same time does not work. If I use only Serial or only SerialUSB everything works great. I've tried this in the setup() function:
while (!SerialUSB) ;
SerialUSB.begin(0); //baud value is ignored in underlying implementation
SerialUSB.flush();
while (!Serial) ;
Serial.begin(115200);
Serial.flush();
...
It doesn't seem to matter which 3 Serial or SerialUSB statements to initialize serial communications come first. In both cases both ports stop working. I was curious why this might be the case.
Is anyone successfully doing read/write I/O through both the native and programming USB ports?? I have not tried doing end/begin calls every time I want to write something to one port or the other and just switching back and forth but that seems like a computationally expensive use case I'd want to avoid.
Any insights here would be greatly appreciated.