You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a specific USB hub that refuses to detect any device using the V-usb example code. The device doesn't show up in Windows Device Manager or Linux lsusb. I have narrowed it down to the following lines of code in main.c:
usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */
i = 0;
while(--i){ /* fake USB disconnect for > 250 ms */
wdt_reset();
_delay_ms(1);
}
If I remove that piece of code, the problem goes away. The problem also goes away if I use a different hub, or if I connect directly to the computer without a hub, or if I first plug the device into the hub and then connect the hub to the computer.
My theory is that this "disconnection" is not actually happening. So when the hub detects the device insertion, and asks it for identification, it gets no response because the device is still within this arbitrary delay period. And so it gives up.
So I guess my questions are:
What purpose does this "enforce re-enumeration" process serve? What problem is it intended to solve?
Why might it be causing the device to fail to enumerate? Why does it fail to perform as intended?
Am I okay to just remove the offending piece of code? Or can I change it in some way to work better?
The device I'm flashing is an ATmega88, which happens to be on a USBasp clone board (because it was convenient). The schematic is:
The text was updated successfully, but these errors were encountered:
I have a specific USB hub that refuses to detect any device using the V-usb example code. The device doesn't show up in Windows Device Manager or Linux
lsusb
. I have narrowed it down to the following lines of code inmain.c
:If I remove that piece of code, the problem goes away. The problem also goes away if I use a different hub, or if I connect directly to the computer without a hub, or if I first plug the device into the hub and then connect the hub to the computer.
My theory is that this "disconnection" is not actually happening. So when the hub detects the device insertion, and asks it for identification, it gets no response because the device is still within this arbitrary delay period. And so it gives up.
So I guess my questions are:
The device I'm flashing is an ATmega88, which happens to be on a USBasp clone board (because it was convenient). The schematic is:
The text was updated successfully, but these errors were encountered: