Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

Windows 10 triggers autorestart
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Windows 10 triggers autorestart

by olTechie on Mon Jun 07, 2021 4:42 pm

Two boards, one not from Adafruit, the other is a Feather M4 CAN. Connected to Windows 10 21H1 machine.

I update to the current 6.3 uf2 and install the sample Blinky code. An infinite while loop so it should never exit. It runs but constantly autorestarts after a half-second or so. Instead of blinking steadily, the LED lights then seems to hesitate, blinks and hesitates again.

Running on battery or on a Raspberry PI it is fine. It doesn't matter if MU or Visual Studio Code are running or if I just use PuTTY to look at the REPL, the LED pattern is the same.

Even with no software accessing the REPL the LED goes on doing a double-blink, off then double-blink again. It is on about twice as long as it is off.
On REPL I get:
Code: Select all | TOGGLE FULL SIZE
Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

code.py output:

Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

code.py output:

Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

code.py output:

Code stopped by auto-reload.
soft reboot

Looks like Windows 10 is constantly doing some kind of polling that the device interprets as a save. I've been looking all over the web but no-one else seems to have that issue. Is it just because most have not gone to 21H1 yet, Windows just hates me or some subtle newbie mistake? Maybe some rogue camera software is jumping in looking for picture to download?

Seems to be a service under System that starts transferring data whenever I plug in the Feather. It isn't file backup or Acronis or Defender, something in NTOSkernel.exe. Maybe it is scanning for a USB stick virus or trying to boot from the USB or ... all I know is it starts transferring data to the backup drive at a rate of 140 MB/s as soon as I turn on the Feather M4 CAN. Oddly it is not transferring data from the Circuitpy drive to the backup drive, it is between two other internal drives, but it only happens when the Circuitpy drive as attached.

My RP2040 doesn't do this but it doesn't have the auto-reload feature.

olTechie
 
Posts: 3
Joined: Mon Jun 07, 2021 2:59 pm

Re: Windows 10 triggers autorestart

by tannewt on Mon Jun 07, 2021 6:47 pm

Are you running CircuitPython on the RP2040? I'd expect it to have the same autoreload issue.

tannewt
 
Posts: 2428
Joined: Thu Oct 06, 2016 8:48 pm

Re: Windows 10 triggers autorestart

by olTechie on Tue Jun 08, 2021 9:37 am

No, Micropython with Thonny on the RP2040. So I guess that is a completely different system, it doesn't show up as a drive once you install the uf2 and just uses the REPL.

I tried the Feather on another Win10 21H1 machine and it is fine, just a slight hesitation the first time it enumerates as a device and then steady blinking.

Something in my dev rig is firing up when it sees the CIRCUITPY drive. Possibly somebody is using the same PID and VID for a peripheral that does something with the backup drive. And Windows helpfully installed it for me. There are "backup drives" that have a special MSC partition with some software that is supposed to auto-install when you plug them in. Plug-and-pray.

It is not Windows File Backup, I tried disabling that. It would not automatically start backing up a thumb drive anyway.

Possibly Acronis or Forticlient is trying to detect an attack vector like Stuxnet that uses a weaponized thumb drive.

I guess this project is moving to a Raspberry PI. Just as well, the final hardware will be a PI anyway. I can just code on a VPN or over SSH instead of on the hardware.

olTechie
 
Posts: 3
Joined: Mon Jun 07, 2021 2:59 pm

Re: Windows 10 triggers autorestart

by olTechie on Tue Jun 08, 2021 10:59 am

Tannewt, I just tried CircuitPython on the RP2040 - exact same problem as you suggested was likely. It is a Sparkfun Thing Plus.
For reference here is the code
Code: Select all | TOGGLE FULL SIZE
import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)

olTechie
 
Posts: 3
Joined: Mon Jun 07, 2021 2:59 pm

Re: Windows 10 triggers autorestart

by tannewt on Wed Jun 09, 2021 1:40 pm

It sounds like you have many programs that may be making writes to the drive. I'd suggest disabling them one at a time to determine which it is or switching to the Raspberry Pi as the host.

tannewt
 
Posts: 2428
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.