How to Reset Arduboy if it's Bricked


(Tomi) #42

Well, that’s bad. But good to know, thanks.

It’s good that mine is USBtinyISP and it wasn’t expensive. Maybe I should check the levels just to be sure, but I think it’s proper. I’ve yet to use it with anything else than Arduinos or plain AVRs.


#43

I made wiki.
Please edit if there is content that can be added to it. :smiley:
http://community.arduboy.com/t/how-to-burn-bootloader-in-avrisp-mkii-and-atmel-studio-7/1893


(Scott) #45

I wrote a sketch that reads and displays the fuse and lock bit settings. It also reports if the settings properly protect the bootloader from being overwritten.

On my Kickstarter Arduboy, the bootloader is NOT PROTECTED! This means that it would be possible to upload a sketch that is too large, which would corrupt the bootloader, making further uploads impossible. The bootloader would have to be reinstalled using a hardware programmer attached to pads on the back of the Arduboy’s circuit board.

If your Arduboy is the same, I’d be pretty careful about uploading sketches using anything other than the Arduino IDE. (The Arduino IDE checks to make sure the sketch isn’t to large before performing an upload, so the bootloader won’t be overwritten.)

Note that it’s not possible to set the lock bits to the proper value without attaching a hardware programmer. It can’t be done using the USB port.

You can use the following sketch to check if your Arduboy has an unprotected bootloader.
If it reports:

  • “LOCK bits are OK” then the bootloader is safe.
  • “Bootloader UNLOCKED!” then corruption of the bootloader is possible.
  • “LOCK bits INCORRECT!” then the lock bits are set to an unexpected pattern.
/* Arduboy Fuses and Lock Bits display
 *
 * Displays the values set for the fuses and lock bits 
 * then indicates if the lock bits are:
 *
 *  - set correctly so the bootloader can't overwrite itself.
 *
 *  - set to default, which means the bootloader is unlocked and could
 *    overwrite itself.
 *
 *  - set incorrectly, meaning the lock bits are set in an unexpected pattern.
 *    The bootloader may or may not be locked.
 */

#include <Arduboy.h>
#include <avr/boot.h>

Arduboy arduboy;

void setup() {
  uint8_t lowFuse = boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS);
  uint8_t highFuse = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS);
  uint8_t extendedFuse = boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS);
  uint8_t lockBits = boot_lock_fuse_bits_get(GET_LOCK_BITS);

  arduboy.begin();
  arduboy.clear();
  arduboy.setCursor(0,0);
  arduboy.print("LOW Fuse:      0x");
  arduboy.println(lowFuse, HEX);
  arduboy.print("HIGH Fuse:     0x");
  arduboy.println(highFuse, HEX);
  arduboy.print("EXTENDED Fuse: 0x");
  arduboy.println(extendedFuse, HEX);
  arduboy.print("LOCK bits:     0x");
  arduboy.println(lockBits, HEX);

  lockBits &= 0x3f;
  if (lockBits == 0x2f) {
    arduboy.println("\nLOCK bits are OK");
  } else if (lockBits == 0x3f) {
    arduboy.println("\nBootloader UNLOCKED!");
  } else {
    arduboy.println("\nLOCK bits INCORRECT!");
  }

  arduboy.display();
}

void loop() {
}

A Dead Arduboy + Raspberry Pi + AVRdude + Noob
WIP: Android App that flashes games via OTG [Arduboy Mate]
Bring your Arduboy back from the dead (burn bootloader)
Bring your Arduboy back from the dead (burn bootloader)
Arduboy Massdrop
(Kevin) #46

Yeah as mentioned before Kickstarter units don’t have lock bits set. I had asked the factory to flash same as Leonardo but the lock fuses were omitted. All the preorder units have the correct and more safe setting. If people have a problem and somehow damage the bootloader we can try to help but the primary cause seems to be using non-recommended tools for uploading.


Bring your Arduboy back from the dead (burn bootloader)
Don't install the Fidget Spinner app! - Get help here
(Scott) #47

Other than the Arduino IDE, is there a list of “recommended” tools?


(Kevin) #48

Codebender

and we are evaluating the offline loader, we would love it if that was open source.

Working on getting our own online loader, so you’ll be able to one click upload games.


(Scott) #49

Not any more
https://codebender.cc/next-chapter


(Wade McGillis) #50

I’d just like to add that USB hubs can cause the reset button method to not work. Plug your arduboy directly into your computer.


(Scott) #51

I can’t see how a using a USB hub would affect the operation of the reset button. Can you point to more specific details describing the cause of the problem?


(Wade McGillis) #52

My Arduboy was bricked, and plugged into a USB hub. I tried the reset button several times, no luck. I could never get the timing right. I unplugged the hub and plugged the Arduboy directly into my computer. The reset button worked on the first try since my OS recognized the device right away instead of a delay of a few seconds.


(Jezzamon) #53

Yay!!! I had this issue and I’m so glad this fixed it! Thanks guys!


(Kevin) #54

When pressing reset, the serial connection is reset, and the USB device is re-enumerated. If the hub isn’t of great quality the enumeration step could be heavily delayed or perhaps even such a quick disconnect-reconnect could possibly fail to be recognized.


(spinal) #55

Doesn’t holding ‘up’ when powering on pop the Arduboy into a small loop? is that not good enough? I have used that mode for troublesome writes on my Arduboyclone.


(Holmes) #56

That has almost always worked for me in every circumstance.


(Jezzamon) #57

In my case, that didn’t work anymore. That’s the first thing I tried, which is what you need to do if the sketch uses too much memory, but perhaps something to do with using a dodgy cable that might have disconnected whilst programming meant that the Arduboy just looked dead, even when I did that.


(Kevin) #58

Hey folks, I updated the video to make the steps a little more clear and I think also more relavent to the way the current compiler is working in Arduino.


(Pharap) #59

I’m guessing those are @filmote’s Arduboys :P.

This is a much more in-depth (and thus much better) video than the old one.

Is that upload output set to verbose mode? (It seems to be more text than usual.)


(Kevin) #60

Always verbose mode forever


(Simon) #61

Nice video. And yes they are mine! I need them back in a hurry now so I can fry them all again.


(Kevin) #62

We need a gofundme for a new computer for @filmote he is getting a “USB Device Not Recognized” error when pressing the reset button. Anybody have any ideas?