Actually this version does work for me, only when you increase the size of the array to 320 (for example) that it causes the glitch. But as I said, on Codebender it works fine.
I tried with int array[315] (1 893 bytes) and it requires a manual reset to upload a new sketch with Arduino 1.6.6, but also with CodeBender.
With int array[612] (2 487 bytes) the serial monitor cannot connect anymore, but I think that it is a small annoyance.
Thanks @DSSiege11 for the nice test! If a fix is not found upstream, we could maybe ask @bateske to change the bootloader (put bootKeyPtr at 0x9FF instead of 0x800).
Yeah no problem, wow good find. Between finds like this and the sound driver itās not the worst thing that production is late or we couldnāt have been able to include fixes for everyone!
Do you know?:
If youāre using the latest standard Arduboy library, you can hold down the UP and LEFT buttons while powering up, to put the Arduboy into safe mode to allow sketch upload, as described here.
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
youāre hitting.
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.