Digispark gets "Flash erase error -71 has occured"


#1

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.

Thanks!

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


#3

Could you try this package?

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


#4

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


#5

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?

http://digistump.com/board/index.php/topic,464.msg2088.html#msg2088

THanks and greetings from Old Europe


#6

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.


#7

Could you explain in details how to fix it?


#8

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?)


#9

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?