From 331481cd0c6ba804860f7cdbd5110a87ff0160fe Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 24 May 2020 16:36:04 +0200 Subject: Refactor CMake files to allow building 2 binaries : one standalone and one compatible with mcuboot bootloader (the offset in memory is different). Add documentation about mcuboot image generation and OTA. Re-enable watchdog --- bootloader/README.md | 50 +++++++++++++++++++++++++++++++++ bootloader/mynewt_nosemi.elf_4.1.7.bin | Bin 0 -> 22232 bytes bootloader/mynewt_nosemi_4.1.7.elf | Bin 0 -> 542120 bytes 3 files changed, 50 insertions(+) create mode 100644 bootloader/README.md create mode 100644 bootloader/mynewt_nosemi.elf_4.1.7.bin create mode 100644 bootloader/mynewt_nosemi_4.1.7.elf (limited to 'bootloader') 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 */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 /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 --legacy +` + +**TODO** : dfu.py \ No newline at end of file diff --git a/bootloader/mynewt_nosemi.elf_4.1.7.bin b/bootloader/mynewt_nosemi.elf_4.1.7.bin new file mode 100644 index 00000000..bd00ec9c Binary files /dev/null and b/bootloader/mynewt_nosemi.elf_4.1.7.bin differ diff --git a/bootloader/mynewt_nosemi_4.1.7.elf b/bootloader/mynewt_nosemi_4.1.7.elf new file mode 100644 index 00000000..3d7c231f Binary files /dev/null and b/bootloader/mynewt_nosemi_4.1.7.elf differ -- cgit v1.2.3