From 31badd2eb3a46ed75a752f7b30015a1eaa205cc6 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Sun, 17 Oct 2021 08:34:24 +0200 Subject: Add doc about the new motion service. --- doc/MotionService.md | 17 +++++++++++++++++ doc/ble.md | 15 ++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 doc/MotionService.md (limited to 'doc') diff --git a/doc/MotionService.md b/doc/MotionService.md new file mode 100644 index 00000000..0d0a5514 --- /dev/null +++ b/doc/MotionService.md @@ -0,0 +1,17 @@ +# Motion Service +## Introduction +The motion service exposes step count and raw X/Y/Z motion value as READ and NOTIFY characteristics. + +## Service +The service UUID is **00020000-78fc-48fe-8e23-433b3a1942d0** + +## Characteristics +### Step count (UUID 00020001-78fc-48fe-8e23-433b3a1942d0) +The current number of steps represented as a single `uint32_t` (4 bytes) value. + +### Raw motion values (UUID 00020002-78fc-48fe-8e23-433b3a1942d0) +The current raw motion values. This is a 3 `int16_t` array: + + - [0] : X + - [1] : Y + - [2] : Z diff --git a/doc/ble.md b/doc/ble.md index 518b99c8..89ad877f 100644 --- a/doc/ble.md +++ b/doc/ble.md @@ -29,14 +29,15 @@ When the service does not exist in the BLE specification, InfiniTime implement c The following custom services are implemented in InfiniTime: - Since InfiniTime 0.8: - ``` - * Music Service : 00000000-78fc-48fe-8e23-433b3a1942d0 - ``` - + * Music Service : 00000000-78fc-48fe-8e23-433b3a1942d0 + + - Since InfiniTime 0.11: - ``` - * Navigation Service : 00010000-78fc-48fe-8e23-433b3a1942d0 - ``` + * [Navigation Service](NavigationService.md) : 00010000-78fc-48fe-8e23-433b3a1942d0 + + + - Since InfiniTime 1.7: + * [Motion Service](MotionService.md) : 00020000-78fc-48fe-8e23-433b3a1942d0 ## BLE services [List of standard BLE services](https://www.bluetooth.com/specifications/gatt/services/) -- cgit v1.2.3-70-g09d2 From b3a82288997556b04a64d452ec2067747f1fb706 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Wed, 20 Oct 2021 20:52:04 +0200 Subject: Add mention to Call characteristic (which was missing in the doc) and change the UUID of the new Motion service from 00020000-* to 00030000-*. --- doc/ble.md | 6 +++++- src/components/ble/MotionService.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/ble.md b/doc/ble.md index 89ad877f..8125e985 100644 --- a/doc/ble.md +++ b/doc/ble.md @@ -34,10 +34,14 @@ The following custom services are implemented in InfiniTime: - Since InfiniTime 0.11: * [Navigation Service](NavigationService.md) : 00010000-78fc-48fe-8e23-433b3a1942d0 + + + - Since InfiniTime 0.13 + * Call characteristic (extension to the Alert Notification Service): 00020001-78fc-48fe-8e23-433b3a1942d0 - Since InfiniTime 1.7: - * [Motion Service](MotionService.md) : 00020000-78fc-48fe-8e23-433b3a1942d0 + * [Motion Service](MotionService.md) : 00030000-78fc-48fe-8e23-433b3a1942d0 ## BLE services [List of standard BLE services](https://www.bluetooth.com/specifications/gatt/services/) diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp index 2bb5289c..e305021a 100644 --- a/src/components/ble/MotionService.cpp +++ b/src/components/ble/MotionService.cpp @@ -9,7 +9,7 @@ namespace { constexpr ble_uuid128_t CharUuid(uint8_t x, uint8_t y) { return ble_uuid128_t{ .u = {.type = BLE_UUID_TYPE_128}, - .value = { 0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, x, y, 0x02, 0x00 } + .value = { 0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, x, y, 0x03, 0x00 } }; } -- cgit v1.2.3-70-g09d2 From 0fc081fe03eddae41c8824cb3a55c054b653bb15 Mon Sep 17 00:00:00 2001 From: Steveis Date: Tue, 26 Oct 2021 16:57:20 +0100 Subject: Correctly define DFU --- doc/gettingStarted/gettingStarted-1.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/gettingStarted/gettingStarted-1.0.md b/doc/gettingStarted/gettingStarted-1.0.md index 3f8f38f6..409b7c7b 100644 --- a/doc/gettingStarted/gettingStarted-1.0.md +++ b/doc/gettingStarted/gettingStarted-1.0.md @@ -12,7 +12,7 @@ Basically, a **firmware** is just a software running on the embedded hardware of - **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying **updates** of the *application firmware*, reverting them in case of issues and load the recovery firmware when requested. - **The recovery firmware** is a specific *application firmware* than can be loaded by the bootloader on user request. This firmware can be useful in case of serious issue, when the main application firmware cannot perform an OTA update correctly. Currently, this recovery firmware is based on [InfiniTime 0.14.1](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1). -**OTA** and **DFU** refer to the update of the firmware over BLE (**B**luetooth **L**ow **E**nergy). **OTA** means **O**ver **T**he **A**ir, this is a functionality that allows the user to update the firmware how their device using a wireless communication like BLE. When we talk about **DFU** (**D**igital **F**irmware **U**pdate), we refer to the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF). +**OTA** and **DFU** refer to the update of the firmware over BLE (**B**luetooth **L**ow **E**nergy). **OTA** means **O**ver **T**he **A**ir, this is a functionality that allows the user to update the firmware how their device using a wireless communication like BLE. When we talk about **DFU** (**D**evice **F**irmware **U**pdate), we refer to the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF). ## How to check the version of InfiniTime and the bootloader? -- cgit v1.2.3-70-g09d2 From e051504deaf4db166c08ec9693c575006ee12c8e Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Thu, 28 Oct 2021 20:56:17 +0200 Subject: Add doc : how to generate files needed by the factory. --- doc/buildAndProgram.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'doc') diff --git a/doc/buildAndProgram.md b/doc/buildAndProgram.md index 3e000a3a..3686871a 100644 --- a/doc/buildAndProgram.md +++ b/doc/buildAndProgram.md @@ -231,3 +231,33 @@ Loading section .sec7, size 0xdf08 lma 0x40000 Start address 0x0, load size 314200 Transfer rate: 45 KB/sec, 969 bytes/write. ``` + +### How to generate files needed by the factory +These files are needed by the Pine64 factory to flash InfiniTime as the default firmware on the PineTimes. + +Two files are needed: an **HEX (.hex)** file that contains the content of the internal flash memory (bootloader + InfiniTime) and a **binary (.bin)** file that contains the content of the external flash memory (recovery firmware). + +#### merged-internal.hex +First, convert the bootloader to hex: + ``` + /bin/arm-none-eabi-objcopy -I binary -O ihex ./bootloader.bin ./bootloader.hex + ``` +where `bootloader.bin` is the [last stable version](https://github.com/JF002/pinetime-mcuboot-bootloader/releases) of the [bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader). + +Then, convert the MCUBoot image of InfiniTime: +``` +/bin/arm-none-eabi-objcopy -I binary -O ihex --change-addresses 0x8000 ./pinetime-mcuboot-app-image-1.6.0.bin ./pinetime-mcuboot-app-image-1.6.0.hex +``` +where `pinetime-mcuboot-app-image-1.6.0.bin` is [the bin of the last MCUBoot image](https://github.com/InfiniTimeOrg/InfiniTime/releases) of [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime). + +Pay attention to the parameter `--change-addresses 0x8000`. It's needed to ensure the image will be flashed at the offset expected by the bootloader (0x8000). + +Finally, merge them together with **mergehex**: +``` +/opt/mergehex/mergehex -m ./bootloader.hex ./pinetime-mcuboot-app-image-1.6.0.hex -o merged-internal.hex +``` + +This file must be flashed at offset **0x00** of the internal memory of the NRF52832. + +#### spinor.bin +This file is the MCUBoot image of the last stable version of the recovery firmware. It must be flashed at offset **0x00** of the external SPINOR flash memory. \ No newline at end of file -- cgit v1.2.3-70-g09d2