Hello,
I'm developing a simple proof of concept device to allow a PC to control some lights and displays. I have chosen the Arduino Nano RP2040 to run the lights and displays and then communicate with the PC using a USB to serial connection. Everything works great, but I can break the serial communication if I absolutely hammer the com port with messages. When this happens, the Arduino becomes unresponsive and requires a reboot. Accordingly, I assumed this was simply a buffer overrun. I have changed my code to make sure all characters are out of the serial buffer before calling other routines to alleviate this:
while(Serial.available()>0)
{
newMsg = Serial.readStringUntil('|');
msgBuffer.push(newMsg);
}
Despite this change, I can still break the Arduino if I beat on it mercilessly. I've even tried clearing out all of my logic and simply making a sketch that empties the serial buffer (like above) and simply echos back what was received, but I still have the same issue. Is there something I am missing or is this a limitation of the USB serial and I simply need to move to one of the hardware UARTs?