It's Holiday Sale Weekend at Adafruit - use the code ADATY to get 15% off items storewide! Some restrictions apply.
0

Metro M4 Airlift Lite, TinyUSB Not Recognized by Win 10
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Metro M4 Airlift Lite, TinyUSB Not Recognized by Win 10

by Exonerd on Tue Oct 12, 2021 10:31 pm

Greetings,
Using Arduino IDE with a Metro M4 Airlift Lite that had been working well previously, I switched the USB stack to "TinyUSB" as I wanted to experiment with the expanded capabilities. My generic sketch compiled and uploaded, but then the board disappeared from Windows and shows up with a "USB Device Unrecognized" error. Used the latest Adafruit driver package (2.5.0.0) and still can't get the board to show up properly. Is there an easy fix for this?

Exonerd
 
Posts: 9
Joined: Fri Sep 24, 2021 12:06 am

Re: Metro M4 Airlift Lite, TinyUSB Not Recognized by Win 10

by hathach on Thu Oct 14, 2021 6:27 am

it is probably caused by `while(!Serial) {}` (or similar), try to add an yield() or delay(1) to allow mcu to run the tinyusb background task e.g

Code: Select all | TOGGLE FULL SIZE
while(!Serial) yield(); // or delay(1)


Otherwise, please post your minimal sketch here for analysis can

hathach
 
Posts: 1163
Joined: Tue Apr 23, 2013 1:02 am

Re: Metro M4 Airlift Lite, TinyUSB Not Recognized by Win 10

by Exonerd on Thu Oct 14, 2021 4:17 pm

Thanks but I can't even get the board to show up for reprogramming at this state. Should I burn a fresh bootloader to reset the board, or is there a fix in Windows?

Exonerd
 
Posts: 9
Joined: Fri Sep 24, 2021 12:06 am

Re: Metro M4 Airlift Lite, TinyUSB Not Recognized by Win 10

by Exonerd on Sat Oct 16, 2021 6:27 pm

Resolved:
If you ever lose communication with the Arduino IDE and Windows due to a serial port error in your code, switching to bootloader mode (double-tap the reset button whilst connected to USB) will make the board reappear in Windows and the Arduino IDE, allowing for flashing a fresh sketch. I was worried I'd have to burn new bootloaders, etc. Thank you Adafruit for your handy capability to switch to CircuitPython!

Unresolved:
When switching to the TinyUSB stack, I get a compiler error for that delay command put in place to let the USB process complete, saying there is "unknown reference to Serial":
Code: Select all | TOGGLE FULL SIZE
 Serial.begin(9600);
  while(!Serial){
    yield();
  }

Exonerd
 
Posts: 9
Joined: Fri Sep 24, 2021 12:06 am

Please be positive and constructive with your questions and comments.