PyBadge - unable to enumerate USB device

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
memfault
 
Posts: 28
Joined: Fri Apr 16, 2021 5:33 am

PyBadge - unable to enumerate USB device

Post by memfault »

Hi,

Because of covid and remote scholling I've decided to get PyBadges off the shelf to let kids play with at on boring lessons.
I've secured them with drilled visa cards on the back(to prevent shorts) and tried to connect them to machine, and the problems started.

1st one started with

Second one started with preloaded game (I've made with MakeCode Arcade), and after pressing "reset button" it started with bootloader and green neopixel.
It was hour ago. Now it acts as first device, except that instead of CircuitPython, it starts custom game from MakeCode Arcade...

After I've got them few months them from friend(that bought them directly from you), they worked reliably, after inital flashing bootloader(had soem problems to flash them). Because I was unable to find batteries and spacers(to mount Credit Cards on the back, to prevent horts) in local electronic shops and generaly lack of time, I've put them into drawer.

- changging usb cables doesn't work
- trying different mahines doesn't help
- CircuitPython starts with typical REPL info screen
- bootloader flash mode doesn't start (black screen and red neopixel)
- there's no usb drive, not serial console.

under windows XP I've got "unknown device". in device manager in properties I've got VID 0000 and PID 0000

Not sure, but looks like it's USB data problem, because it's powering up OK and loading CircuitPython without battery.
It's hard to believe that USB port got damaged, because device was barely used, nothing was ever connected to other ports than USB and I've took special care to not shortcircuit anything on it.
I even believed it was USB port problem, or bad soldering of CPU, but because the problem moved after hour to second device, I' not even sure what can be the cause.

I'm not electronic, but got universal electronic meters, so I can take measurements of powered-down device (if you will tell me which pins to check).
I've also got hot-air rework station, but up to now all tries to replace QFN NIC by using hot-air on motherboard ended as failure, but if you will tell which points to heat manually, I can try it.
I've also got STLink V2 clone.

Anything I've tried to find by google, leads to FTDI clones bricked by official driver. but I guess AdaFruit doesn't use clones or FTDI at all.

I'm pretty experienced linux user, so I can compile and run any software/commands you will throw at me. I hope it's software problem and can be easily fixed...

lsusb shows nothing about it

dmesg shows:
[131683.642950] usb 2-2: new full-speed USB device number 86 using xhci_hcd
[131683.756952] usb 2-2: device descriptor read/64, error -71
[131683.977950] usb 2-2: device descriptor read/64, error -71
[131684.194932] usb 2-2: new full-speed USB device number 87 using xhci_hcd
[131684.308958] usb 2-2: device descriptor read/64, error -71
[131684.529934] usb 2-2: device descriptor read/64, error -71
[131684.632059] usb usb2-port2: attempt power cycle
[131685.259906] usb 2-2: new full-speed USB device number 88 using xhci_hcd
[131685.260013] usb 2-2: Device not responding to setup address.
[131685.464026] usb 2-2: Device not responding to setup address.
[131685.671922] usb 2-2: device not accepting address 88, error -71
[131685.786911] usb 2-2: new full-speed USB device number 89 using xhci_hcd
[131685.787220] usb 2-2: Device not responding to setup address.
[131685.991981] usb 2-2: Device not responding to setup address.
[131686.199881] usb 2-2: device not accepting address 89, error -71
[131686.199941] usb usb2-port2: unable to enumerate USB device

User avatar
memfault
 
Posts: 28
Joined: Fri Apr 16, 2021 5:33 am

Re: PyBadge - unable to enumerate USB device

Post by memfault »

I've tested it on new laptop with windows 10 and identical error for both about inability to obtain device descriptor...
But because one works with custom game, and other with default CircuitPython(it's really new, unused device, with only upgraded firmware), I guess all need to be done is flashing correct firmware using some special ATMega mode, or by expernal flasher.

The question is if the firmware has been broken, because soem bug in firmware triggering it(look for possible tools below), or maybe flash chip is some cheap c*** like QLC, that corrupts data when powered off for longer time (or maybe my units comes from faulty batches).

Generally PyBadge firmware is buggy, it hanged when queried by tools like hdparm, so I needed to :
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 254 /dev/$name" # causes problems with PyBadge

It's saving life of rotational HDDs, because rotational HDDs got usually only 5000 of power cycles, is if it's put to sleep many times a day, it's normal it will die after 2-3years...

Not sure about other tools, but I remember I had also problem some of of them: smartctl, sdparm or mdraid-set-timeouts-for-disk.sh: echo 180 > /sys/block/"$dev"/device/timeout (it's needed for some HDDs to work reliably in RAID).


Anyway both PyBadges I got acts as bricks now (except I can play simple game I've made ;-)

User avatar
adafruit_support_carter
 
Posts: 29153
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyBadge - unable to enumerate USB device

Post by adafruit_support_carter »

Can you get the boards into bootloader mode? If you're running MakeCode, click the reset button once. If you're running CircuitPython or an Arduino program, double-click the reset button. See if you can get the bootloader screen to show on the PyBadge's TFT. Also, the row of NeoPixels below the TFT should light up.

User avatar
memfault
 
Posts: 28
Joined: Fri Apr 16, 2021 5:33 am

Re: PyBadge - unable to enumerate USB device

Post by memfault »

The problem is that they can't go in bootloader mode, they work with this USB enumeration error problem and works like USB is not connected. When pressing "reset" the screen goes black and red NeoPixel stays on(like disconnected USB cable)

The problem is not the cables or computer (I've plenty of them and tried on fresh company machines)

User avatar
adafruit_support_carter
 
Posts: 29153
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyBadge - unable to enumerate USB device

Post by adafruit_support_carter »

These originally worked. What was the last thing done to the boards before they stopped working.

User avatar
memfault
 
Posts: 28
Joined: Fri Apr 16, 2021 5:33 am

Re: PyBadge - unable to enumerate USB device

Post by memfault »

adafruit_support_carter wrote:These originally worked. What was the last thing done to the boards before they stopped working.
Both worked few weeks ago (the only problem was initial flash of bootloader).

One had Makecode Arcade and was used with it. Second had only upgrqaded bootloader and CircuitPython and left as is unused.
They went unused for weeks as I wrote, because we don't have time for it.
Schools switched for remote learning from home again, so I've prepared laptop with new system and wanted to prepare PyBadge for 9yr daughter to play when she got boring lessons, and there problems started. I've took PyBadge and would not start it in bootloader on this machine. I took it to mine laptop and this same. I've played with other one machine with Windows XP (all others are ArchLinux based) and the same problem/ USB drive doesn't start in both normal(MakeCodeArcade game start) and bootloader mode(red neopixel).
IAfter playing for two hours, I took the other PyBadge and it started with CircuitPython. After multiple tries, USB Drive started appearing and worked for two hours.
The more strange thing is that the other PyBadge with MakeCodeArcade start appearing as ThumbDrive. But wroked only multiple time (I think 5-10) and it stopped working.
OK, so I've decided I will try with the other PyBadge(withCircuitPython) that wroked reliably as ThumDrive (I was able to flash BootLoader), but it also stopped soon after few connects to LenovoMachine (that got ArchLinux mirrored from mine laptop).

Both PyBadges now doesn't connect as USB Pendrives. I never bought and connected any accessories to any of them (even battery). I'm connecting multiple USB accesories to all my machines and never got any problem with any of them. I've tried connecting them directly to my laptop, by dock and by quality powered USB hub and I always got identical results.
But when they worked in the past(before putting them in the box) they worked with all machines(I've showedd them to my family, so connected them to multiple random machines to show MakeCode Arcade and didn't had any problem with them.

User avatar
adafruit_support_carter
 
Posts: 29153
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyBadge - unable to enumerate USB device

Post by adafruit_support_carter »

Please double check the USB cable by using it with something else and verify it can move data. USB cable problems are a huge issues.

Looking back at your first post:
Second one started with preloaded game (I've made with MakeCode Arcade), and after pressing "reset button" it started with bootloader and green neopixel.
It was hour ago. Now it acts as first device, except that instead of CircuitPython, it starts custom game from MakeCode Arcade...
This one sounds like it happened in a short period of time - within an hour. It was originally working OK, you were able to upload the CircuitPython firmware, but then an hour later it started misbehaving? So all that happened within an hour?

User avatar
memfault
 
Posts: 28
Joined: Fri Apr 16, 2021 5:33 am

Re: PyBadge - unable to enumerate USB device

Post by memfault »

I don't know what happened, and I've checked with multiple cables that works reliably with other devices.
When first device stopped working, I was thinking it's hardware failure. But when second, I think it's firmware bug (like with smartctl/hdparm problems I've described before).

And nothing unusual happened between, I was running between two laptops (one mine and one for daughter, to get i working), shuffling USB cables, checking dmesg/lsusb.
I;ve described everything.
Before I haven't used this Lenovo laptop(I've prepared for daughter), but I don't think it's faulty. because mutiple devices(mouse,keyboard, headphones, usb modem) are used on it. But maybe something is out-of-spec there...

Maybe I could use external flasher (stm32 clone) to program it?

User avatar
adafruit_support_carter
 
Posts: 29153
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyBadge - unable to enumerate USB device

Post by adafruit_support_carter »

If it's still showing the CircuitPython output on the display, then it's working OK. It's just something with the USB connection. It's just really weird that they worked, then suddenly stopped working - and it's happening to two of them.

There are no FTDI chips that could get bricked. USB is hosted directly from the microcontroller (SAMD51).

If there were an issue with the SPI flash chip, CircuitPython would not boot. It also has nothing to do with USB enumeration.

Can you clarify the current behavior, in terms of what is showing on display.
  • PyBadge #1 = ?
  • PyBadge #2 = Displays CircuitPython REPL info screen?

User avatar
memfault
 
Posts: 28
Joined: Fri Apr 16, 2021 5:33 am

Re: PyBadge - unable to enumerate USB device

Post by memfault »

PyBadge #1 == game is starting(some I've done with childrens in /makeCodeArcade) and is fully functioning.
PyBadge #2 == CircuitPython #REPL

but I cannot switch to bootloader mode(red neoPixel), USB Drive is not showing and serical console is not showing also.
Maybe something weird is on this lenovo laptop, not sure how to investigate it. I have USB power meter to test cables, but It doesnt check data lines I think.

Do you think that I maybe destroyed SAMD51 chip?

if you get linux boxes, then you van test smartctl/hdparm commands I've posted before (that causes problems in the past). It's bug in PyBadge anyway and should be fixed. No other pendrive/usb sata/nvme adapter or directly connected SATA drive hanged(like PyBadge), because of this commands. You should open ticket about it in company bugtracker, because it's annying behaviour and hard to debug for casual user (some distros provied similar udev rules by default)

User avatar
adafruit_support_carter
 
Posts: 29153
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyBadge - unable to enumerate USB device

Post by adafruit_support_carter »

Let's focus on PyBadge #2 and use your linux machine - is that OK?

User avatar
memfault
 
Posts: 28
Joined: Fri Apr 16, 2021 5:33 am

Re: PyBadge - unable to enumerate USB device

Post by memfault »

Yes, I'm using linux boxes, but had few WinXP laying around in home, and win7, win10 boxes in company I work for.

User avatar
adafruit_support_carter
 
Posts: 29153
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyBadge - unable to enumerate USB device

Post by adafruit_support_carter »

OK, this may just be a repeat from your first post, but let's run the check again. And do this with PyBadge #2 (the one showing CircuitPython REPL).

Disconnect the PyBadge from the PC.
Run this at the linux cli:

Code: Select all

dmesg -T -w
Note what the last message is, so we know where new messages will start.
Now plug the PyBadge in.

Post here what you get in dmesg when the PyBadge is plugged in.

Don't press any button or anything. For now, just see what happens with a simple plugging in to USB port.

User avatar
memfault
 
Posts: 28
Joined: Fri Apr 16, 2021 5:33 am

Re: PyBadge - unable to enumerate USB device

Post by memfault »

you can run

Code: Select all

dmesg -c
to clear dmesg buffer

there's result of dmesg -T -w after:

Code: Select all

[śro kwi 28 21:41:29 2021] usb 2-1.1.1.1.3: new full-speed USB device number 82 using xhci_hcd
[śro kwi 28 21:41:29 2021] usb 2-1.1.1.1.3: device descriptor read/64, error -32
[śro kwi 28 21:41:29 2021] usb 2-1.1.1.1.3: device descriptor read/64, error -32
[śro kwi 28 21:41:29 2021] usb 2-1.1.1.1.3: new full-speed USB device number 83 using xhci_hcd
[śro kwi 28 21:41:29 2021] usb 2-1.1.1.1.3: device descriptor read/64, error -32
[śro kwi 28 21:41:29 2021] usb 2-1.1.1.1.3: device descriptor read/64, error -32
[śro kwi 28 21:41:29 2021] usb 2-1.1.1.1-port3: attempt power cycle
[śro kwi 28 21:41:30 2021] usb 2-1.1.1.1.3: new full-speed USB device number 84 using xhci_hcd
[śro kwi 28 21:41:30 2021] usb 2-1.1.1.1.3: Device not responding to setup address.
[śro kwi 28 21:41:30 2021] usb 2-1.1.1.1.3: Device not responding to setup address.
[śro kwi 28 21:41:30 2021] usb 2-1.1.1.1.3: device not accepting address 84, error -71
[śro kwi 28 21:41:30 2021] usb 2-1.1.1.1.3: new full-speed USB device number 85 using xhci_hcd
[śro kwi 28 21:41:30 2021] usb 2-1.1.1.1.3: Device not responding to setup address.
[śro kwi 28 21:41:31 2021] usb 2-1.1.1.1.3: Device not responding to setup address.
[śro kwi 28 21:41:31 2021] usb 2-1.1.1.1.3: device not accepting address 85, error -71
[śro kwi 28 21:41:31 2021] usb 2-1.1.1.1-port3: unable to enumerate USB device

User avatar
adafruit_support_carter
 
Posts: 29153
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyBadge - unable to enumerate USB device

Post by adafruit_support_carter »

Thanks. Now repeat same process for PyBage #1.

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”