Software reset not working on native USB

Hi all,

I need to have the capability of resetting my arduino remotely using software reset. I implemented the solution mentioned on THIS POST and it works great if I run it via the programming port. But when I modify my code to use the native port (SerialUSB), it stops working. The arduino doesn't reset but instead hangs.

Would any of you guys have any pointers of why this may be happening? I'm at a loss.

Is the Due locking up or you just can't get it to respond any longer via SerialUSB? The reason I ask is that the start up code for the Due causes a USB reset. If you're using the native port this has the added "bonus" of disconnecting you from the PC side at the same time. The serial connection will die and the PC side will basically be dangling in mid air. This has bitten me many times. If your problem is different then ignore this message.

Another option might be to ensure that you do the reset outside of any interrupt handlers and also disable interrupts before you ask for a reset.

Hi AdderD,

Thanks for your reply. I'll check if it's just the computer not listening to the serial anymore. Good call.

As for interrupts, I'm not aware of any interrupt handler going on. But I should look at the code more carefully, I'm inheriting it from another engineer and it's been as much an exercise of getting the job done as of understanding someone else's brain.