Hi everyone,
I hope you’re all doing well. I’m currently working on a project for my internship and have run into a frustrating issue with my Arduino MKR NB 1500.
Here’s the situation: My board randomly resets during operation, and it’s becoming quite problematic as I need to get the project up and running stable by next week . The resets seem to occur at unpredictable intervals, which makes troubleshooting difficult.
Code:
Devicev4new.ino (33,4 KB)
It seems likely the immediate cause of the resets is the watchdog timer. If the duration of your loop
function is greater than 4.2 minutes, the watchdog will reset the board.
Of course this would mean there is a deeper problem that some process is blocking either infinitely or for a ridiculous amount of time. Your program is very complex so it is no easy task to identify what process that might be.
My recommendation would be to start by disabling the watchdog code. If the resets no longer occur then you will know that is the cause of the resets and you can then focus your attention on finding the blocking process.
In order to do that, you should remove all irrelevant code from your sketch until you have gotten it down the absolute minimal amount of code that will still produce the blocking state. Once you have that, it should be easy for you to identify the specific process that is blocking and then work to troubleshoot that problem.