I have a relatively complex program running on an Arduino Mega 2560, using about 75% of the IO pins, mostly digital. The hardware that connects to this unit includes a custom PCBA with buttons, LEDs and an OLED screen and I am using the very cool u8g2 library to drive the screen.
In our last internal release of this code, we're now seeing a situation where some of the time the serial monitor (native to the IDE) stops responding. It will clunk out in the middle of a Serial.print statement and the only way to recover it is a new upload, or closing and restarting the serial monitor.
I am slowly removing the code from the most recent release to try to see if I can isolate what might have caused this. Latest rev is using only 26% of program storage space and 65% of dynamic memory. I am using the F macro for all serial print and u8g2 print statements that have static text. I have just one String variable, and removing that does not change any behavior that I can tell.
I would love some advice here on how to make this more of a specific effort versus what I feel is just some blind troubleshooting.