================================================ Reloading DigiSpark bootloader using usbasp. ================================================ D H Rice 17/07/2020, 23/11/2020 ================================================ Arduino: https://www.arduino.cc/ ================================================ Adding DigiSpark to Arduino IDE ================================================ https://www.instructables.com/Digispark-DIY-The-smallest-USB-Arduino/ This is very helpful: http://digistump.com/wiki/digispark/tutorials/connecting Drivers and firmware: https://github.com/micronucleus/micronucleus v2.04 In the box labeled “Additional Boards Manager URLs” enter: http://digistump.com/package_digistump_index.json I got this when using the board maager: "CRC error, file corrupted. Try to repeat later" This helped. https://github.com/arduino/Arduino/issues/9719 I deleted C:\Users\doug\AppData\Local\Arduino15\library_index.json When I next opened the IDE it seemed to have installed the new boards. C:\Users\doug\AppData\Local\Arduino15\library_index.json ~/.arduino15/library_index.json https://github.com/arduino/Arduino/issues/9719 - Win10 reports CRC error 1) Delete ~/.arduino15/cache (because if the Arduino IDE uses the cached indexes, it won't trigger the bug) 2) (OPTIONAL) If you want to avoid waiting over 5 minutes for Library Manager to open (due to #9701), delete ~/.arduino15/library_index.json. The bug occurs with or without it, it just occurs a lot faster without. Start the Arduino IDE Sketch > Include Library > Manage Libraries... This bug has been reported for a number of years. ================================================ Upload new firmware and fuse settings using usbasb. ================================================ red 5V black 0v brown mosi yellow mis0 green sck blue rst =========================== usbasp =========================== black GND * * MISO yellow . * SCK green . * RST blue . . NC red VCC * * MOSI brown =========================== digispark =========================== . *black 0V *red 5V * brown moso * yellow miso * green sck . . * blue rst =========================== arduino micro leonardo =========================== usb . . . * GND black . * RST blue . . . . . . . . . * SCK green . * MISO brown . * MOS0 yellow . . =========================== https://github.com/micronucleus/micronucleus https://www.instructables.com/id/Refresh-Your-DigiSpark-clone-With-a-Smaller-Bootlo/ C:\Users\doug\Desktop\micronucleus-master\micronucleus-master\firmware\releases> DigiSpark rev3 I brought three DigiSpark rev3 - version 1.6 and 7 DigiSpark unmarked - version 2.2 I read the boot loader from the new unmarked chip. I cannot find this on the Web. avrdude -p t85 -c usbasp -U flash:r:digispark_boot_flashesLED.ihx:i digispark_boot_flashesLED.ihx version 2.2 micronucleus-firmware https://github.com/ArminJo/micronucleus-firmware rem > Device has firmware version 2.2 flash LED, but has required bootloader to be reloaded avrdude -p t85 -c usbasp -e -v -i 1000 -U flash:w:digispark_boot_flashesLED.ihx -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m rem > Device has firmware version 2.4 avrdude -p t85 -c usbasp -e -v -i 1000 -U flash:w:t85_default.hex -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m avrdude -p t85 -c usbasp -e -v -i 1000 -U flash:w:t85_default.hex -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m ================================================ Running Digispark Uploader... Plug in device now... (will timeout in 60 seconds) > Please plug in the device ... > Press CTRL+C to terminate the program. > Device is found! connecting: 16% complete connecting: 22% complete connecting: 28% complete connecting: 33% complete > Device has firmware version 1.6 C:\Users\doug\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.0a4/launcher -cdigispark --timeout 60 -Uflash:w:C:\Users\doug\AppData\Local\Temp\arduino_build_617949/Keyboard_button4.ino.hex:i Running Digispark Uploader... Plug in device now... (will timeout in 60 seconds) > Please plug in the device ... > Press CTRL+C to terminate the program. > Device is found! connecting: 16% complete connecting: 22% complete connecting: 28% complete connecting: 33% complete > Device has firmware version 2.2 ================================================ C:\Users\doug\Desktop\micronucleus-master\micronucleus-master\firmware\releases> C:\Users\doug\Desktop\micronucleus-master\micronucleus-master\firmware\releases>avrdude -p t85 -c usbasp -e -v -U flash:w:t85_default.hex C:\Users\doug\Desktop\micronucleus-master\micronucleus-master\firmware\releases>avrdude -p t85 -c usbasp -e -v -U flash:w:t85_default.hex -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m C:\Users\doug\Desktop\micronucleus-master\micronucleus-master\firmware\releases>avrdude -p t85 -c usbasp -U flash:w:t85_aggressive.hex -v -e avrdude: Version 6.3-20190619 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "C:\Users\doug\Desktop\micronucleus-master\micronucleus-master\firmware\releases\avrdude.conf" Using Port : usb Using Programmer : usbasp avrdude: Warning: cannot open USB device: Function not implemented AVR Part : ATtiny85 Chip Erase delay : 400000 us PAGEL : P00 BS2 : P00 RESET disposition : possible i/o RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 12 4 0 no 512 4 0 4000 4500 0xff 0xff flash 65 6 32 0 yes 8192 64 128 30000 30000 0xff 0xff signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 Programmer Type : usbasp Description : USBasp, http://www.fischl.de/usbasp/ avrdude: auto set sck period (because given equals null) avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.07s avrdude: Device signature = 0x1e930b (probably t85) avrdude: safemode: lfuse reads as F1 avrdude: safemode: hfuse reads as D7 avrdude: safemode: efuse reads as FF avrdude: erasing chip avrdude: auto set sck period (because given equals null) avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: reading input file "t85_aggressive.hex" avrdude: input file t85_aggressive.hex auto detected as Intel Hex avrdude: writing flash (8138 bytes): Writing | ################################################## | 100% 0.45s avrdude: 8138 bytes of flash written avrdude: verifying flash memory against t85_aggressive.hex: avrdude: load data flash data from input file t85_aggressive.hex: avrdude: input file t85_aggressive.hex auto detected as Intel Hex avrdude: input file t85_aggressive.hex contains 8138 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 0.44s avrdude: verifying ... avrdude: 8138 bytes of flash verified avrdude: safemode: lfuse reads as F1 avrdude: safemode: hfuse reads as D7 avrdude: safemode: efuse reads as FF avrdude: safemode: Fuses OK (E:FF, H:D7, L:F1) avrdude done. Thank you. C:\Users\doug\Desktop\micronucleus-master\micronucleus-master\firmware\releases>avrdude -p t85 -c usbasp -U flash:w:t85_aggressive.hex -v -e rem > Device has firmware version 2.4 rem > Device signature: 0x1e930b rem > Available space for user applications: 6522 bytes rem > Suggested sleep time between sending pages: 7ms rem > Whole page count: 102 page size: 64 rem > Erase function sleep duration: 714ms