From 17a8cfc34638d14167d33c1f2b094813446e5c5b Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Sun, 26 Apr 2020 19:18:17 +0100 Subject: [PATCH] tools: ota-dfu: Include a Linux-native OTA DFU tool --- .gitmodules | 3 +++ README.md | 21 +++++++++++++++------ tools/ota-dfu | 1 + 3 files changed, 19 insertions(+), 6 deletions(-) create mode 160000 tools/ota-dfu diff --git a/.gitmodules b/.gitmodules index cc94518..20c2c34 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@ [submodule "tools/micropython-font-to-py"] path = tools/micropython-font-to-py url = https://github.com/peterhinch/micropython-font-to-py +[submodule "tools/ota-dfu"] + path = tools/ota-dfu + url = https://github.com/daniel-thompson/ota-dfu-python diff --git a/README.md b/README.md index fd46538..b063dab 100644 --- a/README.md +++ b/README.md @@ -51,12 +51,15 @@ Note: *If you have a new PineTime then it will have been delivered with flash protection enabled. You must disable the flash protection before trying to program it.* -* Use an SWD programmer to install `bootloader.hex` to the PineTime. - This file is an Intel HEX file containing both the bootloader and - the Nordic SoftDevice. Be careful to disconnect cleanly from the - debug software since just pulling out the SWD cable will mean the - nRF52 will still believe it is being debugged (and won't properly - enter deep sleep modes). +Use an SWD programmer to install `bootloader.hex` to the PineTime. This +file is an Intel HEX file containing both the bootloader and the Nordic +SoftDevice. Be careful to disconnect cleanly from the debug software +since just pulling out the SWD cable will mean the nRF52 will still +believe it is being debugged (and won't properly enter deep sleep +modes). + +To install using Android device: + * Copy `micropython.zip` to your Android device and download nRF Connect for Android if you do not already have it. * In nRF Connect, choose settings and reduce the DFU packet count from @@ -64,6 +67,12 @@ trying to program it.* * Connect to PineDFU using nRFConnect, click the DFU button and send `micropython.zip` to the device. +To install using Linux and ota-dfu: + +* Look up the MAC address for your watch (try: `sudo hcitool lescan`). +* Use ota-dfu to upload `micropython.zip` to the device. For example: + `tools/ota-dfu/dfu.py -z micropython.zip -a A0:B1:C2:D3:E3:F5 --legacy` + At the end of this process your watch will show the time (03:00) together with a date and battery meter. When the watch goes into power saving mode you can use the side button to wake it again. diff --git a/tools/ota-dfu b/tools/ota-dfu new file mode 160000 index 0000000..9cc61db --- /dev/null +++ b/tools/ota-dfu @@ -0,0 +1 @@ +Subproject commit 9cc61db89ec80ddbdc7a1ecee605cb5d4c391e19