Author Topic: Digispark Pro seems to have lost its bootloader  (Read 12198 times)

ajablu

  • Newbie
  • *
  • Posts: 7
Digispark Pro seems to have lost its bootloader
« on: December 26, 2014, 03:50:39 pm »
I was happily making updates to the code on one of my many Digispark Pros when the Arduino IDE suddenly stopped recognizing when the Digispark was plugged in. Windows 7 makes a sound when it is first plugged in, displays a message about an unrecognized USB device, and then makes another sound as it disconnects. This all happens in about one second. This is a change from its previous behavior where it would make a sound on plugging in then after about five seconds make another sound as it disconnected. I believe my computer and cable are okay since I'm still able to program my other Digispark Pros normally, although I have tried another cable and all the USB ports on my computer. One thing worth noting is that I had been in the habit of pressing the Digispark's reset button when uploading rather than unplugging and replugging it. Don't know whether that could be a factor, but I've been doing it for several weeks now. I have also tried unplugging it and plugging in again when prompted for the upload, but to know avail. The last code I was able to upload to it does still run properly.

Any ideas what has happened and how to fix it?

Thanks,
John

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Digispark Pro seems to have lost its bootloader
« Reply #1 on: December 26, 2014, 05:15:37 pm »
Are all your Pro's release version or do you have a Beta?  My Beta did that once, and got a new version bootloader - and BLdr had another change before shipping.

What code were you working on?  USB?   I've have had the appearance of this a couple times.  Seems to relate to what I downloaded last.  Somehow the USB goes offline (either the Pro confused or the computer port).  Reboot/try another port.  Then hit reset/Upload/reset a time or two after uploading the same code to a working Pro.  I've not had a Pro not go back to working.

On my Beta I used the Digistump Prog Tool mostly because the reset is hard to hit with a header on.  On my release Pros I've not done a header yet, so I use the reset much of the time as I hate re-plugging.  Also there seems to be a new PC_Driver that will sometimes autoload without reset/replug - replugging seems to mess with this as does USB code.  I get 'err -1' on some uploads and hit reset on trying again and it usually picks up.
« Last Edit: December 26, 2014, 10:48:00 pm by defragster »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Digispark Pro seems to have lost its bootloader
« Reply #2 on: December 26, 2014, 06:45:11 pm »
If none of defragster's suggestions help and it is not a beta unit we'd love to get ahold of it to test and see what happened.

Please send us an email if those suggestions don't work - we'll be happy to replace it.

ajablu

  • Newbie
  • *
  • Posts: 7
Re: Digispark Pro seems to have lost its bootloader
« Reply #3 on: December 28, 2014, 06:38:25 am »
Thank you for the replies. My Digisparks are all KickStarter editions. The code is pretty simple, just some custom libraries to monitor inputs on some pins and switch outputs on other pins based on the inputs. I don't think it's the code or the USB port, I've tried all the USB ports and the same code is fine on other Pros and my PC has been rebooted several times.

I will follow up with Digistump for a replacement if there are no other suggestions to try.

Thanks,
John

KermEd

  • Newbie
  • *
  • Posts: 1
Re: Digispark Pro seems to have lost its bootloader
« Reply #4 on: December 30, 2014, 05:52:24 pm »
I was happily making updates to the code on one of my many Digispark Pros when the Arduino IDE suddenly stopped recognizing when the Digispark was plugged in. Windows 7 makes a sound when it is first plugged in, displays a message about an unrecognized USB device, and then makes another sound as it disconnects.

I am currently experiencing similar issues.  I picked up ~15 through kickstarter.  One of the Digispark Pro's I was working with Neopixel, when I went to use it today it after leaving it over night... seemed to lose my sketch.  Now it wont be recognized by PC and the blinking green LED won't blink.

To further complicate this, another digispark pro is not appearing as COM devices either.  I've removed / rebooted / reinstalled the 4 drivers.  It doesnt seem to require any specific windows services.  And I have removed / re-installed and tested non-digispark pro boards (they are working fine).

When I manually force the driver as a port through add legacy it throws an error code 10.  So, no idea how to fix it or reflash the firmware on these.  But I am having some doubts about using them in my current project - I really don't want to have to tear it apart to replace and repair modules later...

I suppose I should test a couple more...

Edit:  Tested 3 cables, 3 more pros.  Same issue.  Removed all 4 drivers, downloading the new package... 

Edit #2:  I see now that the digispark doesn't do the usual virtual port thing.  After updating, all the Digispark Pro's seem to be accepting sketches except for the one that appears to have stopped working overnight.  I see unsupported firmware bootloader install instructions, will debate if I want to risk running it on the dead pro - mostly because I suspect I wont be able to get a replacement.  But I'm now stepping out of the thread, hope the updated package works for the OP as well
« Last Edit: December 30, 2014, 06:32:01 pm by KermEd »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Digispark Pro seems to have lost its bootloader
« Reply #5 on: December 30, 2014, 09:56:34 pm »
@KermEd - if you are willing to send your non-working one back to us to investigate - we'll be happy to replace it

