Uploading a sketch reboots all USB devices on PC

Every other time I upload a new sketch to my Arduino 33 IoT every USB device connected to my computer disconnects then reconnects. Everything from my Mouse and Keyboard to my VR headset and DAC will reset it’s connection.

This leads to rather a lot of annoying issues. SteamVR will attempt to start up afterwards which causes slowdowns and display swapping. My DAC will loose connection so any audio I’m listening to cuts out for a few moments, and I can’t even interact with the IDE on account of all my input devices cease functioning for several seconds. It’s a strange problem, and one I’ve never encountered before. I do have a lot of things plugged into the USB ports, but even stripping it down to just input devices I still seem to have this issue.

This issue happens no matter which sketch I use, as well as when I use the command line tools through VSCode, or the Arduino IDE itself.

Any ideas? I’m not sure where to go from here and have had no luck in finding results on google

Do you have a recent computer with AMD chipset ? There should be a new BIOS. Can you try an other USB port ? Try a USB port that is directly connected to the CPU.

There is a Arduino IDE 2.0 beta.
You can try that to check if that makes it better.

I use a red USB 3.2 USB port for my Arduino, and there is sometimes still USB trouble. The newer Arduino IDE 2.0 makes it worse in my case. Someday a new BIOS will hopefully fix it.

Typical, just when I think it’s working it stops.

I have a 1st gen Ryzen, so fairly recent. I updated the BIOS and system drivers on my PC, and I moved my Arduino to the Red 3.1 port on this motherboard (It’s an Asus Crosshair VI Hero, so USB 3.1 was the new hotness when it was manufactured)

It seemed to work for a while, but I just ran into the issue again after working on a sketch for a while this morning. After several successful uploads, my DAC and VR headset re-connected again (although at least this time my input devices survived)

EDIT to add: I just tried the Arduino 2.0.0 beta as well, no luck there either. Was able to get several uploads done but then the same thing happened.

I’m sorry, but I don’t have a solution, I don’t even have a clue :cry: The USB trouble is with newer AMD chipsets as far as I know. It could be the driver in Windows, or hardware in the computer, or something wrong with the Arduino board.

Is it only with the Arduino 33 IoT ?
Can you do you project with a ESP32 ?
Can you try an other computer ?

Can you place your arduino on a USB hub and see if the problem is solved? Also the program you are loading may cause issues (unlikely). I have no experience or knowledge on AMD USB issues but if USB devices all reset, it means their host reset them. Then why would a host reset devices? Babbling device, USB state error? All I can imagine is that all those ports you’re using are connected to one USB hub so something happens to the hub communication and the hub is reset or it resets all its downward connections.

If you isolate your arduino with a hub, then the hub is solely responsible for maintaining proper states on the USB so only that arduino may get reset and that would not affect upstream. Your arduino has issues but if it is usable and isolated, it’s OK if it resets an extra time.

Is there an appreciable increase in power draw from the Arduino 33 IoT while uploading a sketch?
I believe I may have found a potential solution to the problem, but I’m not sure it makes sense…

I tried putting the Arduino on it’s own hub but unfortunately that had no effect on it’s own

The Topping E30 DAC I recently got has a USB-A fitting on it’s power cable. With where I put the DAC, the cable couldn’t reach the USB power rail. So I just plugged it into my PC without much thought, thinking I’d move it around next time I re-did the cables behind my desk.

I’m wondering if the increased power draw from driving the DAC on top of everything else already plugged in pushed the USB host right to the limit of what it would provide, so even a small increase during upload was enough to knock it over and reboot?

I tried testing the sketch upload on my laptop with the DAC connected and playing music to test there as well. I did not encounter this issue, so I moved everything back to my main PC for more testing. However, having moved things around I could reach the USB Power rail now, so I plugged it in there.

Since then, I’ve uploaded the bare minimum sketch about 20-30 times and only had the USB host restart on me once. I unplugged even more things since then and have not had it happen again. And thinking back I think I might not have had this issue until after I got the DAC. Although I did very little with the Arduino before the DAC arrived


So, TL;DR,
Is it possible that my USB host was having trouble powering all my devices? If so, do you think having a powered USB hub help avoid similar issues like this in the future?

Alternatively, I soldered the headers onto this 33 IoT myself and my soldering skills are… shall we say “beginner” level at best. If I did a spectacularly poor job with soldering the headers (no shorts that I could measure from the outside at least) could I have done some damage or bridged something that could cause the USB host to freak out?

Bad soldering can cause this. Do you dare to show us a detailed photo :stuck_out_tongue:

I can tell a few stories from my own experience:

  • Laptops can have weak USB power. Things can go hairy when they enter the sleep mode.
  • A cheap power supply (with spikes and noise) can disturb things when connecting or disconnecting USB devices.
    I needed a power supply for a few weeks and bought the cheapest one I could find. I’m not going to make that mistake again ! Crashes and audio problems, especially with USB devices.
  • I avoid to install extra drivers in Windows 10. I try to let Windows 10 install its own drivers. However, sometimes it still goes wrong. I had to fix some weird driver issues in the past.
  • A USB device that is powered by a (cheap) power supply can cause noise from the mains to enter the computer.

It can be about anything. A powered USB hub is always good.

That’s a good idea, having a powered hub. I’m thinking that maybe your root hub over current protection is ganged, which means if the total exceeds a certain current limit, it reports to hub and hub turns off all devices until over current condition is over and everything back on. Having a separate powered hub and move some of your USB 2.0 devices to it will alleviate the power consumption of your root hub. I attempted to find out whether my root hubs are ganged or individual over current protection from device manager but found nothing useful.

Hmmm… The problem lingers. Well, I guess it could still be a not so great soldering job.

I picked up a powered USB hub, but I reproduced the issue again almost immediately while the Arduino was connected through the hub.

I’ll try desoldering these headers and see if it makes any difference. EDIT: Nope, no luck here. If it was a bad solder job the damage is already done.

It’s starting to sound more and more like a “me” problem though. Some weird configuration or software quirk specific to this machine.
I may have to learn to just live with it :upside_down_face:

Could you try a process of elimination? Disconnect all USB devices. Hope that makes it work. Then one at a time reconnect your USB devices until the problem starts to reoccur.