Firmware update: Menu system and two-week battery life

A project log for Color Open Source Smartwatch

Reverse engineering the SMA-Q2 smartwatch to run open source firmware on it

emerythemeryth 02/09/2020 at 14:143 Comments

I've redesigned the way screens/apps are handled and introduced a main menu.

More importantly, I have managed to get the average current consumption down to 350-550uA (1.5mA previously)!

Turns out a huge chunk of it - 800uA, was a bug in the TWI (I2C) peripheral. Documented in the errata as Anomaly #89, the peripheral does not actually stop consuming power when disabled. Fortunately there is a simple software fix for it.

Another gain was from a small change in the notoriously power-hungry FreeRTOS implementation for nrf52.

Two weeks might be exaggerated, but based on my previous measurements, I expect at least 9 days of normal operation. To help with monitoring, I've added a battery app that shows a charge history graph.

One grid interval is 12 hours (X) and 20% of charge (Y). In this case the slope shows an expected 3 day lifetime - this is with the previous 1.5mA consumption!


Looks like the current consumption fixes really did make a difference and are in line with my 9 day lifetime expectation.


arthur_jordan05 wrote 02/11/2020 at 19:04 point

Drop-in compatibility is definitely a reason for sticking with the stock bootloader and softdevice. Newer versions are self-upgradable though....on the other hand S132 2.0.1 is probably good enough for most purposes.

Had a look at Mynewt too. Maybe I'll try it in some project in the future.

At the moment I'm actually wearing my hardware-hacked watch with a v2.1.1 nrf52840 replacement board running the Adafruit core-based code. It's quite stable and lasts several days. The companion app is a modified nrfUART v2 app that is still a work in progress. To enable the power reset I've wired up one battery terminal via a normally closed reed switch so you can easily unbrick it by swiping the magnetic charging cable along the other side of the enclosure.

  Are you sure? yes | no

arthur_jordan05 wrote 02/10/2020 at 08:27 point

Great! Installed the new version and it looks and feels really nice. Thumbs up for the power consumption improvement...

I just had an idea for a useful hardware hack on the original mainboard: if you cut the UART traces  to the pads (just before the vias) and routed the pads with thin wires to SWD and SWCLK, you could have more control over the firmware, bootloader and softdevice from the outside. Do you think it's worth upgarding to newer softdevices and SDK versions? Writing that because I can only do those OTA updates with the original bootloader via an old phone (Galaxy S5). The S8+ keeps running into some sort of connection issue.

All brainstorming aside, I think your approach of sticking with what we have on the hardware and firmware side is very elegant. Impressive what can be done.

  Are you sure? yes | no

emeryth wrote 02/11/2020 at 12:18 point

I had the same idea with SWD, but in the end decided that it's pointless. Mostly because during development it is possible to lock up the chip so hard it needs a power reset.

My setup is one disassembled watch with SWD attached for development and one intact watch that I wear and program with OTA. By the way, you can just use a generic BLE dongle and your PC to do OTA.

Upgrading to a newer softdevice and SDK would be nice, but my original design decision was to make a drop-in replacement for the firmware so that anyone could upload it and even go back to the original. So far I'm sticking to it.

But if I were to reflash it completely, I'd try Apache Mynewt, which has a complete open source BLE stack so that softdevice can be removed entirely.

  Are you sure? yes | no