-
• #2
I've figured it out. The line
source scripts/provision.sh BOARDNAME
needs to be between
cd ~/source/repos/github/espruino/Espruino
and
make clean && make DFU_UPDATE_BUILD=1 BOARD=BOARDNAME RELEASE=1
-
• #3
For Q3 you need to build full firmware hex - without
DFU_UPDATE_BUILD=1
and you need to have swd debugger dongle that can unlock locked nrf52 chip = anything except stlink v2.maybe most flexible and easy is getting raspberry pico and flashing it with ready made cmsis-dap firmware from https://github.com/majbthrd/DapperMime/releases
-
• #4
Last night I had been able to use my nRF52DK to load the bootloader and application hex files that I'd built, but couldn't get past a boot loop. It appeared to keep on timing out with a "WATCHDOG" message. I could get it into a DFU state (hold BTN1 then release as the ='s appear), but that wouldn't create a DfuTarg for updating.
At that point I gave up and went to bed. As expected this morning, the watch had fully discharged and was blank. I plugged it in to charge and it all booted up like a new Bangle2! It said the storage was corrupt (no surprise there), then formatted it and proceeded to the Welcome app. Now I'm just letting it charge for a couple of hours before doing anything more.
What is the importance of the
DFU_UPDATE_BUILD=1
? Should I rebuild the firmware without that option and re-program them using the nRF52DK? -
• #5
Actually, I think I can answer my own question. I had been following the instructions on the page:
https://github.com/espruino/Espruino/blob/master/NRF_Bootloader.md
They are now outdated, but I ended up doing:
make clean;BOARD=BANGLEJS2 RELEASE=1 BOOTLOADER=1 make
and
make clean;BOARD=BANGLEJS2 RELEASE=1 make
Then loaded the bootloader.hex file first, followed by the application.hex. Then power-down overnight and here I am...
-
• #6
The 'application' hex made by your last line should include everything including bootloader. It is actually softdevice + application + bootloader + bootloader settings + UICR so five different pieces merged into one. there should be hexinfo.py installed (part of intelhex pip package needed by nrfutil) that can be used to examine the hex file.
The
BOOTLOADER=1
should not be needed as long as there isbootloader : 1
in board file https://github.com/espruino/Espruino/blob/master/boards/BANGLEJS2.py#L28DFU_UPDATE_BUILD=1
makes DFU update zipAnyway, great that you got it working :-)
After drowning my KS BangleJS2 in my local swimming pool, I purchased an SMA Q3 from Alibaba (I was keen to get back into my Bangling without bothering Gordon).
I've bought an nRF52, made a USB adapter cable and started following the instructions at https://github.com/espruino/Espruino/blob/master/README_Building.md
Building a native Espruino seemed to work, as did cross-compiling a PUCKJS version (the 'make' instruction is wrong in an obvious way). Then I tried making a BANGLEJS2 version, but I got the following message:
make: *** No rule to make target '/home/andrew/source/repos/github/espruino/Espruino/targetlibs/nrf5x_15/modules/nrfx/mdk/gcc_startup_nrf52840.S', needed by 'espruino_2v11_banglejs2.elf'. Stop.
It looks like I'm missing an assembler?