Digispark gets "Flash erase error -71 has occured"

I’m using ubuntu, attempting to upload small test sketch to digistump digispark v2.

Have made the recommended changes to udev rules as outlined on the digistump troubleshooting linux page.

Unfortunately, no matter what I try I am seeing the following:

jeremy@makebook:~/Work/handscanner$ pio run -v -t upload 
[Fri Nov 10 21:19:57 2017] Processing digispark-tiny (platform: atmelavr, board: digispark-tiny, framework: arduino)
Collected 35 compatible libraries
Looking for dependencies...
Project does not have dependencies
BeforeUpload(["upload"], [".pioenvs/digispark-tiny/firmware.hex"])
Please unplug/plug device ...
micronucleus -c digispark --timeout 60 .pioenvs/digispark-tiny/firmware.hex
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 40% complete
> Device has firmware version 1.2
> Available space for user applications: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94  page size: 64
> Erase function sleep duration: 752ms
parsing: 40% complete
parsing: 60% complete
> Erasing the memory ...
erasing: 79% complete
>> Flash erase error -71 has occured ...
>> Please unplug the device and restart the program.
======================================== [ERROR] Took 7.85 seconds ========================================

I have tried this with 2 different digisparks and am seeing the same error. This is directly connected to my laptop, no usb hub. I have tried all usb ports.

Any ideas or help greatly appreciated.


edit - I just tried this on my macbook pro and it worked… Must be something on the linux laptop.

Could you try this package?

Unpack it and place files to ~/.platformio/packages/tool-micronucleus. Please keep package.json without changes.

I’ll try to carve out some time in the next couple of days to try this. Will report back here.

Hi both,

I have the same issue, using the package did unfortunately not solve the problem. Any other ideas how to fix…

Can this somehow be related to this issue?

THanks and greetings from Old Europe

One more thing, indeed it seems to be connected to the issue I referenced in my previous post. I patched version 1.06 in a similar way (i.e to ignore error -71) and replaced the micronucleus binary with the frehsly compiled version and voila it works.

Could you explain in details how to fix it?

I have the exact same issue, with different error codes on different ports , -32 and -71. Can you properly explain how to do what you just said? what is platformio and where to replace those files? I installed arduino from official site(is there a modified version?)

I replaced files as suggested but nothing changed. I’m getting same error in Arduino and Platormio IDE (VSCode Version). Are you sure my DigiSpark isn’t bad?

Today I got the same problem when uploading to Digispark USB.
It worked for some uploads and then stopped permanently (even after reboot). Always getting flash error -71 now.
Using the same computer I can’t upload to any of my Digispark USBs any longer. Using another PC it works on all of them. Doesn’t depend on what USB port or hub I’m using.
On both PCs the same version 1.8.9 is running. Tried version 1.8.5 up to 1.8.10.