A while back I bought several QT PY SAMD21 boards to play around with. After several days of working just fine I got this error message from Windows 10, "The last USB device you connected to this computer malfunctioned, and Windows does not recognize it". I tried rebooting the computer and resetting the board but nothing worked. I figured it was a fluke and tried another board but after a few days the same thing happened. I ordered a couple of more boards to try again. I thought maybe I wasn't ejecting the boards correctly when I was unplugging them from my computer so I made a conscience decision to make sure and eject them every time. This worked for several weeks and I thought that was the issue. Tonight after playing around with some code for about 30 minutes out of nowhere, I get the same error message. Windows can no longer find my board or any ports. I plugged in my last new board and Windows said it was setting up the QT PY then seconds later it returned the same error message. It can't be a fluke when 4 boards fail in short order. Does anyone have any idea what I am doing wrong? Are the boards salvageable or do I need to start from scratch? Thank You
Hi @tneraider. Does the port of the board show up in Arduino IDE after you perform the double reset recovery technique described here?:
https://learn.adafruit.com/adafruit-qt-py/using-with-arduino-ide#manually-bootloading-2854184
The tricky thing about the boards with native USB capability like your board is the USB code that creates the CDC serial port is running on the same microcontroller as your sketch. This means your sketch code can break the USB code, or stop it from running. When that happens, it no longer presents a port.
This can be unexpected to those who previously mainly worked with the boards like Uno and Mega with a dedicated USB chip that can never be affected by the sketch code.
The missing port makes it so you can't upload normally any more. However, the situation is really not so bad because there is an independent program called the bootloader in a separate section of memory from your sketch, and that program has its own USB CDC code. So even if the sketch is completely broken, you only need to activate the bootloader and you will get a port back and be able to upload.
After that upload, you should be able to go back to doing normal uploads without needing to use the reset button technique.
If you still need to do the reset trick to do uploads after this, the problem may be caused by your code. You can verify this by uploading a simple sketch like File > Examples > 01.Basics > BareMinimum.
Thank you. That did the trick. I still have a program that crashes the board but it's a slightly modified version of a program that runs just fine so I need to look into that further. All of my other programs are running normally on all of my boards, including the ones I thought had died. Thanks again. You saved me a lot of time (and money).
You are welcome. I'm glad you are able to use the boards again now.
I know from experience that it can be difficult to track down the problematic part of the sketch, but at least now you know that the code is causing the problem and how to easily recover the boards once they get into that state.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.