SpenceKonde / ATTinyCore

Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8
Other
1.53k stars 301 forks source link

Cannot upload bootloader to Attiny85 #860

Open legalmachinery opened 1 month ago

legalmachinery commented 1 month ago

Arduino IDE will not upload bootloader to a new Attiny85, returning this error:

free(): invalid next size (normal) Error while burning bootloader.

The chip is a brand new one from RS-Online.com, set on 1MHz internal with Optiboot and the USBtinyISP from Sparkfun running SLOW.

The system: Debian 12, Arduino IDE 1.8.19 from the package manager. This core is installed via board manager. Just for the record, the D.A. Mellis core will not upload bootloader either. Everything worked fine on a previous system running Debian 11 and the older Arduino version. The programmer does blink but then ends with the above error. I do appreciate the IDE from the Linux package manager must not be used with this core, but does it mean it will not work at all and under no circumstances? As I prefer installing software from the package manager rather than getting the system messed up with third party blobs. Also have tried other chips with a bootloader already installed on them but to no avail. Thank you

legalmachinery commented 1 month ago

UPDATE

I have now uploaded a test.hex file to the chip with avrdude and it worked out of the box. Then I exported my sketch in Arduino IDE to a hex file, uploaded with avrdude and it works straight away. What's going on here?

I will now need to investigate how it works with supposedly no bootloader, what clock, fuses etc. It's quite weird as my sketch actually controls an SPI digipot MCP4261 and it works out of the box with no previous testing or fine tuning...