Closed sodabrew closed 9 years ago
My device is a DigiSpark rev2 / Model A. Using a current git checkout: 58caa36ba05e06799201ae4a088401dabdddb2c3 Using libusb gem version 0.4.0.
Looks like you're having communications trouble. The commandline 'micronucleus' tool is much better at recovering from communications errors than the ruby library, so I suggest you try and use that. It is the most well tested code.
Thanks, I'll try this tomorrow.
The commandline tool works great, so I'm unblocked from testing 1.10. I will take a look at the Ruby tool to see if it can be improved, but if not, maybe there should just be one tool.
I just went spelunking through the libusb gem source and (at least) tracked it down to a call to the native library. In my unprofessional opinion, Bluebie's right.
Question @sodabrew: Is it a consistent issue or something that only happens every once in awhile?
Question @Bluebie: What part of the commandline code does the error handling for this type of situation? The ruby might be able to handle it and recover as well.
Some of the error handling is in micronucleus lib, some is in the cli ‘micronucleus’ app. There’s a pretty common error immediately after an erase cycle, which you can recover from by ignoring it and just searching the USB bus until the device comes back online
— Bluebie
On Friday, 20 December 2013 at 10:55 am, ScottMansfield wrote:
I just went spelunking through the libusb gem source and (at least) tracked it down to a call to the native library. In my unprofessional opinion, Bluebie's right. Question @sodabrew (https://github.com/sodabrew): Is it a consistent issue or something that only happens every once in awhile? Question @Bluebie (https://github.com/Bluebie): What part of the commandline code does the error handling for this type of situation? The ruby might be able to handle it and recover as well.
— Reply to this email directly or view it on GitHub (https://github.com/micronucleus/micronucleus/issues/35#issuecomment-30978326).
Consistent problem; it happens at different specific byte counts within a range of +/- 1k of where I posted.
Thinking about it, this is a pretty typical type of error in network programming, too. You just retry it a few times :)
The error happening during the write cycle is probably a timing problem. If the PC-side sends a write request too soon, it crashes the usb connection (because micronucleus is not USB compliant, but usually it can get away with it by only being broken during times when the computer isn’t talking to it)
— Bluebie
On Friday, 20 December 2013 at 10:58 am, Aaron Stone wrote:
Consistent problem; it happens at different specific byte counts within a range of +/- 1k of where I posted.
— Reply to this email directly or view it on GitHub (https://github.com/micronucleus/micronucleus/issues/35#issuecomment-30978506).
I forgot about this ticket, since I started using the C commandline tool. I'll take another look at the Ruby code before too long.
I changed the protocol in V2 a little, but it is not final yet. Basically it introduces the setup-only protocl idea by Embedded Creations. So some changes to the ruby tool may be necessary in the future to make it compatible
Not sure where to begin debugging this...