How To Use Flashlight Mode To Fix Bricked Arduboys

You can also hold up+left+a+b for two second to enter boot mode. That’s the best way.

2 Likes

Uh, so does this not actually work any more?

I’ve tried a number of games, and I think almost exclusively it is games that have been made by @filmote and @Vampirics but I tried flashlight mode and it didn’t do anything in respect to the bootloader.

I actually had to continue to hold the down button, and it was only Arduino that was eventually able to find it after it went through a full cycle of the bootloader.

Erwins uploader was unable to program it.

Is this intended?

There are some other implementations that seem to work, so I’m confused what the difference here.

Starduino seems to have it’s own implementation, when you hold up it goes into bootloader mode and stays there, but since it isn’t constantly cycling arduino only finds it if you hit upload first, then turn on the arduboy while holding up.

It looks like I need to amend the help guide, but is holding down something you have to do on some games?

At what point did this change?

Are you talking about games that eliminate the USB stack? Sketches that do this need either the DOWN button held or the reset switch to upload a new sketch.

Flashlight mode (or safeMode) should work with any sketch that includes it (whether required or not) as long as the USB stack hasn’t been eliminated.

1 Like

Which ones specifically?
A lot of @filmote & @Vampirics’ games remove the bootloader stack.

(Can I recommend trying Minesweeper instead? :P)

Starduino is a complete and utter mystery because its source has never been published.

When people started hitting the progmem ceiling and doing crazy things to scoop more memory back.
(So, about a year or two ago I think?)

1 Like

So up just rescues you from a game that has too tight of a loop or messes with the magic number.

If the game doesn’t have the usb stack, then it’s really only a flashlight. Is that right?

I’m not sure I got the memo on this but it makes sense now that I’m reading it.

The latter.

(Loops usually aren’t an issue - up actually works by putting the CPU into an infinite loop that does nothing.)

Ultimately it’s just a light source with an infinite loop, whether or not the USB stack is there.

The reason it works for code that still has the USB stack is because it prevents whatever obscurity is thrashing the memory and upsetting the ability to flash a new program.

1 Like

A “too tight” loop won’t cause problems. It’s only when the magic number location is rapidly and continuously changed by the sketch or interrupt code.

Correct. (Which is all flashlight mode was originally intended for.) :wink:

1 Like

Ah ok, well maybe it was some other memory related crash some user was having that flashlight helped solve from. Cool. I got some updating to do of the guide then I guess >_<

“No USB” capability was added to the Arduboy2 library in release 5.0.0 on March 22, 2018.

Arduventure originally used code from a beta version of the Arduboy2 library shortly before that, and then switched to using the Arduboy2 library when it was released. The first release of Arduventure used the UP button but it changed to the DOWN button when the library code was used.

I’m not sure exactly when Starduino, with USB eliminated, was released. I think a bit before the above.

1 Like

I’ve always tried to stress that any sketch that eliminates the USB stack makes it abundantly clear of the fact, and what’s required to load a subsequent new sketch, either within the sketch itself or plainly in the documentation.

Sketches can also make it easier by allowing the pressing and holding of DOWN somewhere within the sketch (which will trigger the sketch to call exitToBootloader()). Doing this means the user doesn’t have to power off and then power on while holding DOWN. Arduventure, among others, makes use of this.

2 years, 1 month and 5 days, so my guess wasn’t far off.

It was probably under develop before then,
but it wasn’t released until early last year (around January 2019).

Unfortunately, documentation has a tendency to ‘go missing’ when people just grab .hex files from Eried’s repo.
In the program itself would be better, but that does end up being slightly counterproductive in that it ends up using more memory, which is probably why it isn’t done more often.

Hopefully with better tooling (in particular @tuxinator2009’s upcoming GUI program) it’ll become more apparent.

Perhaps the revised .arduboy format could make a note of it.
(Assuming that the uptake of .arduboy files improves.
We could do with some kind of easy .arduboy creation GUI tool to encourage that.)

I’m not sure how the introduction of the FX chip will impact the situation.
(I vaguely remember something about the new bootloader potentially having some kind of difference.)

The idea is that you gain quite a bit of space in eliminating USB and only a small amount of that has to be “given back” to implement a “press and hold DOWN” feature. However, some developers have the attitude “I want to make my game as big as possible, using whatever space I can get. I couldn’t care less about what it takes to load something else.”

Once a sketch is running, nothing else will be able to affect it. It might be possible to write somewhat smaller substitute USB code, that a sketch could include, which would only detect and act upon the required closing (dropping DTR) of the virtual serial port at 1200 baud.

I’m gonna go through like a bulldozer to posts and just update them myself with instructions on uploading. Years too late. But, whatever. I might also get around to hosting the repo soon… :smiley:

Keep in mind that sketches that eliminate the USB stack are rare exceptions, rather than the rule. Existing instructions are fine for any sketch that retains USB, and holding DOWN won’t work for them.

EDIT: Actually, I believe DOWN will work with @Mr.Blinky’s Cathy bootloader.

Also note that using the reset button will always work if you get the timing right (and the bootloader itself hasn’t been corrupted). And, as @Pharap noted, @tuxinator2009’s new utility will help with that.

1 Like

I think it’s more of a “we’ll just explain it in the instructions/documentation” approach.
Which like I say, is fine until the instructions go missing.

Off the top of my head:

  • Arduventure
  • Evade 2 (I think)
  • A handful of Press Play On Tape’s later games
    • (That’s Filmote & Vampirics)

Remember that all games will be from the last 2 years,
so you can limit the date range in the search settings.

Personally I’d have bolded the ‘if’. It’s as much luck as it is skill.
(Though I do find that pressing reset immediately after ‘upload’ on the Arduino IDE usually works well.)

With the FX bootloader. You’ll see the loader menu after the bootloader is triggered by the down button as feed back. There is also no timeout so the crucial timing bit dissapears.

By default, powering Arduboy on will show the loader menu and when this option is disabled pressing down while powering on will enter the loader menu.

The plan for the FX game library is to add a modified wiring.h to the games and recompile them so pressing UP+DOWN for ~2 seconds will trigger bootloader mode. It would be nice if this could be integrated with Arduboy2 library in the future

correct.

2 Likes

I never had much of a problem. You set Show verbose output during: ☑ upload and press reset when you see the port scan messages.

1 Like

It still requires pressing the reset button, however you no longer have to get the timing just right so it is a lot easier. The next update I’m planning on switching over the upload code in general so that it will sit there waiting for an Arduboy regardless of which hex/bin you’re uploading. This will eliminate the need for the added step of using the “Fix Corrupted Arduboy” tool since you would just click to upload a game and if the Arduboy isn’t being showing up (due to being corrupted or the USB stack being removed) you would just need to press the reset button (again with no precise timing requirements).

With that in mind it would be easy enough to document an all encompassing easy fix. Simply upload a game using ArduManFX and if it isn’t detecting the Arduboy then press the reset button while its trying to upload (no timing required).

2 Likes

All our games have implemented the ‘down’ button functionality to return to the bootloader from the main menu / splash screen. This was chosen because it is consistent with @Mr.Blinky’s approach.

It is much easier - however testing it with games like my 1944 that have the ‘down button’ / return to bootloader you only have to press down from the menu and the TuxTool works properly.

2 Likes