Firmware: Flashing from a computer

Joshua Wise edited this page Dec 10, 2016 · 2 revisions

If you'd like to flash your Pebble's firmware from your computer, there is a way to do this. I'll demonstrate with my Mac, but a similar concept should work for other systems that can do Bluetooth serial emulation. Follow the following steps:

  • Get the latest Pebble SDK. I'll assume you already have that, and you have done so such that pebble is in your path.
  • Boot your watch into PRF. If you're flashing your firmware, it's probably for development, so you don't mind that your device will lose its mind; start by giving your device a "vulcan nerve pinch" (on Bianca, hold down all the buttons until the watch shows a "oh god, please help, connect to phone" display). Once you're at the "SOS screen", you're ready to flash. It's good to know how to do this if you screw up the firmware, too.
  • Grab a firmware. Find a pbz file for your watch; there are a multitude of sources. Or, if you're daring, you'll use a firmware that you cooked up yourself.
  • Pair your watch to your computer. On OS X, I launch Bluetooth settings, then hit 'pair', and do the dance.
  • Attach the pebble tool to your watch and open a REPL. Run something like pebble repl --serial /dev/cu.PebbleA1F2-SerialPortSe. If you get the error Could not connect to Pebble., then you might need to kick it; something like sudo cu -l cu.PebbleA1F2-SerialPortSe, and mashing enter a few times, and then typing <enter>~. to bail out of cu (^C won't work!). From there, you can try the pebble repl command again.
  • Upload a firmware. Put install_firmware.py (available, mirror) in the directory that you're doing your firmware work from, and import it, something like: import sys; sys.path.append('.'); import install_firmware as fw; and then finally, flash your firmware: fw._install_firmware(pebble, "Pebble-3.12.3-v2_0.pbz")

Hooray! 15 minutes later or so, it should finish, and your Pebble should reboot. You can run pebble repl with -vvv to get it to tell you more as it goes.

Caveats

HEADS UP: On Pebble and Pebble Steel (tintin and bianca), the "vulcan nerve pinch" is implemented in firmware. That means that if you flash something bad to your device, you will have to wait for the battery to drain (could be quite a while!) before you can bring the device back to life. Andrew Witte reports that the Time series of devices are safer for this kind of experimentation.