digi_guy

  • Jr. Member
  • **
  • Posts: 87
Re: Digispark Pro seems to have lost its bootloader
« Reply #6 on: February 06, 2015, 10:40:26 pm »
I think I've done this to two of my Pros now.

Any tips for getting them working again?

Do you still us to send them back?

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Digispark Pro seems to have lost its bootloader
« Reply #7 on: February 07, 2015, 03:03:14 pm »
Seeing this on  Win7?  Do you have access to a Win8 machine? 

On Win7: With sound on - if plugging the PRO to USB do you here the 'connect' chime?  Does the 'disconnect' never happen until you unplug or reset it? 

I got 3 units like this I sent back to examine HOW - if I then program them on Win8 they work - until they touch Win7 again.  Looking get a fixed Win7 driver or bootloader if what I found is really behind this.

May also see 'Device Err' pop-up and that is a different case I found - and this is how my 4th unit acts.


digi_guy

  • Jr. Member
  • **
  • Posts: 87
Re: Digispark Pro seems to have lost its bootloader
« Reply #8 on: February 07, 2015, 06:33:50 pm »
All my work is on a Windows 8 machine, but I checked them on a Windows Vista and had the same error. If I can get permission I might try on my wife's Mac...

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Digispark Pro seems to have lost its bootloader
« Reply #9 on: February 10, 2015, 02:34:22 am »
I got four in a bad state and got them to Digistump to evaluate.  What I saw doesn't seem to match the others from details I see here.  I had two (1 was Beta) stop taking code earlier and re-flashed the bootloader and they went back to working.

My first returned unit never shows connection on Win7 - but rather en error on connect, after being usefully reprogrammed many times before.

After much useful programming: I got consistent results on the last 3 of my 4 - Win7 would write them and they would then USB 'connect' and stay that way until reset or unplugged.  I put those on a Win 8 machine and it programmed them fine, and then the bootloader would return to bad behavior when plugged into Win7, and the next upload started and ended with error on verify and they wouldn't run at all until touched by Win8.

Waiting for feedback that they can be debugged and the culprit found & corrected.  Signs are the bootloader is in a failure state, and would probably reprogram, but the OS driver affects the one case oddly. 

rkinnett

  • Newbie
  • *
  • Posts: 7
Re: Digispark Pro seems to have lost its bootloader
« Reply #10 on: August 11, 2015, 11:56:44 pm »
Sorry to resurrect an aging thread;  I wanted to leave a note for future readers who stumble across this thread like I did (several times) while searching for clues about how to unbrick your digispark pro. 

If your computer is suddenly unable to recognize your 'pro after working fine previously, you may have inadvertently corrupted your bootloader and may need to reflash it. 

First, try all the usual troubleshooting tips:
https://digistump.com/wiki/digispark/tutorials/connectingpro#troubleshooting

If your spark still is not recognized, and if you happen to have access to an Uno or similar, then try this procedure:
http://digistump.com/wiki/digispark/tutorials/proisp

Be sure to limit baud rate, as defragster noted in the proisp troubleshooting steps.  Many thanks to defragster for your contributions to these forums.

FWIW, I suspect that, in my case, it was my misuse of array pointers that led to the corruption of the bootloader on my pro, although I haven't yet found the bug in my sketch that might be causing this.

Cheers!

Hammer

  • Newbie
  • *
  • Posts: 3
Re: Digispark Pro seems to have lost its bootloader
« Reply #11 on: August 31, 2016, 03:31:34 pm »
Quote
After much useful programming: I got consistent results on the last 3 of my 4 - Win7 would write them and they would then USB 'connect' and stay that way until reset or unplugged.  I put those on a Win 8 machine and it programmed them fine, and then the bootloader would return to bad behavior when plugged into Win7, and the next upload started and ended with error on verify and they wouldn't run at all until touched by Win8.

Waiting for feedback that they can be debugged and the culprit found & corrected.  Signs are the bootloader is in a failure state, and would probably reprogram, but the OS driver affects the one case oddly.

The same problem. Solved by uploading bootloader V2.03 via USBasp: https://github.com/micronucleus/micronucleus/blob/master/firmware/releases/t167_default.hex

Led on PB1 blinking like mad until sarts uploading sketch. Not every upload is successful, but after pressing reset button onboard and reconnecting USB it works again. No bootloader corruption anymore.
« Last Edit: August 31, 2016, 03:33:22 pm by Hammer »