• It is not frozen it just does not react to anything but it still works and saves power so I think the idle javascript loop still runs fine.

    So does it update the time in that state? It's that it doesn't respond to the button presses?

    I am planning to implement javascript console over SWD

    This would be awesome! I wasn't sure how to get started with this, but if you have a proof of concept for what to do on the nRF52 I could probably integrate it pretty quick.

    if there was a way to inject some simple js code over existing connection in this frozen state (Like running 1+1 or process.memory() and see whether it still responds would be interesting.

    I've been meaning to implement something like https://www.espruino.com/ide/relay/ in the App Loader (so it could be used from within Gadgetbridge) - that might really help here - although if debugging Gadgetbridge in Android Studio I believe you can get it to send data.

  • So does it update the time in that state?

    no, time is frozen on screen, no reaction to anything except that for me the screen was blanked next day and battery lasts for very long (like normal). And holding button will trigger watchdog reboot => without holding button the watchdog is obviously still pinged so it is still alive.

    This would be awesome! I wasn't sure how to get started with this, but if you have a proof of concept for what to do on the nRF52 I could probably integrate it pretty quick.

    I think I already mentioned it somewhere but there is Segger RTT technology - basically small C code linkable to Espruino that does memory buffer as i/o more info https://wiki.segger.com/RTT the code itsef is e.g. here https://github.com/adfernandes/segger-rt­t

    So from JS/Espruino it could be standard console object writing to circular memory buffer. From the other side it can be used from openocd with some swd debugger but I am thinking about some SWD library as Inline C + maybe some JS around it so you could use another espruino with 2 gpios to connect to it. Basically the device would then act as usb to segger rtt i/o 'serial' adapter so you would connect IDE or putty to it and you would get bangle console. Specific espruino device I have for this is the ~$2 STlink V2 clone dongle (aliexpress) https://github.com/fanoush/EspruinoBoard­s/tree/master/STLINKV2

    Someone even had basically same idea with Forth and com over swd here https://mecrisp-stellaris-folkdoc.source­forge.io/swdcom.html but they did not use segger rtt and they used that dongle 'as is' with original stlink firmware and some custom code talking to it https://github.com/Crest/swdcom . In theory same could be also done with CMSIS-DAP dongles (same ~$2 thing on aliexpress in many variants) which uses USB HID protocol so no need for custom OS driver with that one. But I think something acting like USB to serial would be easier to use with IDE.

    EDIT: started separate conversation for this https://forum.espruino.com/conversations­/380926/

About

Avatar for fanoush @fanoush started