without more information, this is a difficult issue to diagnose. basically, there are 4 possible causes of this behaviour:
- power fluctuation causes the board to reset.
- the board resets because the reset pin is physically set to gnd
- the board resets because the reset pin is logically set to gnd
- the function machine.reset() is called
steps to diagnose:
try a powered hub, separate power supply, different usb cable, different usb port to power your device and observe if the reset happens
inspect the board. see if there is a solder bridge between the reset pin and gnd (next to each other as seen on this image or between the pins on the reset button
and 4) here you need to look at the code in boot.py and main.py; both located on the internal filesystem on your board. You can get those files using webrepl of using the following code:
print(open('boot.py').read())
print(open('main.py').read())
If you print the content here we can inspect it with you.
alternatively, try reflashing micropython using the latest .bin from micropython.org and see if the clean version of micropython corrects the issue.