summaryrefslogtreecommitdiff
path: root/bootloader/README.md
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-05-24 16:58:29 +0200
committerGitea <gitea@fake.local>2020-05-24 16:58:29 +0200
commit82b4ddc25b4c7913e0e6a13a209a4415dff044f1 (patch)
tree8eeafef1f4150a1cf238ee80e53c8901b0ec67af /bootloader/README.md
parentbe1ad9b07083e656a649d223750ff4b14b781b7b (diff)
parent073717980f5c00f553ac3b58a50b792b32a14c7a (diff)
Merge branch 'nimble-ota' of JF/PineTime into develop
Diffstat (limited to 'bootloader/README.md')
-rw-r--r--bootloader/README.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/bootloader/README.md b/bootloader/README.md
new file mode 100644
index 00000000..facc0500
--- /dev/null
+++ b/bootloader/README.md
@@ -0,0 +1,50 @@
+# Bootloader
+
+## Bootloader binary
+The binary comes from https://github.com/lupyuen/pinetime-rust-mynewt/releases/tag/v4.1.7
+
+It must be flash at address **0x00** in the internal flash memory.
+
+Using OpenOCD:
+
+`
+program mynewt_nosemi.elf_4.1.7.bin 0
+`
+
+## Application firmware image
+Build the binary compatible with the booloader:
+
+`
+make pinetime-mcuboot-app
+`
+
+The binary is located in *<build directory>/src/pinetime-mcuboot-app.bin*.
+
+It must me converted into a MCUBoot image using *imgtool.py* from [MCUBoot](https://github.com/JuulLabs-OSS/mcuboot/tree/master/scripts).
+
+`
+imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header <build directory>/src/pinetime-mcuboot-app.bin image.bin
+`
+
+The image must be then flashed at address **0x8000** in the internal flash memory.
+
+Using OpenOCD:
+
+`
+program image.bin 0x8000
+`
+
+## OTA and DFU
+Pack the image into a .zip file for the NRF DFU protocol:
+
+`
+adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application image.bin dfu.zip
+`
+
+Use NRFConnect or dfu.py to upload the zip file to the device:
+
+`
+sudo dfu.py -z /home/jf/nrf52/bootloader/dfu.zip -a <pinetime MAC address> --legacy
+`
+
+**TODO** : dfu.py \ No newline at end of file