I got back to this and implemented SWDCON console for Espruino devices (should work on any ARM Cortex with SWD). Currently it sits in https://github.com/fanoush/Espruino/tree/f-swdcon and somehow works for me with openocd
When it is built in and enabled in board file, it can be used like this (see also openocd docs 15.6 Real Time Transfer (RTT)):
then you can telnet to localhost port 2222 press enter and then wake up device if it is sleeping and the console should be switched and work. For telnet command it is better to switch it to character mode via ctrl+] and typing mode character. For better usage with telnet the console would need to implement some telnet protocol handshaking but not sure it is worth it. Also due to this there is some garbage in the console when the mode is switched so just press enter again (and/or ctrl+c).
To turn it back off execute something like Serial1.setConsole() or for Bangle2 setConsole(null,true) in the SWD console and then something like
This is meant to work also with BANGLE 2 devices with broken Bluetooth which are otherwise inaccessible. For those there is some extra code to force the console switch even if it is already forced to null - which is the state when you turn off the programmable checkbox in settings. For now it is not usable with WebIDE as it does not support telnet but when I'll finish the custom SWD/RTT debugger host implemented in espruino javascript then any other espruino device can redirect its console to this and act as a proxy to Bangle2 over two GPIO pins.Then one could install apps also over cable.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I got back to this and implemented SWDCON console for Espruino devices (should work on any ARM Cortex with SWD). Currently it sits in https://github.com/fanoush/Espruino/tree/f-swdcon and somehow works for me with openocd
When it is built in and enabled in board file, it can be used like this (see also openocd docs 15.6 Real Time Transfer (RTT)):
then you can telnet to localhost port 2222 press enter and then wake up device if it is sleeping and the console should be switched and work. For telnet command it is better to switch it to character mode via ctrl+] and typing
mode character
. For better usage with telnet the console would need to implement some telnet protocol handshaking but not sure it is worth it. Also due to this there is some garbage in the console when the mode is switched so just press enter again (and/or ctrl+c).To turn it back off execute something like
Serial1.setConsole()
or for Bangle2setConsole(null,true)
in the SWD console and then something likeThis is meant to work also with BANGLE 2 devices with broken Bluetooth which are otherwise inaccessible. For those there is some extra code to force the console switch even if it is already forced to null - which is the state when you turn off the programmable checkbox in settings. For now it is not usable with WebIDE as it does not support telnet but when I'll finish the custom SWD/RTT debugger host implemented in espruino javascript then any other espruino device can redirect its console to this and act as a proxy to Bangle2 over two GPIO pins.Then one could install apps also over cable.