I've just received my digispark ATtiny85 (model B, I believe). I'm using Pop_OS for my PC, had a bit of a headache getting the arduino IDE recognising the device but after some trial and error I got there.
When uploading a sketch I would then get erase errors and if I recall correctly it was error -71.
I couldn't work it out but found out that my boards came with v1.6 of the micronucleus firmware. So I upgraded to the latest which is v2.6. Now when I upload a sketch however the output looks like the following
Sketch uses 718 bytes (11%) of program storage space. Maximum is 6012 bytes.
Global variables use 9 bytes of dynamic memory.
Running Digispark Uploader...
Plug in device now... (will timeout in 60 seconds)
Warning: device with unknown new version of Micronucleus detected.
This tool doesn't know how to upload to this new device. Updates may be available.
Device reports version as: 2.6
Warning: device with unknown new version of Micronucleus detected.
This tool doesn't know how to upload to this new device. Updates may be available.
Device reports version as: 2.6
I don't have a clue what to try next as everything feels like it should be at a working point. Not sure how to decipher "Updates may be available". I'm using the latest arduino IDE, with the digistump board manager url and using the latest micronucleus firmware for the board.
I tried to re-flash the firmware to v2.4 just on the off chance that the firmware was too new to be supported in arduino IDE but I received the same error as above but with just a different version number reported.
1 Answer 1
It seems the latest version (1.6.7) of the Digispark board support package is quite old, older than I'd have guessed. And so it does come with an old Micronucleus programming tool. The tool appears to compare the major version number of the firmware as found in the USB device version. And since the Micronucleus tool in the 1.6.7 package is expecting nothing newer than major version 1, major version 2 of the firmware is not going to work with it.
You have a couple of options.
Reprogram old firmware (1.11)
You already seem familiar with burning .hex files. So, if you want to use the latest official Digispark board support you need to burn the hex file for Micronucleus version 1.11. I replicated your error, but using an OLIMEXINO-85-ASM which is highly similar to the Digispark but may not be identical. After programming micronucleus-1.11.hex the board worked with the official Digispark board support package.
Use ATTinyCore
However, you could also just abandon that old official package and use ATTinyCore which does come with a Micronucleus bootloader new enough to program the Digispark board with Micronucleus 2.6. I tested that as well.
Patch a new Micronucleus tool into your old official support package
You can replace the Micronucleus tool with a newer one in your arduino15/packages/digistump/tools/micronucleus/2.0a4
directory. Incidentally, I have no idea where the 2.0a4
comes from, but it is not indicative of a Micronucleus 2.0 in any way that I can tell.
For testing I put the 2.6 firmware on the board, specifically the t85_default.hex file, and stole the Micronucleus tool out of the latest ATTinyCore board packages tools directory, by renaming the existing file an symbolically linking in the other one:
$ pwd
/home/user/.arduino15/packages/digistump/tools/micronucleus/2.0a4
$ ls
launcher micronucleus
$ mv -iv micronucleus micronucleus.backup
renamed 'micronucleus' -> 'micronucleus.backup'
$ ln -s ~/.arduino15/packages/ATTinyCore/tools/micronucleus/2.5-azd1b/micronucleus
$ readlink micronucleus
/home/user/.arduino15/packages/ATTinyCore/tools/micronucleus/2.5-azd1b/micronucleus
$
And that works as well.
Digispark (Default - 16.5mhz)
as the board chosen,