-
Thank you @fanoush and @Gordon,
why do you want to upload your own bootloader?
It is all about my watersports ready bangle js 2.
The only change the bootloader (main.c) will be to make it useable without a button: On restart always go to dfu, timeout if no connection, then always boot espruino in the recovery menu. I think this can be done with the build flags. On "off" also watch the charger pin to wake it up. The rest can be done outside of the bootloader.
So this should build the bootloader:
make clean;BOARD=BANGLEJS2 RELEASE=1 BOOTLOADER=1 make
?
And then I use the App Loader website with the "firmware app" to upload the build output of this build or is there a better tool?
learn that now and you can omit the dfu and fwupdate, SWD is faster
Yes I will do that even if I don't brick my bangle because with my bangle js 2 I also got a SMA Q3 with default firmware so I need the swd for that too. For my current little modification I hope it won't brick my bangle.
There's a bit of info on the Github builds on https://github.com/espruino/Espruino/blob/master/README_Building.md#super-easy-github-method but it looks like you figured it out.
I guess the question is: why do you want to upload your own bootloader?
The Bangle firmware is designed such that as long as you don't touch the bootloader you're reasonably safe uploading your own firmware builds, so from that side of things I think you're ok.
But if you really want to mess with the bootloader it's just a matter of time before something gets bricked. I think you really need to look at SWD for programming. There's info on wiring at https://www.espruino.com/Bangle.js2+Technical#swd
and examples of using a DAPLink at https://www.espruino.com/AdvancedDebug