Flashing Custom Firmware Onto the Xiaomi Mi Band 8

Because of its Ambiq Apollo4 Blue Lite microcontroller and exposed test pins, Aaron Christophel was able to load his own display code.

The Xiaomi Mi Band 8

Like other smartwatch/health tracking bands on the market, the Xiaomi Mi Band 8 is packed with sensors, communication capabilities, and an efficient battery management system- all in a compact wearable. The band runs on an Arm Cortex-M4 microcontroller within an Apollo4 Blue Lite SoC from Ambiq, and due to this fact, Aaron Christohpel (atc1441 on GitHub) realized that he could hack it to run custom firmware thanks to the Ambiq SDK.

Accessing the MCU

There are a couple of ways to load programs and data onto an Arm microprocessor, but the primary method for debugging involves the SWD, or serial wire debug, header. Via just two or three pins, new executables and can be sent and subsequently monitored with a debugger. Conveniently, the Reset, SWD Clock, and SWD IO were all exposed on the underside of the PCB as test pads, thus allowing Christohpel to solder jumpers and attach them to a programmer. Two UART pin were also available to act as serial debugging output.

Building a display driver

One of the biggest draws of the watch is its large 1.62" AMOLED touchscreen with a resolution of 192 x 490 pixels, making it a great choice for embedded projects that require human input. However, determining how the display driver was connected to the microcontroller and even what model the driver is in the first place required some reverse engineering before programs could be written.

After examining the display, Christohpel discovered it was driven by an RM69330, which is common for round LCDs, along with the pins being used by the microcontroller's SPI bus. Armed with this knowledge, he built a driver that could write pixel data to the screen's internal buffer and then show it. The final test of this proof of concept involved exporting several frames from Rick Astley's infamous "Never Gonna Give You Up" video and looping through them to create a simple animation.

Other peripherals

Although the screen is the main attraction, the Mi Band 8 is ultimately a fitness tracker, and therefore contains sensors for movement/orientation, heart rate measurement, and ambient light sensing as well as a Bluetooth Low-Energy module. Currently, Christohpel has gotten the display, touchscreen, and light sensor working in his latest project release and soon plans on completing accelerometer support.

Going further

Due to its low cost and impressive array of sensors and screen, the Mi Band 8 appears to be a promising device for future hacking and adapting into other projects. To follow more of Christohpel's progress as he continues to unlock its functionality, you can visit his GitHub repository here.

Evan Rust
IoT, web, and embedded systems enthusiast. Contact me for product reviews or custom project requests.
Latest articles
Sponsored articles
Related articles
Get our weekly newsletter when you join Hackster.
Latest articles
Read more
Related articles