0

Trinket M0: can only load Arduino sketches once
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket M0: can only load Arduino sketches once

by hypersphereconsulting on Wed Dec 02, 2020 1:20 pm

I have the latest board files (1.6.4) and the latest windows driver (2.5.0.0). I am experiencing the following issue with Arduino 1.8.13.

If I enter programming mode by double clicking the reset button and/or load the Circuit Python uf2 file then I can upload an Arduino sketch to the Trinket M0. (The COM port number changes after uploading the sketch.) However, at the new COM port number I cannot upload a new sketch. It takes minutes and minutes to finally fail, or stalls indefinitely. If I double click the device and enter bootloader mode then I can upload Arduino sketches to the Circuit Python COM port number. I am developing a tool for many users and I plan to make a regular bulk purchases of Trinket M0's. I would prefer if the users don't have to double click the reset button in order to upload a sketch. Is there a possible fix?

FYI, I did not recall having this issue previously, for instance a few months ago.

hypersphereconsulting
 
Posts: 4
Joined: Wed Dec 02, 2020 1:02 pm

Re: Trinket M0: can only load Arduino sketches once

by hypersphereconsulting on Wed Jan 06, 2021 11:48 am

Has anyone else had this issue? Does Adafruit have a fix?

hypersphereconsulting
 
Posts: 4
Joined: Wed Dec 02, 2020 1:02 pm

Re: Trinket M0: can only load Arduino sketches once

by hypersphereconsulting on Wed Jan 06, 2021 11:48 am

@adafruit_support_bill--any ideas?

hypersphereconsulting
 
Posts: 4
Joined: Wed Dec 02, 2020 1:02 pm

Re: Trinket M0: can only load Arduino sketches once

by mikeysklar on Thu Jan 07, 2021 7:03 pm

Our docs indicate that normally manually triggering the bootloader is not necessary unless the bootloader has gotten into a weird state. Which bootloader are you running (v3.10.0) is our latest (bottom right):

https://circuitpython.org/board/trinket_m0/

https://learn.adafruit.com/adafruit-tri ... rduino-ide

When you upload a plain blink sketch instead of your custom code does it make any difference?

Code: Select all | TOGGLE FULL SIZE
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

mikeysklar
 
Posts: 2901
Joined: Mon Aug 01, 2016 8:10 pm

Re: Trinket M0: can only load Arduino sketches once

by hypersphereconsulting on Wed Jan 13, 2021 12:58 pm

I got a new Trinket and watched the behavior closely. This may provide some insight.

1. Connected trinket. Showed as COM port 14.
2. Pushed an Arduino sketch (doesn't matter which sketch)
3. Arduino shuts off and reboots, now showing as COM port 16.
4. Windows shows a notification "setting up device" and apparently a new driver is installed. Once this happens, Arduino no longer recognizes the device at Port 16.
Only recourse is reprogram Arduino is to:
5. Double click to enter bootloader load. Device now shows up as COM 15.

Ever after I have to double click to enter bootloader. Select COM 15. Push sketch. And the Arduino device runs as COM 16. So my users will have to double click to enter bootloader then manually change the Arduino port every time they change their sketch. I had hoped the users could use the Arduino monitor to send and receive commands from the device, but the constant com port switching is going to make that confusing and frustrating for them.

The question is, how do we stop windows from loading that second driver after Arduino sketches are running? Is there a way I can check what driver is being used?

hypersphereconsulting
 
Posts: 4
Joined: Wed Dec 02, 2020 1:02 pm

Re: Trinket M0: can only load Arduino sketches once

by mikeysklar on Wed Jan 13, 2021 5:43 pm

@hypersphereconsulting,

Thank you for your careful watching of Windows behavior.

What version of windows are you using? Win7 vs Win10? Our guide really only applies to version of Windows early than Win10 as the drivers are baked in on Win10.

https://learn.adafruit.com/adafruit-ard ... stallation

Also, are you running a 64-bit version of Windows?

mikeysklar
 
Posts: 2901
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.