Yes I’m using the standard library and back when the glitch first happened (in a project that wasn’t Arduventure) I tried it and it didn’t work, only the shorting pads reset worked for me… I’ll try it again with Arduventure this evening.
I don’t know much about Arduino hardware and bootloaders but reading about it it seems you need some extra hardware in case I wanted to update the bootloader with a fixed one?
There aren’t many cases when holding UP and LEFT wouldn’t work. You have to have them held while plugging into the USB port to apply power. The screen should remain blank since it doesn’t get initialised.
@davidperrenoud: So I tried the test in CodeBenders again and you’re right, it’s doesn’t work there either. The reason it worked for me at some point is cause I had some extra code in the setup function that set all elements of the array to 0 which makes it work for some reason but of course isn’t a solution to the problem.
@MLXXXp: Tried the UP LEFT method and it doesn’t work… The screen does stay black when I plug in the USB cable but the moment I upload something the last uploaded sketch appears.
That would be great In the meantime I might just start on a simpler game that doesn’t exceed the 188X bytes of RAM, or I could just continue with Arduventure and go for a reset record .
Another software possibility is to add a reboot key sequence. I’ve done this while working on other projects… (hold down all 4 Dpad buttons at once to trigger a reboot)… Then you can re-flash a large program without having to unplug the USB (which gets old fast). I’m not sure if that sort of thing belongs in core lib though… or maybe as an option? It’s actually pretty hard (on the dev kit) to push all 4 buttons at once though.
If the screen stays black the safe mode is working - that’s all it does - freeze the boot so the Arduino IDE can request a USB restart which should go right into the bootloader and result in your new sketch being uploaded… I’ve never seen this fail, so I’m not sure what problem you’re hitting.
If the screen stays black the safe mode is working - that’s all it does -
freeze the boot so the Arduino IDE can request a USB restart which
should go right into the bootloader and result in your new sketch being
uploaded… I’ve never seen this fail, so I’m not sure what problem
left+up doesn’t work with me half the time, the screen goes black, but uploading a new program just makes it reboot with the old code.
Grounding reset is the only method I’ve found that works consistently.
Could it be dodgy hardware? I seem to be a magnet for weird hardware faults.
No idea. The reason reflashing breaks is because a large sketch can overwrite the memory that the USB code users to store a “reboot” flag. What happens when USB asks for a reboot is a flag is stored and then a little later it’s checked and if it’s still set it reboots. This is because evidently sometimes there are false positives and you have to “undo” the flag (which isn’t possible because they don’t save it, but still). Silly boot loaders.
All safe mode does is see if both buttons are pressed and then go into a infinite loop (thereby leaving memory alone). This allows the reboot flag to be set successfully (and not changed)… causing the device to reboot.
That’s all safe mode does… if your device reboots right before flashing then safe mode has done it’s job. I have no idea why AFTER the reboot it would refuse to flash the new code… perhaps the delay just isn’t long enough. Someone else was having this problem that it took a few seconds to start flashing a new program and then they rebooted their PC and flashing started instantly.
The fix needs to make it into a released version of the IDE so that that compiled sketches and the boot loader agree on the new memory location (end of RAM)… that said I think you can still incorporate the fix into the boot loader so that when the IDE catches up the problem “fixes” itself… I"m not 100% sure though… I’d have to re-review the whole thread and see what the “transition” plan is for getting from the old system to the new system.
I posted a new question on the thread. I think we should update our boot loader to check both the OLD and NEW locations for the magic key… that would make it future proof for when the Arduino core gets the patch… and if it never does it also wouldn’t hurt us in any way.