My top guesses are more or less the same as everyone elses
Especially since we have no hints.
a) power - Always one of my top guesses.
b) Overflows or the like with timers, timeouts...
c) memory corruption/leaks - As mentioned maybe using heap and something not being freed. Or finally gets too fragmented, Or maybe allocations done on Interrupts like Interval timer or...
d) Or some timing issue. Example I have seen (done) and fixed bugs like:
Code:
CallOftoSomethingThatwillInterruptAtCompletion();
interrupt_happened = false;
while (!interrupt_happened) ;
...
Works most of the time, but maybe some other interrupt happens during the CallOff.. And the actual interrupt is triggered, before we reutn and clear interrupt_happened...
So then are wait will wait for ever...
...
Again knowing nothing about your program or setup hard to recommend stuff.
But could maybe use @defragster stuff - Although hard to know if you need some other hardware sitting there with Serial port or like for 4-6 weeks.
Again check for everywhere you wait for something and make sure you don't have code like above and/or you have timeouts in all loops.
Maybe setup something like watchdog timer? to make sure things are running and try to recover...
Again hard to say
Kurt