[solved] Restore ATtiny85 bootloader

Hi, I have an ATtiny85 Board with an USB port (see pictures) and I’ve removed the 5 second boot up waiting time using the hex file offered for download in this video.

Now, the board can’t be programmed anymore, I can’t upload any code anymore. How can I restore the original state? Would it be restoring the bootloader? How do I make a backup of it? (I have a second board like this).

Thanks in advance for your help.

You might need an ISP programmer at this point (AVR Dragon, Atmel ICE, etc) and Atmel Studio to burn a new bootloader.

Yep, and the Pololu AVR programmer V2.1 is an absolute, rock-solid best buy. USB serial port, too!

I managed to resolve the problem by shorting P0 to GND with a 220 Ohms resistor and erasing the thing first with micronucleus. After that, I was able to reprogram it. I was lucky to have found that trick on this website: Link

Micronucleus (the bootloader - and the tool that uploads to it - are named the same thing) can be built with one of 5 ways to enter the bootloader:

  • On Power On
  • On External Reset (from reset pin, which is disabled in many of the T85-based boards
  • On Watchdog
  • On jumper
  • Always (always enter the bootloader on reset, no matter what kind of reset)

Regardless of how it gets there, it waits 5 seconds for an attempt to upload a sketch.

You wanted to get rid of that delay - so you used the "update" mechanism to upload a version of the bootloader that used the "jumper" method, and didn't have the delay. That uploaded fine the first time, only because there was no sketch to run. After you uploaded something, in order to upload with that version, you need to power it on with a specific pin "jumpered" to ground (P0, it sounds like). Using a resistor instead of a jumper is far safer, as it ensures that damaging current can't flow if that pin is set output and driven high by the sketch (if, for example, you chose the wrong pin to jump) - it sounds like this was the key piece of information you were missing when you uploaded that version of the bootloader.

My understanding is that there is now a version that's smart enough to jump to the application if it's not connected to a USB host (eg, if it's powered by a portable power bank or something).

I've been working on getting Micronucleus support into my ATTinyCore, which I've been expecting to release within a day for the past week, but still haven't gotten to take USB upload for a spin yet (tonight, maybe?). Every time I touched any part of that core, spiders, snakes, and other unfriendly creatures poured out of it and demanded urgent action to subdue... (Jeez, who's theclown in charge of maintaining that mess?! What? It's me?! Oh dear... I thought it looked familiar...)... so soon I'll be a bit better equipped to comment...