Bangle that came with SMA-Q3 Firmware

Posted on
  • A friend of mine recently purchased a Bangle js 2 from a vendor. It was delivered with the SMA-Q3 firmware installed, NOT the Espruino firmware, although it was delivered in a Bangle box. I have a correctly programmed Bangle js 2, and when I follow the instructions, can cause mine to publish the DfuTarg BLE, program it, update the firmware, etc. The SMA-Q3, expectedly, will not do ANY of these things.

    My friend did not receive good support from the company that sold it to him.. Ultimately, he sent it to me.
    Is there any way to save the firmware on it, and refresh it to the ESPRUINO firmware without a JTAG/SWD debugger such as this? https://www.adafruit.com/product/2209 I know there is a cheaper version of the debugger, but we do not want to use that.

  • See this https://forum.espruino.com/conversations­/392898/#17246018

    There is no way without SWD debugger (or I don't know about it). SWD debugger is < US$2 thing on aliexpress or you can use Raspberry Pico too. However easier is to check that post I linked above.

  • Sorry about this - I'm not sure how that happened.

    I've just replied in your post on the forum above, but I'll send you an email in a second and we'll make sure we get a new one sent out to you/your friend.

    There's no way to do the update wirelessly, but as @fanoush says there are a bunch of ways to update via SWD from different devices (including a Raspberry Pi Pico or normal Raspberry Pi) if you feel like trying to get the unflashed one working as well - you only have to connect 3 wires.

    Basically as long as you get GND in the right place (See https://www.espruino.com/Bangle.js2+Tech­nical#swd) and you're using a 3.3v device, you can't really go wrong - it won't physically damage the watch no matter what you do.

  • If you want to try yourself we can definitely guide you, it is not hard at all. Easiest is probably to use Raspbery Pico as you just push button and drop a ready made picoprobe uf2 on it and then use openocd. As for connecting it easiest is to probably cut some usb extension cable with usb female on it, connect 3 wires to Pico and use charging cable that came with the watch.

  • Thanks for the response(s). It's been quite a few years since I programmed such a device, but will probably attempt to program it. Most of my experience was in the EPROM days. It will be an introduction/refresher to/of modern methods.

  • I'm going to try and write this up properly at some point later, but I just reflashed a Bangle.js 2 using a cheap dongle.

    • Got a DAPLINK (CMSIS-DAP) dongle from amazon. I got mine from Amazon UK but this one on Amazon.com seems the same and costs $8 (with USB-C cable) : https://www.amazon.com/DKARDU-Replaces-d­ownloader-Emulator-Interface/dp/B0BGQZHL­75/ref=sr_1_5
    • Found an old USB socket and wired up to the dongle as in the picture:
      • GND -> GND
      • DATA+ -> SCK
      • DATA- -> SWD
      • 5V - don't connect
    • Then plugged the Bangle.js charge cable into this
    • Install OpenOCD from https://github.com/openocd-org/openocd/r­eleases/tag/v0.12.0 - you just need to extract the tar.gz file to a directory on your windows PC
    • Download the espruino_2v21_banglejs2.hex hex from this post, into the directory you extracted OpenOCD to
    • Open Windows command prompt/powershell in the OpenOCD directory
    • Type .\bin\openocd.exe -d2 -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c "init;nrf52_recover;exit" - this will erase the Bangle's flash and remove the write protect bit
    • Type .\bin\openocd.exe -d2 -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c "init;reset init;halt;program espruino_2v21_banglejs2.hex verify;reset;exit" to write the new firmware. It'll take a few minutes and does't say a great deal - just leave it and try not to knock any of the cabling while it's flashing or you may have to restart

    And that's it, you're done!

    I haven't tried it but I think @fanoush mentioned that the really cheap STLink USB programmers might be more of a faff to get working - but it looks like the 'CMSIS-DAP' dongles are almost as cheap and work out the box


    2 Attachments

  • I haven't tried it but I think @fanoush mentioned that the really cheap STLink USB programmers might be more of a faff to get working

    Yes those DAPlink/CMSIS-DAP ones are typically for the same price as STlink V2 dongles (sometimes even cheaper!) and are easier to use in Windows - no drivers needed - they work over USB HID. STlink needs "STSW-LINK009" driver from STM that needs login to download (but recently I noticed Windows 10 installs it automatically from Windows updates). With STLink you are however guaranteed to get STM32F103 compatible chip with 20KB RAM and at least 64KB flash (typically 128KB) inside so they are better for repurposing but otherwise for SWD they are not the easiest. With DAPlink the cheapest ones are based on cheaper ARM chips with 10K RAM/32K FLASH or even 8051 based CH55x chips.

    Picoprobe firmware for Raspberry Pico is CMSIS-DAP too so exactly the same procedure works.

    AND BTW those dongles are typically for about US$2 from China including tax and shipping. So maybe better then getting them from Amazon for much more one can get the Pico instead. Those are possibly not that expensive and after doing the recovery you can use the Pico for other stuff. There are even versions with pin headers already soldered on so connecting is as easy as those DAPlink dongles.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle that came with SMA-Q3 Firmware

Posted by Avatar for user157437 @user157437

Actions