I used a cheap Chinese "pro micro" for simple timer-base automation.
I do not need the USB serial during normal operation, but for the present, my code is outputting some informational messages every minute using several Serial.print() calls.
I happened to notice, via the blinkenlights, that my code was hanging periodically for over 10 seconds. I determined that this hang was when I was issuing the Serial.print() calls - a total of around 47 Serial.print()s was taking around 14 seconds to complete. Those Serial.print() calls normally take around 3 to 4 milliseconds. The delay happens when the windows computer the pro micro is connected to was shut down (but not turned off so still providing power to the pro micro).
I tried wrapping an "if ( Serial )" around the Serial.print() calls, but the problem still happens. If I power the board via raw, with nothing connected to the USB, as I will eventually be doing, I don't get the problem.
Another observation is that when I get the hang, the one second wdt does not reset the board. Yes, I have tested, by deliberately putting my code into a loop, that the wdt does normally work, but for some reason it does not fire during these hangs or delays in Serial.print(), and I'm not doing a wdt_reset() anywhere near there.
I found some discussion about problems with USB after waking up from sleep on ATMEGA32U4 based boards, but I'm not going to sleep - at least, not deliberately!
Since I know how to avoid the problem, and in fact it probably won't occur anyway as USB won't be connected, this is no big deal. However, I'm curious to find out why it hangs in the circumstances that it does, and why the wdt fails to reset.
Thanks for your attention.