How to "hard" software reset arduino nano rp2040?

Hi,

I am currently working on a project that involves a 24/7 running arduino nano rp2040 board. The board monitors vibrations on a machine and writes to a database about 4 times per second via WiFi. I've run into a problem where the sketch stops working at random intervals (sometimes 2 hours sometimes 30...) and after checking for multiple problems like memory leaks and programming problems I have not been able to find any that could cause this behaviour. My question is, is it posible to implement a software based "hard" reset like the one from the board button? I have only found one way to "reset" the board and it doesn't seem like it does the same as pressing the button (NVIC_SystemReset();).

Thanks in advance.

what is different?

From what i have been able to test, using that function 'kills' the serial port. The sketch works as normal after resetting with that, but all the information i print to the serial port dissapears (not really a problem once I connect arduino to the machine since i don't need to see it). Also, I've tried to run the sketch with like a 5 minute timer on the reset with that function, it runs fine but ends up stopping anyway.

It's kind of strange because if I just press the button when it freezes it goes back to working but looks like the function doesn't do the same.

I guess the port number changes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.