Arduino Randomly Freezing During Long Jobs

Okay, here's a game-changer...

Out of sheer desperation I hard-coded all my serial commands into the Arduino sketch itself and removed all references to the serial bus. Still had the laptop connected, but only as a power source. The commands are quite repetitive for the first job I want to do, so it just took a couple of nested loops to replicate them exactly. Started it off yesterday lunchtime with exerything connected as normal, and a few minutes ago it finished, parked-up and powered-down.

Wow

So, can we assume it is the serial after all? I might try another run now with just Serial.begin() in the startup, to see if that works too.

Note: Just tried to upload new code, and the Arduino IDE halted with Serial Port 'COM7' already in use. Could this be a clue?