Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Trinket M0 not recognized after uploading sketch
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket M0 not recognized after uploading sketch

by marambe on Wed Aug 12, 2020 4:10 pm

Hi! I purchased a trinket M0 and I am using it with an MPRLS pressure sensor breakout board. I am displaying the data on an OLED display (all using I2C). The libraries I am using are all by Adafruit (MPRLS + SSD1306).

The M0 was working fine until today; I uploaded the same sketch running on my first M0 on another M0 and after it uploaded, my PC stopped recognizing the micro controller as a serial device. I was getting the following pop up on Windows: "the last usb device you connected to this computer malfunctioned, and Windows does not recognize it."

I re-uploaded the same sketch to my first M0, and again, right after the sketch uploaded, I got the same error above. I tested a third M0 and the same thing happened.

I re-installed the libraries, but that did not help. I am 100% sure that the cable I am using is serial, so it the port. I uploaded the same sketch to an Arduino Uno and it worked and did not cause me any issues after uploading. What could the problem be? Also, I tried to reset the M0s that stopped working during the troubleshooting process with no luck, how can I retrieve micro-controllers?

I would truly appreciate some help, thanks!

marambe
 
Posts: 2
Joined: Wed Aug 12, 2020 3:45 pm

Re: Trinket M0 not recognized after uploading sketch

by mikeysklar on Wed Aug 12, 2020 8:26 pm

Hi marambe,

I assume you are running Windows 10? In which case no additional drivers are needed for USB serial support.

What is going on with the Trinket M0 LED? Is it pulsing red when plugged in? If this is the case the bootloader might have got into a weird place. I would pull off the MPRLS sensor and SSD1306 display. Just work with the straight Trinket M0 to reset the bootloader and get the blink program going again.

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

Manually bootloading
If you ever get in a 'weird' spot with the bootloader, or you have uploaded code that crashes and doesn't auto-reboot into the bootloader, click the RST button twice (like a double-click)to get back into the bootloader.
The red LED will pulse, so you know that its in bootloader mode.
Once it is in bootloader mode, you can select the newly created COM/Serial port and re-try uploading.


0408CD42-26D3-4FE7-A148-6400B5B6C3D5.png
0408CD42-26D3-4FE7-A148-6400B5B6C3D5.png (34.93 KiB) Viewed 14 times


You may need to go back and reselect the 'normal' USB serial port next time you want to use the normal upload.


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: 1650
Joined: Mon Aug 01, 2016 8:10 pm

Re: Trinket M0 not recognized after uploading sketch

by marambe on Thu Aug 13, 2020 10:51 am

Hi! Thanks for getting back to me xD

FIX: I was able to reset the Trinket M0 by double clicking the reset button (I thought it was a 10 second press initially). As issue I had after that is that even when I tried to upload an empty sketch, the upload bar got stuck. I disconnected and reconnected the trinket and it became unrecognized so I reset it again. I figured it was a driver issue. It turns out I was selecting the Arduino M0 and not Adafruit Trinket M0 board.

marambe
 
Posts: 2
Joined: Wed Aug 12, 2020 3:45 pm

Re: Trinket M0 not recognized after uploading sketch

by mikeysklar on Thu Aug 13, 2020 12:32 pm

Awesome. Thank you for the feedback. Whenever you do have trouble please resort back to the blink sketch to reduce confusion. Glad this turned out to be an easy fix.

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

Please be positive and constructive with your questions and comments.