Author Topic: Digispark Pro: Flash write error -1 has occured  (Read 8961 times)

zezba9000

  • Newbie
  • *
  • Posts: 3
Digispark Pro: Flash write error -1 has occured
« on: January 02, 2016, 11:04:52 pm »
My Digispark (original works just fine) BUT my Digispark Pro won't upload any program.
My system is Windows 10, x64, Arduino 1.6.7 (everything is up to date).

I've tried over ten times now on different USB ports. Nothing works.
When I first plugged in the device I saw the built in blinky app start up.
Then I tried to upload my own blinky app but its bricked the device on the first go.

Here is the error log:
Quote
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
> Device signature: 0x1e9487
> Available space for user applications: 14842 bytes
> Suggested sleep time between sending pages: 7ms
> Whole page count: 116  page size: 128
> Erase function sleep duration: 812ms
parsing: 50% complete
> Erasing the memory ...
erasing: 55% complete
erasing: 60% complete
erasing: 65% complete
> Starting to upload ...
>> Flash write error -1 has occured ...
>> Please unplug the device and restart the program.


EDIT: Tried once more and now Windows says the device descriptor failed.... Great now its totally brinked trying to upload a blinky prog... The digispark uploader doesn't find anything now.
« Last Edit: January 02, 2016, 11:08:13 pm by zezba9000 »

zezba9000

  • Newbie
  • *
  • Posts: 3
Re: Digispark Pro: Flash write error -1 has occured
« Reply #1 on: January 03, 2016, 02:28:13 am »
So I tried programming it with an Arduino UNO ISP.

I get the error:
Quote
avrdude: Device signature = 0x1e950f
avrdude: Expected signature for ATtiny167 is 1E 94 87
Double check chip, or use -F to override this check.

So I force the baud rate to 19200.
Quote
avrdude -p attiny167 -c arduino -P com12 -b 19200 -U flash:w:Blink.ino.hex:i

But that just gives me the errors:
Quote
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00

So I use "-F" without the baud rate setting. That flashes and verifies but the program never runs (simply blink app doesn't work).
Am I missing something?

zezba9000

  • Newbie
  • *
  • Posts: 3
Re: Digispark Pro: Flash write error -1 has occured
« Reply #2 on: January 03, 2016, 02:59:32 am »
Ok got it working. The Arduino ISP must be set to "#define BAUDRATE   1000000" for it to work.
In the Arduino ISP sketch make sure that is enabled instead of "#define BAUDRATE 19200".

Then upload via:
Quote
avrdude -p attiny167 -c arduino -P com12 -b 1000000 -U flash:w:ProBootloaderR2.hex:i

So now I have un-bricked the device! WoHo!
After installer the bootloader I was able to upload different programs via the built in USB.
« Last Edit: January 03, 2016, 03:01:03 am by zezba9000 »