Can someone repackage the micronucleus tool package with latest upstream, or help me make a PR to do it if that’s something I can help with?
I’ve been experiencing the pervasive micronucleus “flash erase error” -71, -32, etc. (see Digispark gets "Flash erase error -71 has occured" - #5 by Paul3492) with the micronucleus upload method. It looks like for most people this is happening because the flash erase takes long enough for the USB hardware to timeout and disconnect. This problem is described accurately here:
http://digistump.com/board/index.php/topic,464.msg2088.html#msg2088
That workaround in the micronucleus upload tool, which reconnects and retries when it detects a disconnect during flash erase, has existed forever and works properly in the latest upstream source. I suspect the reason I’m seeing this with the PlatformIO package is that more different error codes became associated with the disconnection, and the PlatformIO package is a little out-of-date with respect to upstream (-84 is what’s described in that patch from 2013, but I see -71 and -32 now – -84 might still be returned by libusb but obviously that particular one is handled).
Building latest upstream fixes the problem for me, but the shipped micronucleus binary seems to be modified to take an extra “-c” parameter (I made a wrapper script to strip it out), and I can’t figure out where that patch or any of the package source comes from.
Little help? I want others to be able to benefit from these updates to the uploader. Love PlatformIO.