-
• #2
Can I use this hex file with the "Firmware update" app of the "App loader" or do I need to convert it or better use some other app?
Look into https://github.com/espruino/BangleApps/tree/master/apps/fwupdate
It can update bootloader but not sure if you can provide custom file. The hex is probably the bootloader hex in your bin folder which is used for merging into big hex file with everything.
usehexinfo.py
that gets installed as part of nrfutil to examine hex files to see what they containIs it okay that there are some build warnings that functions can't be inlined?
Yes.
Looks like I am just a small step away from bricking my watch. The next question will be how to setup the swd environment :-)
Sooner or later you'll probably brick it so maybe learn that now and you can omit the dfu and fwupdate, SWD is faster. Was discussed here few times. If you don't have SWD dongle then Raspberry Pico with picoprobe firmware is perhaps easiest to get and use and you can also use the Pico for other stuff. Otherwise there are tons of CMSIS-DAP/Daplink dongles on aliexpress for less than price of Pico, one random example https://www.aliexpress.com/item/1005005882951417.html You can then use Bangle charging cable with something like this https://ibb.co/album/hc0hnC
-
• #3
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.
Looks like I am just a small step away from bricking my watch.
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
-
• #4
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.
-
• #5
Ahh, that explains it!
And then I use the App Loader website with the "firmware app" to upload the build output of this build
That sounds right, yes. The app loader is the best way unless you have SWD I think
Hello,
Finally my bangle js 2 (firmware 2v21) arrived and I am ready to build and try my own firmware changes on the real device!
Apps are working and for the firmware I want to start with the github actions. I already run a github action build and it produced a 320 KB banglejs2.zip file.
What's the best way to upload the zip and flash this zip? I have DaFlasher running and could use either klick "Start Bootloader" or "Do Dfu Update". Or I could use the "App loader" and the "Firmware update" app. Or some other tool.
I will make changes to targets/nrf5x_dfu/main.c (is this called the nrf bootloader?) and other c files like jswrap_bangle.c. Does the banglejs2.zip created by the github action contain the artefacts from those files and which flashing methods will flash it to the watch?
Edit: Looks like I can use the "Firmware Update" App in the app loader to upload the zip inside(!) the banglejs2.zip. It will contain jswrap_bangle.c but not nrf5x_dfu/main.c.
I just setup a bulld environment which will create the bootloader from nrf5x_dfu/main.c. Is it okay that there are some build warnings that functions can't be inlined? Can I use this hex file with the "Firmware update" app of the "App loader" or do I need to convert it or better use some other app?
Looks like I am just a small step away from bricking my watch. The next question will be how to setup the swd environment :-)