Sorry for the long intro, but it helps explaining the context of the question.
I've been trying to understand more about how the smart watch works to write a custom firmware for it by reading the arduino-like code that was posted on github. I noticed that all the examples have in the loop()
function the following code:
if(digitalRead(BUTTON)) standardShutdown();
This line appears to be monitoring the power button, and in case it's pressed, shut down the watch. This raises a concern, though. The boot chain as I've understood so far is this: when the watch is turned on, it starts executing the bootloader code at the address 0x08000000. If the USB is connected and the user pushes the button within one second, it enters dfu mode and allows to download a new firmware. Otherwise, the user code, which sits at 0x08040000 is run.
Now, what happens if due to a programmer mistake, the code enters an infinite loop, and never checks the power button nor shutdown? Is there a way to force-reset the watch (such as holding the power button for five seconds, connecting the usb cable with the button pressed or some combination like that) to run the bootloader again, and download a new firmware? If there isn't, will a mistake that causes an infinite loop brick the watch permanently?
Normally I would just try and see what happens, but I don't want to brick my watch, that's why I'm asking here.