Bangle.js 2 stuck in bootloop. dfu flashing did not help #5788
Replies: 1 comment
-
Posted at 2022-09-24 by @fanoush try this https://www.espruino.com/Bangle.js2#resetting-without-loading-any-code and then the step below it - delete all code Posted at 2022-09-24 by myxor Sadly this does not work. Pressing the button keeps continuing the boot loop Posted at 2022-09-25 by @fanoush Button should be released as described, if you still keep holding it then it will reboot. Posted at 2022-09-25 by myxor The instructions say
but my watch does not get into this state. It keeps rebooting with "Checking storage... My button is not stuck as I can switch to DFU mode by releasing the button while === are on the screen. I already let the battery run flat and charged it but it is still stuck. Posted at 2022-09-25 by @fanoush then maybe try to release button earlier - already when checking storage shows, if it says watchdog then you are holding too long and watchdog reboots it Posted at 2022-09-25 by myxor No chance to get between those two messages "Checking storage..." and "Storage OK" - it's like 1ms time between them. I tried several times to release the button at various times in the boot loop but no success. Maybe @gfwilliams has an idea what to do here :) Posted at 2022-09-26 by @gfwilliams Do you have any idea what might have caused this? Did it 'just happen' one day, or were you developing with it? Holding the button should really have allowed you to boot to the Bangle logo and reconnect (unless you'd uploaded code that 'runs on reboot' - but that's hard to set up and there are warnings in the IDE). You could try installing the attached firmware - it'll use internal flash for Bangle.js rather than external, so might work ok. It'd help narrow down what the issue is - if it's code saved to flash then we might have to try and send some commands to clear out the external flash. Attachments: Posted at 2022-09-26 by @fanoush
I now see you removed also the https://github.com/espruino/Espruino/blob/master/boards/BANGLEJS2.py#L171 SPIFLASH definition from NOFLASH build. Not sure it can break anything but in my experience with other watches it is harmless to keep it in and it is enough to just not use it in The advantage when keeping SPIFLASH definition there is that while it is not available for Posted at 2022-09-26 by myxor @gfwilliams the watch was stuck on friday morning and i reseted it by pressing the button for 6 seconds. It then switched into bootloop mode. I was wearing the watch before and did not upload any code for days. The firmware you attached boots! Posted at 2022-09-26 by @fanoush
With this build the 8MB SPI flash storage with your (broken?) data is unused. If you flash normal build back it will start rebooting again (you can try). You first need somehow to erase the SPI flash to get rid of the stuff that breaks the boot there and then you can go back. Posted at 2022-09-26 by myxor
How do i do this? Posted at 2022-09-26 by @fanoush Well, it is a bit tricky but still doable, you need to send direct spi flash commands like in https://www.microchip.com/forums/m910893.aspx but I don't have exact line here, needs some experimenting. Maybe @gfwilliams has the code ready. What is easier for me is to enable the SPI flash for Flash API as mentioned in my post #9 and then the js code is easier, basically calling Flash.erasePage() described at https://www.espruino.com/Reference#Flash for addresses of external SPI flash which starts at 0x60000000 should do it so if you are adventurous you may try attached build or wait for @gfwilliams with attached build EDIT: attached build removed, newer one is in post below Posted at 2022-09-26 by @fanoush I made another build, there were more lines removed in the NOFLASH build, here is another one with also this line https://github.com/espruino/Espruino/blob/master/boards/BANGLEJS2.py#L52 added back full change in board file I used is here
Attachments: Posted at 2022-09-26 by myxor @fanoush i tried your build and erased that flash page. It worked! The Bangle booted with
and now welcomes me with the welcome screen. I will restore my backup and see if everything works. Thank you so far! Posted at 2022-09-27 by myxor After almost one day of usage it seems that everything works again as expected and before. Thanks again to fanoush and Gordon for the help. Posted at 2022-09-27 by @fanoush Nice that it is working for you again :-) However it looks that with some bad luck the watchdog reboot caused by holding the button may break stuff. In this case I guess the reboot was triggered in the middle of flash write and for some reason the check at boot time did not detect this corruption and yet some other code later crashed on such bad data. If that happens again it would be good to have backup of SPI flash storage to reproduce and fix this crash (or maybe it was never ending loop). BTW, the watchdog reboot can be delayed a bit by enabling watchdog interrupt but I am not sure that the code handling the interrupt could do something about the pending flash write to avoid such corruption. Posted at 2022-09-28 by @gfwilliams @myxor have you managed to run @fanoush thanks! I've just updated the NOFLASH firmware with those changes. This seems particularly rare - but if it happens to anyone again please post up before running Posted at 2022-09-28 by myxor
Yes, exactly this. I erased that page and was able to flash normal firmware and boot. Posted at 2022-12-17 by yogsoy Hi @gfwilliams, you wanted updates if this happened again! I'm pretty sure I'm experiencing the same issue myxor was having. My Bangle.js 2 is (currently) bootlooping in the same way they described and firmware reflashes aren't getting anywhere. I've also tried flashing both the modified firmware you originally uploaded, and the newer one that fanoush uploaded, and those haven't produced any change. Situ was, I had uploaded some new code of mine to the device from the web IDE maybe a minute ago, and was trying to get it connected back to my phone to try out a function I'd just written. The watch wasn't reconnecting to my phone after disconnecting from my computer, so I held the button to reset it. Screen went blank, got the normal WATCHDOG message, and after showing "BOOTING..." the backlight turned off and it rebooted into the same screen. Unsure if the code I uploaded caused the issue directly (doesn't look like it should, I can upload snippets) or I've done the same thing as myxor and corrupted the SPIFLASH. Can cooperate helping you get a clone of the flash if that's what you need. Posted at 2022-12-19 by @gfwilliams Wow, ok - what firmware version were you on before?
So you mean even with the noflash builds, you can't get it to stay running without rebooting? If so that sounds like a different issue - please could you take a video of what the boot loop looks like? ... Or if the noflash images do at least boot, it'd be great if you could do me a flash dump so I can see if I can reproduce/fix it here. Posted at 2022-12-19 by yogsoy Update! Got annoyed by the screen flashing next to my bed while I was waiting for it to discharge, so I kept looking around for any other ideas (sorry!). Saw some of the same recommendations to upgrade the firmware, and was reminded that there's a cutting-edge build I could try. Pushed through flashing that twice in the web IDE and once through nRF Connect on my android phone and it eventually loaded up alright. I checked the firmware version reported using the "About" app and there's been no issue since (about 30hrs have passed). Haven't reinstalled the "default apps" or had to upgrade the bootloader. Before this, I was running the most recent stable firmware, which I believe is 2v16? Unfortunately, it didn't occur to me to take video of the loop, but from memory, I was seeing the white screen of the bootloader with the version number, "NO NEW FW" after checking storage(?), and the line "Booting...". Everything seems alright from my end now, but if you reckon there's anything I can do to help diagnose this in future, I'm able to help (again, sorry for moving forward on this so impatiently). Posted at 2022-12-19 by @gfwilliams
Yes, it should be. That's very odd though as nothing's really been done in 2v16 that would impact the reliability too much: https://github.com/espruino/Espruino/blob/master/ChangeLog
Yes, absolutely. Well, I'm just glad it's fixed for you! I'm not sure if there's much you can do now - unless you feel like trying to reinstall 2v16 and see if it errors again - then we could try imaging flash to track it down. ... but I'd be inclined just to leave it as-is! Posted at 2022-12-20 by yogsoy I've switched back to 2v16 as I think I was having stability issues with the cutting-edge firmware, I'll let you know if this happens again. Posted at 2023-03-23 by Ocim Hi, would it be possible to make a noflash for the latest firmware? My bangle has intermittent flash issues and I would like to run it without but still be on the latest release. Posted at 2023-03-23 by @fanoush I have tested @gfwilliams 's idea https://forum.espruino.com/conversations/384817/#16909373 and it works, github makes the build for you without having any build environment. I have forked Espruino into new The changes I did are here https://github.com/fanoush/Espruino/pull/5/files Basically I copied the BANGLEJS2_NOFLASH board file to BANGLEJS2 because that one is built as part of the workflow. Then it showed it actually does not build as is https://github.com/fanoush/Espruino/actions/runs/4501570382/jobs/7922189470 so I needed to trim some stuff down in second commit. After you download it I will close the pull request without merging. Too bad it is not possible to abandon/delete pull request completely on github. EDIT: another build (third commit) here, with removed initial factory content there is 80KB more available for storage Posted at 2023-03-23 by Ocim Thanks, I downloaded the BANGLEJS2 build. Posted at 2023-03-24 by @fanoush
And does it work? If you have github account you can also make the build yourself any time in the future as I described. Before creating pull request you just need to "enable allow actions and reusable workflow" for your forked Espruino repo as per attached picture. After making pull request and letting it do the builds you can disable it again if you want it disabled. It looks like this is free service of github, not sure what are the limitations. Attachments: Posted at 2023-03-24 by @gfwilliams Thanks for documenting this!
Well, if I haven't hit limitations yet, I doubt you will! It does seem 'too good to be true' really :) Posted at 2023-03-24 by Ocim I will try tonight, I am in London this week, forgot to bring a charge cable and yesterday the watch ran out of battery... Thanks a lot for your hep Posted at 2023-03-27 by Ocim It did not work, tried it a few times via the Android DFU app and got an error (see attached). Then I tried it this morning using the Web IDE but that tried to flash the default v17 automatically before I could select the file. I hit the cancel button but that was a mistake because now I the watch is not doing booting properly anymore and I get a bank0 invalid message. I cannot connect to the watch anymore, so I guess it is bricked? Attachments: Posted at 2023-03-27 by @fanoush Not bricked, you still have the DFUTarg device so you need to repeat/finish the DFU. Just checked and it looks like the build artefact is zip inside zip! Please unpack the BANGLEJS2.zip and use the espruino_2v17.2437_banglejs2_noflash.zip inside for DFU. Also if that zip would not work you can recover via some official Bangle2 zip from http://www.espruino.com/Download Posted at 2023-03-28 by Ocim Flashing the unpacked file worked, however it is now showing "Erasing Storage area..." for about 2 hours already and it does not seem to complete. How long should this take maximum? Attachments: Posted at 2023-03-28 by Ocim I disabled bluetooth on my phone and noticed later that the watch had booted. It seems to be completely empty though. 0 apps installed. Attachments: Posted at 2023-03-28 by @fanoush Yes, it is completely empty and you need to upload stuff again. You stopped using external 8MB SPI flash storage and now you are using small internal flash - only about 480KB free. This is enough for few apps but not for much so not sure how many apps will fit. It even does not contain the initial flash content because you would otherwise have two copies there and I hope it is not needed(?) and everything can be uploaded via app loader(?) @gfwilliams is it OK or is this https://github.com/espruino/Espruino/blob/master/boards/BANGLEJS2.py#L76 needed to be there as the initial content is not part of the app loader upload? @ocim in case the default content I removed in last build is really needed and you won't get it working with just the apploader you can take previous build which still has is (and the storage is smaller) Posted at 2023-03-28 by Ocim It works, I loaded 10 apps and it seems fine. more responsive even, compared to the old version Device Type BANGLEJS Posted at 2023-03-29 by @gfwilliams Great!
And yes, it would be - internal storage is a lot faster. It's just you get a lot less of it |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-09-24 by myxor
My Bangle.js 2 is in a bootloop since this morning.
I See the bootscreen
Booting....
Checking storage...
Storage OK.
Booting...
Checking storage...
Storage OK.
And so on.
I can start the dfu mode and flash a firmware package but after reboot it loops again.
I can not connect via Bluetooth with App Loader because the connection drops every few seconds.
Any idea what I can do?
Beta Was this translation helpful? Give feedback.
All reactions