-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tiny-USB hangs on host reboot #13
Comments
I have just realized: After reboot > device is not recognized. Only manual unplugging / re-plugging helps. So basically this makes the whole thing useless, unless there's a trick we don't know about? |
I tried something on Linux level, but didn´t succeed. I am not the expert so far. |
Sorry, closed by mistake! |
Since the author isn't answering, I'm forced to ask:
|
I've looked into this briefly. It seems that this only happen with the digispark port of the i2c-tiny-usb fimware. Digispark uses an USB bootloader micronucleus, and I suppose (but I didn't really debug this), that the USB bootloader causes the issue. I think if you flash the original (not Digispark/micronucleus based) fw on the Digispark module's attiny85, than the issue will disappear, without getting/building new hardware. |
What exactly do you think is the problem? Are other digispark based projects also affected by this? |
Oddly it turned out that with my Digispark (likely a clone, i don't even remember where i bought it) i can't reproduce the issue, neither with reboot nor with switching off and back on my computer, by using the main.hex available in the digispark dir. One variable could be the micronucleus bootloader version. @BeetleX99 , @PizzaProgram, could you please check what bootloader version do you have? It's written when the .hex is flashed with micronucleus as:
|
I have used a special fork of micronucleus, that is compatible with WinUSB driver, because it was impossible to flash the device with the "normal one".
|
|
I flashed the 1.6 version of the Micronucleus bootloader FW from here: https://github.com/mariusgreuel/micronucleus/tree/v1.06/firmware/releases (the file "micronucleus-1.06.hex") and on the top of that I flashed the i2c-tiny-usb main.hex from this repo. I can't reproduce the issue with rebooting on my Linux box... I see that your OS is Windows, but unfortunately i don't have the means to debug this under Windows. |
hmmm.... now I don't understand:
|
What kind of "box" is that? A Raspberry Pi? |
Great News! |
@BeetleX99, thx for sharing this observation! The hub has an external power supply, or host-powered? |
@BeetleX99 I guess you have an external power at your USB hub. Or maybe a bigger capacitor (condenser) built-in that "holds" the power for a moment while your mainboard is rebooting. The developers could use an external powered USB HUB to simulate and debug the problem too! |
I've just quickly looked at the kerner code but I don't find any " IMHO it's much more difficult to detect a signal loss, if not BOTH parties of the communication are keeping track of each other from time to time. (Maybe once every 1 sec? ) |
My hub doesn´t have an externel power supply. |
FWIW, you may try this patch. |
Sounds great! 👍 Sadly this is a bit too complicated for me how enable this patch on my RPi4. ... about these lines starting from 14:
How can this run for 250ms if |
Maybe it can/will be fixed in a future kernel/firmware (if it can be attributed to be a kernel/firmware issue). I did not update to the latest development there. The |
Maybe I have too low programming knowledge after 35+ years of learning, but this How about a simple, clear code, that everyone can understand and nobody thinks it's a bug?
That will run for 250ms, not 7650, or cause any byte-overflow ... |
Why not ? |
I too have experience a digispark freezing after a reboot of the host computer. This happens with every micronucleus firmware except the default. It seems we need the digispark to enter bootloader mode to re-initalize the USB connection after the host reboots otherwise it freezes. I've tried using a WDT to reset the digispark and the USB connection but again with a modified micronucleus ( like one that only enters the bootloader on external reset) it freezes without the bootloader resting the USB connection. |
Hi,
i2c-tiny-usb (main.hex on digispark) is fine with debian host.
But if the host is rebooting, the tiny doesn´t respond to the usb registering process. After a system reboot just pulling and replugging the hardware module re-enables the module again.
Any advice for fixing? I am not familiar with the USB state machines...
The text was updated successfully, but these errors were encountered: