It’s intended to be used as a “safe mode” but… in a totally dark room it does work! (It’s not very bright)
I may make a flashlight sketch for arduboy for my own amusement sometime then. Could be a good way to get back into programming.
Incorrect!
It was indeed intended to add a flashlight/torch feature to the Arduboy and still is. That’s the purpose @Dreamer3 added it for, and why the function is named flashlight(). The ability to use it to recover when you can’t upload new sketches under some circumstances is just a useful side effect.
If it was intended just for upload recovery, the function would have been named something more appropriate and it probably wouldn’t turn the RGB LED full intensity white, which is annoying for the purpose of an indicator (and the LED doesn’t even turn on for units with the LED reversed).
Besides, long before flashlight mode was added, there was already a “safe mode” implemented specifically to address the upload problem. You hold the UP and LEFT buttons during bootup. However, it’s only enabled for the Dev KIt units because it was believed that the reset button could be used for the production Arduboys. Then, when it turned out that flashlight mode could be used for the purpose, there was no reason to enable “safe mode” for the production Arduboy.
Well there you have it
i downloaded evade 2 and the green light wont show up when i plug my arduboy in
Evade 2 has a different procedure (watch the video):
You can also hold up+left+a+b for two second to enter boot mode. That’s the best way.
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.
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?)
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.
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.)
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.
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…
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.