Reset Arduino (mkr1010) using USB connection

Is there a way to force a reset (using arduino-cli tools or otherwise) without uploading SW to the device? (MKR1010).

The closest I have come (googled and tested a lot) is to be able to force the device into programming mode (led pulsating), but not reset/restart

import serial
import time

com = serial.Serial(sys.argv[1], 1200)
#com.dtr=False # this line True or False makes no difference (works anyway)
#time.sleep(0.5) # not needed
com.close

(linux pc)
python3 -m virtualenv venv
source venv/bin/activate
pip3 install pyserial
sudo ./venv/bin/python reset.py "/dev/ttyACM0"
=> MKR1010 enters programming mode

Not sure what is the use case so this may not be relevant solution, but you can reset the board by a routine listening to Serial, send whatever code you want and perform a reset by calling NVIC_SystemReset();

Although it is possible to cause a reset via the DTR control signal on the serial port when using a classic Arduino board like the Uno, Mega, or Nano, it is not possible to do that with the MKR WiFi 1010. The reason is that the MKR WiFi 1010 has a native USB capability where the primary microcontroller is attached directly to the computer via the USB cable, so it doesn't have the auto-reset circuit like the boards that use a dedicated USB to serial adapter chip do.

As you already learned, the system used to put the native USB boards into bootloader mode is opening a serial connection at 1200 baud. I think that's as close as you're going to get to being able to alter the run state purely from the PC end.

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