Compare commits
461 Commits
documentat
...
rei/develo
Author | SHA1 | Date | |
---|---|---|---|
e54d78a04b | |||
8f32478141 | |||
b002fddc29 | |||
ea62510eb6 | |||
a4598ed63e | |||
72a020127f | |||
|
373289c072 | ||
|
350bca3965 | ||
|
94cd2ba563 | ||
|
ecb3cd3e31 | ||
|
d55ec42b17 | ||
|
a1385cb481 | ||
|
de62620de1 | ||
|
7e169ee4aa | ||
|
955dda60c5 | ||
|
6cfb45e280 | ||
|
c6026aa617 | ||
|
254c85246e | ||
|
4a40d29279 | ||
|
41c461d1f6 | ||
|
17cedd6629 | ||
|
1d34e83c97 | ||
|
9e18c23aac | ||
|
12d4bc4139 | ||
|
17079fb114 | ||
|
c2b15b1446 | ||
|
7bc692eea4 | ||
|
36740498db | ||
|
5f28f89df2 | ||
|
35dcf8c860 | ||
|
f95147cf0e | ||
|
91a3e98276 | ||
|
8a71f2b9e0 | ||
|
8999158528 | ||
|
977936e8e2 | ||
|
03a2059e87 | ||
|
702f65d3ee | ||
|
20ac1cd374 | ||
|
03a510bd18 | ||
|
7f45538eb5 | ||
|
718fbdab98 | ||
|
0ce4183640 | ||
|
87a69fe52d | ||
|
0fabba1c9a | ||
|
a2218dd4ad | ||
|
619477cbd1 | ||
|
cc2d5c39ce | ||
|
dd313eb419 | ||
|
9b216bb16f | ||
|
1ffca52715 | ||
|
c77f923a33 | ||
|
83b3a2a469 | ||
|
123c801f17 | ||
|
831f93cd92 | ||
|
34506be06e | ||
|
6171c9d45d | ||
|
a6fcdec0f8 | ||
|
443408312a | ||
|
324927f2b7 | ||
|
db0f909b46 | ||
|
8485cdb54d | ||
|
4cb07bac53 | ||
|
c9f23c11b3 | ||
|
f56788465d | ||
|
78267eec40 | ||
|
a2057ebc6f | ||
|
b6b322efdd | ||
|
f7e8caa04a | ||
|
4fba1ac5ce | ||
|
27e598f3fa | ||
|
8b2e1c69f2 | ||
|
95a970a75d | ||
|
2ccf88c03c | ||
|
331de8ce8e | ||
|
4e2b0b1f10 | ||
|
d967ed7d90 | ||
|
ef17f2f981 | ||
|
e39f183efe | ||
|
b9fbee1007 | ||
|
43443eda74 | ||
|
1c0d9ef383 | ||
|
c006f05c99 | ||
|
9d3671561f | ||
|
a75912dd97 | ||
|
1d4fd9c27f | ||
|
77645b20b2 | ||
|
451d755e3d | ||
|
9535c1e651 | ||
|
ac0dc5ff47 | ||
|
875b9c4bc5 | ||
|
3005fe8710 | ||
|
4116baf72e | ||
|
09b852d8f0 | ||
|
c94e0d53bb | ||
|
015f17cd25 | ||
|
dedb397ae0 | ||
|
ae2b9d30d6 | ||
|
beddfc346d | ||
|
2b9418c7f8 | ||
|
8160748733 | ||
|
6dac0a62f4 | ||
|
4229386501 | ||
|
09a50dcc15 | ||
|
8b470d33a1 | ||
|
8061822f0c | ||
|
b31fbb4adb | ||
|
54df828665 | ||
|
b7b1af1c4c | ||
|
2e42b90009 | ||
|
b6807ee3ca | ||
|
36cb7c82f3 | ||
|
34858d0a6c | ||
|
f82aa71eb0 | ||
|
aa32159c00 | ||
|
5e83a862db | ||
|
28ccf15e13 | ||
|
3bf6b1cb16 | ||
|
d7441d18be | ||
|
129dd97b51 | ||
|
5a13c5215c | ||
|
f84a0a3897 | ||
|
ed91b5a998 | ||
|
68a7016080 | ||
|
ff73f67d6f | ||
|
943a48f189 | ||
|
82a4f9aa68 | ||
|
2607c3d799 | ||
|
b498e1d633 | ||
|
78365548f7 | ||
|
78cab3604d | ||
|
8f436e1d74 | ||
|
4761fcb63a | ||
|
a8b7fbe48b | ||
|
cd1f218dd8 | ||
|
f1194a5f74 | ||
|
88197b6632 | ||
|
f973f1c12c | ||
|
df61907073 | ||
|
1c4a56b05b | ||
|
5f2ce53877 | ||
|
fc374562dd | ||
|
76b7436dfb | ||
|
1379b7902f | ||
|
bebc072e78 | ||
|
db41d9081a | ||
|
51716898aa | ||
|
0933d60b16 | ||
|
ea14c580ca | ||
|
21da5869c5 | ||
|
dbfcb455fe | ||
|
f47b04ffd0 | ||
|
7e0b053b38 | ||
|
61a9a97e26 | ||
|
04d21dcd93 | ||
|
13c66dd54b | ||
|
204ad7ca2a | ||
|
4c92ed410f | ||
|
187d99c0f7 | ||
|
5fe5cee9ef | ||
|
8844ea60b1 | ||
|
452dd12eff | ||
|
5d974434ef | ||
|
30797b37bc | ||
|
5613449bfb | ||
|
dd47ba9782 | ||
|
dd28359571 | ||
|
43399b3832 | ||
|
1eaf258a63 | ||
|
f1c91e1ce0 | ||
|
1bfee61ef9 | ||
|
a29e30c187 | ||
|
29f0bce46b | ||
|
51640c7248 | ||
|
8dae4c8299 | ||
|
2803dd667f | ||
|
0e2b27d792 | ||
|
ef44b763d9 | ||
|
40cdb54772 | ||
|
69e4ab6be1 | ||
|
407908686a | ||
|
f829427c41 | ||
|
b857fdb9f4 | ||
|
4aaa3a3b49 | ||
|
a2a70f8eda | ||
|
04eca81a95 | ||
|
d5b78ecd66 | ||
|
a1db9fca13 | ||
|
4f649a8544 | ||
|
e332be0d7c | ||
|
87d882b151 | ||
|
d967efa197 | ||
|
5938b4b208 | ||
|
32fe7b660c | ||
|
76f63ed76a | ||
|
0930a79041 | ||
|
a9b77ae0d4 | ||
|
1ac1d5aa5a | ||
|
2daa5dcbee | ||
|
ae0724c28c | ||
|
02e94acf18 | ||
|
d86f81b9ad | ||
|
c8d998e82c | ||
|
5be2f57a78 | ||
|
1813399959 | ||
|
2bc338ceed | ||
|
698288d822 | ||
|
e73a92c29b | ||
|
f38c559089 | ||
|
b12603448c | ||
|
71c895dc71 | ||
|
9e9010c725 | ||
|
458f5b8eb8 | ||
|
bbb823b170 | ||
|
a1880ca3b8 | ||
|
a354650a9c | ||
|
cc01d6ca17 | ||
|
67f546fa33 | ||
|
b4e956227e | ||
|
314c02194a | ||
|
470db4ab99 | ||
|
6bf6bb7e2a | ||
|
688dc2fed7 | ||
|
bbc5af078d | ||
|
48e9458301 | ||
|
26ae828e39 | ||
|
f711f0f794 | ||
|
97cbe34963 | ||
|
e8fc46ba20 | ||
|
b1b9937ff7 | ||
|
dc8be2244c | ||
|
bef3e708f6 | ||
|
b8b54f47a2 | ||
|
15c3807a76 | ||
|
e82469bffa | ||
|
f86c71b2bb | ||
|
92b1e83e3e | ||
|
98ac447bdb | ||
|
b9c40100f6 | ||
|
8f38bd911b | ||
|
5c13200238 | ||
|
d6b22645e3 | ||
|
f780ac999a | ||
|
d2510d7926 | ||
|
6d74820698 | ||
|
3ebf002f9d | ||
|
ad42cdf120 | ||
|
d270275bd2 | ||
|
7a0f72ed8b | ||
|
cc259b6a4a | ||
|
94561b2331 | ||
|
5e6868d9eb | ||
|
e0013e7304 | ||
|
a65f173e3c | ||
|
7eff1dbcc6 | ||
|
f7d1b3f368 | ||
|
fb87fdb2d9 | ||
|
d034bd131e | ||
|
baa5954724 | ||
|
51d2888b52 | ||
|
54f588ce63 | ||
|
86d180a855 | ||
|
395590d2d8 | ||
|
5b7915b5c9 | ||
|
fb1946b06e | ||
|
ab059b9004 | ||
|
97668c775b | ||
|
90352af626 | ||
|
c8214bc666 | ||
|
f66fcdd3ca | ||
|
1832a6c231 | ||
|
204fc56672 | ||
|
f52d6bfa67 | ||
|
86ee7a70b7 | ||
|
319030d9e1 | ||
|
3b0b48020d | ||
|
eca0588c23 | ||
|
8ab959b4dc | ||
|
464b689a03 | ||
|
4cc95091ab | ||
|
6a5946c4e3 | ||
|
645a071b70 | ||
|
bccd77d5c9 | ||
|
1470489e7b | ||
|
0a0d1f2703 | ||
|
b9a2db1a49 | ||
|
d1e9aa1076 | ||
|
fdb5e27aea | ||
|
b62c62ee1f | ||
|
09b9130244 | ||
|
362a5ef113 | ||
|
8f46908d38 | ||
|
f4322841ff | ||
|
2e10b0fe64 | ||
|
c1aa5a5ea7 | ||
|
8fb99471c3 | ||
|
faa05eb57b | ||
|
6393a17d74 | ||
|
f841b8c984 | ||
|
a5a64800ed | ||
|
d89e38d3bf | ||
|
8f6a390c36 | ||
|
1b4b422ab6 | ||
|
3a8e66a52f | ||
|
eabbbfa373 | ||
|
2690c274af | ||
|
1dd7174480 | ||
|
91c644b43c | ||
|
f57f797ff5 | ||
|
6cf4a933b6 | ||
|
42a5cdb5b7 | ||
|
6354511c20 | ||
|
32ea01b2e9 | ||
|
ec9b5a0bd2 | ||
|
736ae08fcd | ||
|
494448b7cc | ||
|
9ffd28f735 | ||
|
589733d11e | ||
|
e104f17b1b | ||
|
23f318c3d0 | ||
|
9db5d64441 | ||
|
6a442b90a1 | ||
|
645f6f43dc | ||
|
f4daf63679 | ||
|
8539db0884 | ||
|
d29a9818af | ||
|
e8c1302cd6 | ||
|
b946b8d156 | ||
|
cd593c3862 | ||
|
f1fc7ee659 | ||
|
048ecd41e4 | ||
|
150fa3b661 | ||
|
1e4130a9cf | ||
|
62dbcbfc95 | ||
|
ae4b9e0f2e | ||
|
c00ad4af35 | ||
|
5f50f0e538 | ||
|
3eebe66d65 | ||
|
f1f2bc119a | ||
|
6879147648 | ||
|
7b04ce5eba | ||
|
0df49bd43d | ||
|
62bb6b5163 | ||
|
58d454b11f | ||
|
4a8f72bd1e | ||
|
be7931c4fb | ||
|
154e3d27ad | ||
|
797b60397c | ||
|
e0133cec36 | ||
|
ffd6c3f095 | ||
|
b72c6a5bc9 | ||
|
9525fc4273 | ||
|
b998d5e2a8 | ||
|
abbfb92fa2 | ||
|
75cf5324ba | ||
|
cccec6e1ab | ||
|
9108952e6b | ||
|
06b022fc4d | ||
|
c870f8ed30 | ||
|
48beb7c3b1 | ||
|
df04763ab4 | ||
|
900598a7ee | ||
|
657dc3a9ba | ||
|
ffb17357e7 | ||
|
ed6f0aade4 | ||
|
0ed256ba15 | ||
|
19c9667a3d | ||
|
2736fa57bb | ||
|
3a09b3614c | ||
|
b6e9e4171d | ||
|
4b2dcbb4f0 | ||
|
4349657f79 | ||
|
6e16584816 | ||
|
eb27813c18 | ||
|
1d3f0dfa9e | ||
|
bda96dc595 | ||
|
6ba2878605 | ||
|
85a25302bf | ||
|
b8dfad40bb | ||
|
054a99cf6c | ||
|
ada96ccdc8 | ||
|
1404d0186c | ||
|
a17d8bd566 | ||
|
88b017d9b1 | ||
|
fe6e4bea8c | ||
|
0705b74656 | ||
|
e8db73e0e7 | ||
|
4b7f2546bd | ||
|
ec437b1c66 | ||
|
9f0612bce8 | ||
|
871a673a46 | ||
|
34511a66ee | ||
|
2ffbf8b7b3 | ||
|
583c7ee22f | ||
|
4257073a02 | ||
|
67e077348c | ||
|
298f0f4335 | ||
|
d5e8e3ca44 | ||
|
45a90e4967 | ||
|
caec4a560b | ||
|
a326e22986 | ||
|
3375c4e187 | ||
|
c12fc5e313 | ||
|
d1583035d9 | ||
|
5eaae4175c | ||
|
e53f1bfd66 | ||
|
88e55b2504 | ||
|
a0c7b48b8e | ||
|
2314c41ad6 | ||
|
52d1906589 | ||
|
1d3098baa7 | ||
|
c3c5ab3473 | ||
|
cf9332f0e5 | ||
|
4aaf3d06bc | ||
|
dc25e7a887 | ||
|
894e3cebc0 | ||
|
e8eee76b48 | ||
|
279e63c97a | ||
|
47f73269bb | ||
|
7322f3286b | ||
|
1b2a8a5a04 | ||
|
bea5c60a11 | ||
|
29bb359e90 | ||
|
50406adc34 | ||
|
3a41bff9ea | ||
|
241d36471d | ||
|
1b937a77b9 | ||
|
f2918709d9 | ||
|
ac7b2da611 | ||
|
c4f2fb2fa4 | ||
|
a631fa3518 | ||
|
5a0cf8e348 | ||
|
2fa63c7f37 | ||
|
71a64974c0 | ||
|
2e7b51c8e1 | ||
|
39157f2f19 | ||
|
947ece0bc9 | ||
|
bdf7e5293f | ||
|
18e3cc7038 | ||
|
c5282f9454 | ||
|
822b6ae6a0 | ||
|
37de10f47d | ||
|
5932391c8b | ||
|
75f0bbb7ca | ||
|
2d98530976 | ||
|
5e1f4839da | ||
|
f9613d28c0 | ||
|
85d494a987 | ||
|
da97a94a0f | ||
|
411c10ec31 | ||
|
3ed01b33e7 | ||
|
32978b6a06 | ||
|
37eed43b68 | ||
|
074d3420c8 | ||
|
f45e094adf | ||
|
994f373a14 | ||
|
1c3372b319 | ||
|
ff1fce18d6 | ||
|
c4ab17f587 | ||
|
1c86796eac | ||
|
7d1da9f1f9 | ||
|
3320eae95c |
@ -8,9 +8,9 @@ AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
@ -83,6 +83,8 @@ IndentGotoLabels: true
|
||||
IndentPPDirectives: BeforeHash
|
||||
IndentWidth: 2
|
||||
IndentWrappedFunctionNames: false
|
||||
# Requires Clang >= 15, could also cause incorrect code formatting:
|
||||
# InsertBraces: true
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
|
@ -1,6 +1,7 @@
|
||||
Checks: '*,
|
||||
-altera-unroll-loops,
|
||||
-llvmlibc-callee-namespace,
|
||||
-llvmlibc-implementation-in-namespace,
|
||||
-llvmlibc-restrict-system-libc-headers,
|
||||
-llvm-header-guard,
|
||||
-llvm-namespace-comment,
|
||||
@ -8,6 +9,7 @@ Checks: '*,
|
||||
-google-runtime-int,
|
||||
-google-readability-namespace-comments,
|
||||
-fuchsia-statically-constructed-objects,
|
||||
-cppcoreguidelines-prefer-member-initializer,
|
||||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||
-cppcoreguidelines-pro-bounds-constant-array-index,
|
||||
-cppcoreguidelines-pro-type-static-cast-downcast,
|
||||
|
@ -12,7 +12,9 @@
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"editor.formatOnSave": true,
|
||||
"clang-format.executable": "clang-format-12"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
@ -33,4 +35,4 @@
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
// "remoteUser": "vscode"
|
||||
"remoteUser": "infinitime"
|
||||
}
|
||||
}
|
||||
|
1
.github/ISSUE_TEMPLATE/bug-report.yaml
vendored
@ -9,6 +9,7 @@ body:
|
||||
*Please, before opening a bug report, check if similar issues already exist. In that case, use those issues to provide your feedback instead.*
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Verification
|
||||
options:
|
||||
- label: I searched for similar bug reports and found none was relevant.
|
||||
required: true
|
||||
|
8
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: PineTime community chat (Matrix)
|
||||
url: https://app.element.io/#/room/#pinetime:matrix.org
|
||||
about: Please ask questions about PineTime here.
|
||||
- name: PineTime developers chat (Matrix)
|
||||
url: https://app.element.io/#/room/#pinetime-dev:matrix.org
|
||||
about: Please ask questions about PineTime development here.
|
1
.github/ISSUE_TEMPLATE/feature-request.yaml
vendored
@ -9,6 +9,7 @@ body:
|
||||
*Please, before opening a feature request, check if similar issues already exist. In that case, use those issues to provide your feedback instead.*
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Verification
|
||||
options:
|
||||
- label: I searched for similar feature request and found none was relevant.
|
||||
required: true
|
||||
|
37
.github/workflows/format.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: Code formatting
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, develop ]
|
||||
paths:
|
||||
- '**.cpp'
|
||||
- '**.h'
|
||||
- '!src/libs/**'
|
||||
- '!src/FreeRTOS/**'
|
||||
|
||||
jobs:
|
||||
test-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1000
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF" --depth=1000
|
||||
|
||||
- name: Install clang-format
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install clang-format-12
|
||||
|
||||
- name: Check formatting
|
||||
run: tests/test-format.sh
|
||||
|
||||
- name: Upload patches
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: Patches
|
||||
path: ./*.patch
|
66
.github/workflows/lv_sim.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
# GitHub Actions Workflow to build Simulator for PineTime Smart Watch LVGL Interface
|
||||
|
||||
name: Build PineTime LVGL Simulator
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, develop ]
|
||||
pull_request:
|
||||
branches: [ master, develop ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
#########################################################################################
|
||||
# Download and Install Dependencies
|
||||
|
||||
- name: Install cmake
|
||||
uses: lukka/get-cmake@v3.18.3
|
||||
|
||||
- name: Install SDL2 development package
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install libsdl2-dev
|
||||
|
||||
- name: Install lv_font_conv
|
||||
run:
|
||||
npm i -g lv_font_conv@1.5.2
|
||||
|
||||
#########################################################################################
|
||||
# Checkout
|
||||
|
||||
- name: Checkout source files
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
#########################################################################################
|
||||
# get InfiniSim repo
|
||||
|
||||
- name: Get InfiniSim repo
|
||||
run: |
|
||||
git clone https://github.com/InfiniTimeOrg/InfiniSim.git --depth 1 --branch main
|
||||
git -C InfiniSim submodule update --init lv_drivers libpng
|
||||
|
||||
#########################################################################################
|
||||
# CMake
|
||||
|
||||
- name: CMake
|
||||
run: |
|
||||
cmake -G Ninja -S InfiniSim -B build_lv_sim -DInfiniTime_DIR="${PWD}"
|
||||
|
||||
#########################################################################################
|
||||
# Build and Upload simulator
|
||||
|
||||
- name: Build simulator executable
|
||||
run: |
|
||||
cmake --build build_lv_sim
|
||||
|
||||
- name: Upload simulator executable
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: infinisim-${{ github.head_ref }}
|
||||
path: build_lv_sim/infinisim
|
172
.github/workflows/main.yml
vendored
@ -3,171 +3,45 @@
|
||||
# Based on https://github.com/JF002/InfiniTime/blob/master/doc/buildAndProgram.md
|
||||
# and https://github.com/JF002/InfiniTime/blob/master/bootloader/README.md
|
||||
|
||||
# Name of this Workflow
|
||||
name: Build PineTime Firmware
|
||||
|
||||
# When to run this Workflow...
|
||||
on:
|
||||
|
||||
# Run this Workflow when files are updated (Pushed) in the "master" and "develop" Branch
|
||||
push:
|
||||
branches: [ master, develop ]
|
||||
|
||||
# Also run this Workflow when a Pull Request is created or updated in the "master" and "develop" Branch
|
||||
pull_request:
|
||||
branches: [ master, develop ]
|
||||
|
||||
# Steps to run for the Workflow
|
||||
jobs:
|
||||
build:
|
||||
|
||||
# Run these steps on Ubuntu
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: infinitime/infinitime-build
|
||||
steps:
|
||||
|
||||
#########################################################################################
|
||||
# Download and Cache Dependencies
|
||||
|
||||
- name: Install cmake
|
||||
uses: lukka/get-cmake@v3.18.3
|
||||
|
||||
- name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc
|
||||
id: cache-toolchain
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-toolchain-9-2020-q2
|
||||
with:
|
||||
path: ${{ runner.temp }}/arm-none-eabi
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}
|
||||
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
|
||||
|
||||
- name: Install Embedded Arm Toolchain arm-none-eabi-gcc
|
||||
if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache
|
||||
uses: fiam/arm-none-eabi-gcc@v1.0.4
|
||||
with:
|
||||
# GNU Embedded Toolchain for Arm release name, in the V-YYYY-qZ format (e.g. "9-2019-q4")
|
||||
release: 9-2020-q2
|
||||
# Directory to unpack GCC to. Defaults to a temporary directory.
|
||||
directory: ${{ runner.temp }}/arm-none-eabi
|
||||
|
||||
- name: Check cache for nRF5 SDK
|
||||
id: cache-nrf5sdk
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-nrf5sdk
|
||||
with:
|
||||
path: ${{ runner.temp }}/nrf5_sdk
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}
|
||||
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
|
||||
|
||||
- name: Install nRF5 SDK
|
||||
if: steps.cache-nrf5sdk.outputs.cache-hit != 'true' # Install SDK if not found in cache
|
||||
run: |
|
||||
cd ${{ runner.temp }}
|
||||
curl https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip -o nrf5_sdk.zip
|
||||
unzip nrf5_sdk.zip
|
||||
mv nRF5_SDK_15.3.0_59ac345 nrf5_sdk
|
||||
|
||||
- name: Check cache for MCUBoot
|
||||
id: cache-mcuboot
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-mcuboot
|
||||
with:
|
||||
path: ${{ runner.temp }}/mcuboot
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}
|
||||
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
|
||||
|
||||
- name: Install MCUBoot
|
||||
if: steps.cache-mcuboot.outputs.cache-hit != 'true' # Install MCUBoot if not found in cache
|
||||
run: |
|
||||
cd ${{ runner.temp }}
|
||||
git clone --branch v1.7.2 https://github.com/mcu-tools/mcuboot
|
||||
|
||||
- name: Install imgtool dependencies
|
||||
run: |
|
||||
pip3 install --user -r ${{ runner.temp }}/mcuboot/scripts/requirements.txt
|
||||
|
||||
- name: Install adafruit-nrfutil
|
||||
run: |
|
||||
pip3 install --user wheel
|
||||
pip3 install --user setuptools
|
||||
pip3 install --user adafruit-nrfutil
|
||||
|
||||
#########################################################################################
|
||||
# Checkout
|
||||
|
||||
# This workaround fixes the error "unsafe repository (REPO is owned by someone else)".
|
||||
# See https://github.com/actions/checkout/issues/760 and https://github.com/actions/checkout/issues/766
|
||||
# The fix in "actions/checkout@v2" was not sufficient as the build process also uses git (to get the current
|
||||
# commit hash, for example).
|
||||
- name: Workaround permission issues
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout source files
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Show files
|
||||
run: set ; pwd ; ls -l
|
||||
|
||||
#########################################################################################
|
||||
# CMake
|
||||
|
||||
- name: CMake
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=${{ runner.temp }}/arm-none-eabi -DNRF5_SDK_PATH=${{ runner.temp }}/nrf5_sdk -DUSE_OPENOCD=1 -DBUILD_DFU=1 ../
|
||||
|
||||
#########################################################################################
|
||||
# Make and Upload DFU Package
|
||||
# pinetime-mcuboot-app.img must be flashed at address 0x8000 in the internal flash memory with OpenOCD:
|
||||
# program image.bin 0x8000
|
||||
|
||||
# For Debugging Builds: Remove "make" option "-j" for clearer output. Add "--trace" to see details.
|
||||
# For Faster Builds: Add "make" option "-j"
|
||||
|
||||
- name: Make pinetime-mcuboot-app
|
||||
run: |
|
||||
cd build
|
||||
make pinetime-mcuboot-app
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
env:
|
||||
SOURCES_DIR: .
|
||||
run: /opt/build.sh all
|
||||
# Unzip the package because Upload Artifact will zip up the files
|
||||
- name: Unzip DFU package
|
||||
run: |
|
||||
# Unzip the package because Upload Artifact will zip up the files
|
||||
unzip build/src/pinetime-mcuboot-app-dfu*.zip -d build/src/pinetime-mcuboot-app-dfu
|
||||
|
||||
- name: Upload DFU package
|
||||
uses: actions/upload-artifact@v2
|
||||
run: unzip ./build/output/pinetime-mcuboot-app-dfu-*.zip -d ./build/output/pinetime-mcuboot-app-dfu
|
||||
- name: Upload DFU artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: pinetime-mcuboot-app-dfu
|
||||
path: build/src/pinetime-mcuboot-app-dfu/*
|
||||
|
||||
#########################################################################################
|
||||
# Make and Upload Standalone Firmware
|
||||
|
||||
- name: Make pinetime-app
|
||||
run: |
|
||||
cd build
|
||||
make pinetime-app
|
||||
|
||||
- name: Upload standalone firmware
|
||||
uses: actions/upload-artifact@v2
|
||||
name: InfiniTime DFU ${{ github.head_ref }}
|
||||
path: ./build/output/pinetime-mcuboot-app-dfu/*
|
||||
- name: Upload MCUBoot image artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: pinetime-app.out
|
||||
path: build/src/pinetime-app*.out
|
||||
|
||||
#########################################################################################
|
||||
# Make but don't Upload the Recovery Firmware to be sure it builds correctly
|
||||
|
||||
- name: Make pinetime-recovery
|
||||
run: |
|
||||
cd build
|
||||
make pinetime-recovery
|
||||
|
||||
#########################################################################################
|
||||
# Finish
|
||||
|
||||
- name: Find output
|
||||
run: |
|
||||
find . -name "pinetime-app.*" -ls
|
||||
find . -name "pinetime-mcuboot-app.*" -ls
|
||||
|
||||
# Embedded Arm Toolchain and nRF5 SDK will only be cached if the build succeeds.
|
||||
# So make sure that the first build always succeeds, e.g. comment out the "Make" step.
|
||||
name: InfiniTime MCUBoot image ${{ github.head_ref }}
|
||||
path: ./build/output/pinetime-mcuboot-app-image-*.bin
|
||||
|
4
.gitignore
vendored
@ -43,3 +43,7 @@ Testing/Temporary/
|
||||
#VSCODE
|
||||
.vscode/.cortex-debug.registers.state.json
|
||||
.vscode/.cortex-debug.peripherals.state.json
|
||||
|
||||
#build files
|
||||
src/nRF5_SDK_15.3.0_59ac345
|
||||
src/arm-none-eabi
|
||||
|
3
.gitmodules
vendored
@ -4,3 +4,6 @@
|
||||
[submodule "src/libs/littlefs"]
|
||||
path = src/libs/littlefs
|
||||
url = https://github.com/littlefs-project/littlefs.git
|
||||
[submodule "src/libs/QCBOR"]
|
||||
path = src/libs/QCBOR
|
||||
url = https://github.com/laurencelundblade/QCBOR.git
|
||||
|
@ -1,17 +0,0 @@
|
||||
# .readthedocs.yaml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
||||
# Optionally build your docs in additional formats such as PDF
|
||||
formats: all
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
2
.vscode/launch.json
vendored
@ -52,7 +52,7 @@
|
||||
"servertype": "openocd",
|
||||
"runToMain": true,
|
||||
// Only use armToolchainPath if your arm-none-eabi-gdb is not in your path (some GCC packages does not contain arm-none-eabi-gdb)
|
||||
"armToolchainPath": "${workspaceRoot}/../gcc-arm-none-eabi-9-2020-q2-update/bin",
|
||||
"armToolchainPath": "${workspaceRoot}/../gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin",
|
||||
"svdFile": "${workspaceRoot}/nrf52.svd",
|
||||
"configFiles": [
|
||||
"interface/stlink.cfg",
|
||||
|
@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(pinetime VERSION 1.7.1 LANGUAGES C CXX ASM)
|
||||
project(pinetime VERSION 1.9.0 LANGUAGES C CXX ASM)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
@ -66,7 +66,7 @@ execute_process(COMMAND git rev-parse --short HEAD
|
||||
OUTPUT_VARIABLE PROJECT_GIT_COMMIT_HASH
|
||||
RESULT_VARIABLE PROJECT_GIT_COMMIT_HASH_SUCCESS)
|
||||
|
||||
string(STRIP ${PROJECT_GIT_COMMIT_HASH} PROJECT_GIT_COMMIT_HASH)
|
||||
string(STRIP "${PROJECT_GIT_COMMIT_HASH}" PROJECT_GIT_COMMIT_HASH)
|
||||
|
||||
message("PROJECT_GIT_COMMIT_HASH_SUCCESS? " ${PROJECT_GIT_COMMIT_HASH_SUCCESS})
|
||||
|
||||
@ -100,7 +100,7 @@ else()
|
||||
endif()
|
||||
|
||||
set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/Version.h)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_BINARY_DIR}/post_build.sh)
|
||||
|
||||
|
||||
|
118
README.md
@ -1,81 +1,38 @@
|
||||
# InfiniTime
|
||||
# [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)
|
||||
|
||||
[![Build PineTime Firmware](https://github.com/InfiniTimeOrg/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)](https://github.com/InfiniTimeOrg/InfiniTime/actions)
|
||||
|
||||
![InfiniTime logo](images/infinitime-logo.jpg "InfiniTime Logo")
|
||||
![InfiniTime logo](images/infinitime-logo-small.jpg "InfiniTime Logo")
|
||||
|
||||
The goal of this project is to design an open-source firmware for the [Pinetime smartwatch](https://www.pine64.org/pinetime/) :
|
||||
|
||||
- Code written in **modern C++**;
|
||||
- Build system based on **CMake**;
|
||||
- Based on **[FreeRTOS 10.0.0](https://freertos.org)** real-time OS.
|
||||
- Using **[LittleVGL/LVGL 7](https://lvgl.io/)** as UI library...
|
||||
- ... and **[NimBLE 1.3.0](https://github.com/apache/mynewt-nimble)** as BLE stack.
|
||||
Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/pinetime/) with many features, written in modern C++.
|
||||
|
||||
## New to InfiniTime?
|
||||
|
||||
- [Getting started with InfiniTime 1.0 (quick user guide, update bootloader and InfiniTime,...)](doc/gettingStarted/gettingStarted-1.0.md)
|
||||
- [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/ota-gadgetbridge-nrfconnect.md)
|
||||
- [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md)
|
||||
- [Updating the software](doc/gettingStarted/updating-software.md)
|
||||
- [About the firmware and bootloader](doc/gettingStarted/about-software.md)
|
||||
### Companion apps
|
||||
- [Gadgetbridge](https://gadgetbridge.org/) (Android)
|
||||
- [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS)
|
||||
- [Siglo](https://github.com/alexr4535/siglo) (Linux)
|
||||
- [InfiniLink](https://github.com/InfiniTimeOrg/InfiniLink) **[Experimental]** **[Unmaintained, looking for developers/maintainers]** (iOS)
|
||||
- [ITD](https://gitea.arsenm.dev/Arsen6331/itd) (Linux)
|
||||
|
||||
## Overview
|
||||
## Development
|
||||
|
||||
![Pinetime screens](images/1.0.0/collage.png "PinetimeScreens")
|
||||
|
||||
As of now, here is the list of achievements of this project:
|
||||
|
||||
- Fast and optimized LCD driver
|
||||
- BLE communication
|
||||
- Rich user interface via display, touchscreen and pushbutton
|
||||
- Time synchronization via BLE
|
||||
- Notification via BLE
|
||||
- Heart rate measurements
|
||||
- Step counting
|
||||
- Wake-up on wrist rotation
|
||||
- Quick actions
|
||||
* Disable vibration on notification
|
||||
* Brightness settings
|
||||
* Flashlight
|
||||
* Settings
|
||||
- 3 watch faces:
|
||||
* Digital
|
||||
* Analog
|
||||
* [PineTimeStyle](https://wiki.pine64.org/wiki/PineTimeStyle)
|
||||
- Multiple 'apps' :
|
||||
* Music (control the playback of music on your phone)
|
||||
* Heart rate (measure your heart rate)
|
||||
* Navigation (displays navigation instructions coming from the companion app)
|
||||
* Notification (displays the last notification received)
|
||||
* Paddle (single player pong-like game)
|
||||
* Twos (2048 clone game)
|
||||
* Stopwatch
|
||||
* Steps (displays the number of steps taken)
|
||||
* Timer (set a countdown timer that will notify you when it expires)
|
||||
* Metronome (vibrates to a given bpm with a customizable beats per bar)
|
||||
- User settings:
|
||||
* Display timeout
|
||||
* Wake-up condition
|
||||
* Time format (12/24h)
|
||||
* Default watch face
|
||||
* Daily step goal
|
||||
* Battery status
|
||||
* Firmware validation
|
||||
* System information
|
||||
- Supported by 3 companion apps (development is in progress):
|
||||
* [Gadgetbridge](https://codeberg.org/Freeyourgadget/Gadgetbridge/) (on Android via F-Droid)
|
||||
* [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS and Linux)
|
||||
* [Siglo](https://github.com/alexr4535/siglo) (on Linux)
|
||||
* **[Experimental]** [WebBLEWatch](https://hubmartin.github.io/WebBLEWatch/) Synchronize time directly from your web browser. [video](https://youtu.be/IakiuhVDdrY)
|
||||
* **[Experimental]** [InfiniLink](https://github.com/xan-m/InfiniLink) (on iOS)
|
||||
- OTA (Over-the-air) update via BLE
|
||||
- [Bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader) based on [MCUBoot](https://www.mcuboot.com)
|
||||
|
||||
## Documentation
|
||||
|
||||
### Develop
|
||||
- [Rough structure of the code](doc/code/Intro.md)
|
||||
- [How to implement an application](doc/code/Apps.md)
|
||||
- [Generate the fonts and symbols](src/displayapp/fonts/README.md)
|
||||
- [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html)
|
||||
- [Tips on designing an app UI](doc/ui_guidelines.md)
|
||||
|
||||
### InfiniSim Simulator
|
||||
Use the [InfiniSim Simulator](https://github.com/InfiniTimeOrg/InfiniSim) to experience the `InfiniTime` user interface directly on your PC, to shorten the time until you get your hands on a real [PineTime smartwatch](https://www.pine64.org/pinetime/).
|
||||
Or use it to develop new Watchfaces, new Screens, or quickly iterate on the user interface.
|
||||
|
||||
### Contributing
|
||||
- [How to contribute?](/doc/contribute.md)
|
||||
- [Coding conventions](/doc/coding-convention.md)
|
||||
|
||||
### Build, flash and debug
|
||||
|
||||
@ -84,16 +41,11 @@ As of now, here is the list of achievements of this project:
|
||||
- [Files included in the release notes](doc/filesInReleaseNotes.md)
|
||||
- [Build the project](doc/buildAndProgram.md)
|
||||
- [Flash the firmware using OpenOCD and STLinkV2](doc/openOCD.md)
|
||||
- [Flash the firmware using SWD interface](doc/SWD.md)
|
||||
- [Build the project with Docker](doc/buildWithDocker.md)
|
||||
- [Build the project with VSCode](doc/buildWithVScode.md)
|
||||
- [Bootloader, OTA and DFU](./bootloader/README.md)
|
||||
- [Stub using NRF52-DK](./doc/PinetimeStubWithNrf52DK.md)
|
||||
- Logging with JLink RTT.
|
||||
- Using files from the releases
|
||||
|
||||
### Contribute
|
||||
|
||||
- [How to contribute ?](doc/contribute.md)
|
||||
|
||||
### API
|
||||
|
||||
@ -103,30 +55,6 @@ As of now, here is the list of achievements of this project:
|
||||
|
||||
- [Memory analysis](./doc/MemoryAnalysis.md)
|
||||
|
||||
### Using the firmware
|
||||
|
||||
- [Integration with Gadgetbridge](doc/companionapps/Gadgetbridge.md)
|
||||
- [Integration with AmazFish](doc/companionapps/Amazfish.md)
|
||||
- [Firmware update, OTA](doc/companionapps/NrfconnectOTA.md)
|
||||
|
||||
## TODO - contribute
|
||||
|
||||
This project is far from being finished, and there are still a lot of things to do for this project to become a firmware usable by the general public.
|
||||
|
||||
Here a quick list out of my head of things to do for this project:
|
||||
|
||||
- Improve BLE communication stability and reliability
|
||||
- Improve OTA and MCUBoot bootloader
|
||||
- Add more functionalities : Alarm, chronometer, configuration, activities, heart rate logging, games,...
|
||||
- Add more BLE functionalities : call notifications, agenda, configuration, data logging,...
|
||||
- Measure power consumption and improve battery life
|
||||
- Improve documentation, take better pictures and video than mine
|
||||
- Improve the UI
|
||||
- Create companion app for multiple OSes (Linux, Android, iOS) and platforms (desktop, ARM, mobile). Do not forget the other devices from Pine64 like [the Pinephone](https://www.pine64.org/pinephone/) and the [Pinebook Pro](https://www.pine64.org/pinebook-pro/).
|
||||
- Design a simple CI (preferably self-hosted and easy to reproduce).
|
||||
|
||||
Do not hesitate to clone/fork the code, hack it and create pull-requests. I'll do my best to review and merge them :)
|
||||
|
||||
## Licenses
|
||||
|
||||
This project is released under the GNU General Public License version 3 or, at your option, any later version.
|
||||
|
@ -9,14 +9,14 @@ Integrating a BLE stack for the OTA functionality would have used to much memory
|
||||
|
||||
When it is run, this bootloader looks in the SPI flash memory if a new firmware is available. It there is one, it *swaps* the current firmware with the new one (the new one is copied in the main flash memory, and the current one is copied in the SPI flash memory) and run the new one. If the new one fails to run properly, the bootloader is able to revert to the old one and mark the new one as not working.
|
||||
|
||||
As this bootloader does not provide any OTA capability, it is not able to actually download a new version of the application. Providing OTA functionality is thus the responsability of the application firmware.
|
||||
As this bootloader does not provide any OTA capability, it is not able to actually download a new version of the application. Providing OTA functionality is thus the responsibility of the application firmware.
|
||||
|
||||
# About MCUBoot
|
||||
MCUBoot is run at boot time. In normal operation, it just jumps to the reset handler of the application firmware to run it. Once the application firmware is running, MCUBoot does not run at all.
|
||||
|
||||
![MCUBoot boot sequence diagram](../doc/bootloader/boot.png "MCUBoot boot sequence diagram")
|
||||
|
||||
But MCUBoot does much more than that : it can upgrade the firmware that is currently running by a new one, and it is also able to revert to the previous version of the firmware in case the new one does not run propertly.
|
||||
But MCUBoot does much more than that : it can upgrade the firmware that is currently running by a new one, and it is also able to revert to the previous version of the firmware in case the new one does not run properly.
|
||||
|
||||
To do this, it uses 2 memory 'slots' :
|
||||
- **The primary slot** : it contains the current firmware, the one that will be executed by MCUBoot
|
||||
@ -40,7 +40,7 @@ This chapter describes degraded cases that are handled by our bootloader and tho
|
||||
Case | Current bootloader | Solution
|
||||
-----|--------------------|----------------------------------------------
|
||||
Data got corrupted during file transfer | [OK] Application firmware does a CRC check before applying the update, and does not proceed if it fails. | N/A
|
||||
New firmware does not run at all (bad file) (1) | [NOK] MCU executes unknown instructions and will most likely end up in an infinite loop or freeze in an error handler. The bootloader does not run, it can do nothing, the MCU is stucked until next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
|
||||
New firmware does not run at all (bad file) (1) | [NOK] MCU executes unknown instructions and will most likely end up in an infinite loop or freeze in an error handler. The bootloader does not run, it can do nothing, the MCU is stuck until next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
|
||||
New firmware runs, does not set the valid bit and does not refresh the watchdog | [NOK] The new firmware runs until the next reset. The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
|
||||
New firmware does not run properly, does not set the valid bit but refreshes the watchdog | [NOK] The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged and will be able to rollback to the previous version.
|
||||
New firmware does not run properly but sets the valid bit and refreshes the watchdog | [NOK] The bootloader won't revert to the previous version because the valid flag is set | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged. Then, the bootloader must provide a way for the user to force the rollback to the previous version
|
||||
@ -115,8 +115,6 @@ sudo dfu.py -z /home/jf/nrf52/bootloader/dfu.zip -a <pinetime MAC address> --leg
|
||||
|
||||
**Note** : dfu.py is a slightly modified version of [this repo](https://github.com/daniel-thompson/ota-dfu-python).
|
||||
|
||||
See [this page](../doc/CompanionApps/NrfconnectOTA.md) for more info about OTA with NRFConect
|
||||
|
||||
### Firmware validation
|
||||
Once the OTA is done, InfiniTime will reset the watch to apply the update. When the watch reboots, the new firmware is running.
|
||||
|
||||
@ -126,12 +124,12 @@ If the new firmware is working correctly, open the application menu and tap on t
|
||||
|
||||
Firmware validation application in the menu:
|
||||
|
||||
![Firmware Validation App](../doc/CompanionApps/firmwareValidationApp.jpg "Firmware Validation App")
|
||||
![Firmware Validation App](../doc/bootloader/firmwareValidationApp.jpg "Firmware Validation App")
|
||||
|
||||
The firmware is not validated yet. Tap 'Validate' to validate it, or 'Reset' to rollback to the previous version.
|
||||
|
||||
![Firmware Not Validated](../doc/CompanionApps/firmwareNoValidated.jpg "Firmware Not Validated")
|
||||
![Firmware Not Validated](../doc/bootloader/firmwareNoValidated.jpg "Firmware Not Validated")
|
||||
|
||||
The firmware is validated!
|
||||
|
||||
![Firmware Validated](../doc/CompanionApps/firmwareValidated.jpg "Firmware Validated")
|
||||
![Firmware Validated](../doc/bootloader/firmwareValidated.jpg "Firmware Validated")
|
||||
|
1
bootloader/ota-dfu-python/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
__pycache__
|
@ -236,7 +236,7 @@ class BleDfuControllerSecure(NrfBleDfuController):
|
||||
self._dfu_send_command(Procedures.EXECUTE)
|
||||
self._wait_and_parse_notify()
|
||||
|
||||
print("Init packet successfully transfered")
|
||||
print("Init packet successfully transferred")
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Send the Firmware image to peripheral device.
|
||||
@ -319,5 +319,5 @@ class BleDfuControllerSecure(NrfBleDfuController):
|
||||
self._dfu_send_command(Procedures.EXECUTE)
|
||||
self._wait_and_parse_notify()
|
||||
|
||||
# If everything executed correctly, return amount of bytes transfered
|
||||
# If everything executed correctly, return amount of bytes transferred
|
||||
return obj_max_size
|
||||
|
@ -106,7 +106,6 @@ macro(nRF5x_setup)
|
||||
${NRF5_SDK_PATH}/external/freertos/source/stream_buffer.c
|
||||
${NRF5_SDK_PATH}/external/freertos/source/tasks.c
|
||||
${NRF5_SDK_PATH}/external/freertos/source/timers.c
|
||||
${NRF5_SDK_PATH}/components/libraries/timer/app_timer_freertos.c
|
||||
)
|
||||
|
||||
# freertos include
|
||||
@ -335,7 +334,6 @@ endmacro(nRF5x_addAppFIFO)
|
||||
# adds app-level Timer libraries
|
||||
macro(nRF5x_addAppTimer)
|
||||
list(APPEND SDK_SOURCE_FILES
|
||||
"${NRF5_SDK_PATH}/components/libraries/timer/app_timer.c"
|
||||
)
|
||||
endmacro(nRF5x_addAppTimer)
|
||||
|
||||
|
@ -7,7 +7,7 @@ Cmake script for projects targeting Nordic Semiconductor nRF5x series devices us
|
||||
The script makes use of the following tools:
|
||||
|
||||
- nRF5x SDK by Nordic Semiconductor - SoC specific drivers and libraries (also includes a lot of examples)
|
||||
- JLink by Segger - interface software for the JLink familiy of programmers
|
||||
- JLink by Segger - interface software for the JLink family of programmers
|
||||
- nrfjprog by Nordic Semiconductor - Wrapper utility around JLink
|
||||
- arm-non-eabi-gcc by ARM and the GCC Team - compiler toolchain for embedded (= bare metal) ARM chips
|
||||
|
||||
@ -15,11 +15,11 @@ The script makes use of the following tools:
|
||||
|
||||
1. Download this repo (or add as submodule) to the directory `cmake-nRF5x` in your project
|
||||
|
||||
1. Search the SDK `example` directory for a `sdk_config.h`, `main.c` and a linker script (normally named `<project_name>_gcc_<chip familly>.ld`) that fits your chip and project needs.
|
||||
1. Search the SDK `example` directory for a `sdk_config.h`, `main.c` and a linker script (normally named `<project_name>_gcc_<chip family>.ld`) that fits your chip and project needs.
|
||||
|
||||
1. Copy the `sdk_config.h` and the project `main.c` into a new directory `src`. Modify them as required for your project.
|
||||
|
||||
1. Copy the linker script into the root of your project. Rename it to just `gcc_<chip familly>.ld` For example:
|
||||
1. Copy the linker script into the root of your project. Rename it to just `gcc_<chip family>.ld` For example:
|
||||
|
||||
```
|
||||
gcc_nrf51.ld
|
||||
|
167
doc/BLEFS.md
Normal file
@ -0,0 +1,167 @@
|
||||
# BLE FS
|
||||
---
|
||||
|
||||
The BLE FS protocol in InfiniTime is mostly Adafruit's BLE file transfer protocol, as described in [adafruit/Adafruit_CircuitPython_BLE_File_Transfer](https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer). There are some deviations, such as the status codes. These will be described later in the document.
|
||||
|
||||
---
|
||||
|
||||
## UUIDs
|
||||
|
||||
There are two relevant UUIDs in this protocol: the version characteristic, and the raw transfer characteristic.
|
||||
|
||||
### Version
|
||||
|
||||
UUID: `adaf0100-4669-6c65-5472-616e73666572`
|
||||
|
||||
The version characteristic returns the version of the protocol to which the sender adheres. It returns a single unsigned 32-bit integer. The latest version at the time of writing this is 4.
|
||||
|
||||
### Transfer
|
||||
|
||||
UUID: `adaf0200-4669-6c65-5472-616e73666572`
|
||||
|
||||
The transfer characteristic is responsible for all the data transfer between the client and the watch. It supports write and notify. Writing a packet on the characteristic results in a response via notify.
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
The separator for paths is `/`, and absolute paths must start with `/`.
|
||||
|
||||
All of the following commands and responses are transferred via the transfer characteristic
|
||||
|
||||
### Read file
|
||||
|
||||
To begin reading a file, a header must first be sent. The header packet should be formatted like so:
|
||||
|
||||
- Command (single byte): `0x10`
|
||||
- 1 byte of padding
|
||||
- Unsigned 16-bit integer encoding the length of the file path.
|
||||
- Unsigned 32-bit integer encoding the location at which to start reading the first chunk.
|
||||
- Unsigned 32-bit integer encoding the amount of bytes to be read.
|
||||
- File path: UTF-8 encoded string that is _not_ null terminated.
|
||||
|
||||
To continue reading the file after this initial packet, the following packet should be sent until all the data has been received. No close command is required after the data has been received.
|
||||
|
||||
- Command (single byte): `0x12`
|
||||
- Status: `0x01`
|
||||
- 2 bytes of padding
|
||||
- Unsigned 32-bit integer encoding the location at which to start reading the next chunk.
|
||||
- Unsigned 32-bit integer encoding the amount of bytes to be read. This may be different from the size in the header.
|
||||
|
||||
Both of these commands receive the following response:
|
||||
|
||||
- Command (single byte): `0x11`
|
||||
- Status (signed 8-bit integer)
|
||||
- 2 bytes of padding
|
||||
- Unsigned 32-bit integer encoding the offset of this chunk
|
||||
- Unsigned 32-bit integer encoding the total size of the file
|
||||
- Unsigned 32-bit integer encoding the amount of data in the current chunk
|
||||
- Contents of the current chunk
|
||||
|
||||
### Write file
|
||||
|
||||
To begin writing to a file, a header must first be sent. The header packet should be formatted like so:
|
||||
|
||||
- Command (single byte): `0x20`
|
||||
- 1 byte of padding
|
||||
- Unsigned 16-bit integer encoding the length of the file path.
|
||||
- Unsigned 32-bit integer encoding the location at which to start writing to the file.
|
||||
- Unsigned 64-bit integer encoding the unix timestamp with nanosecond resolution. This will be used as the modification time. At the time of writing, this is not implemented in InfiniTime, but may be in the future.
|
||||
- Unsigned 32-bit integer encoding the size of the file that will be sent
|
||||
- File path: UTF-8 encoded string that is _not_ null terminated.
|
||||
|
||||
To continue reading the file after this initial packet, the following packet should be sent until all the data has been sent and a response had been received with 0 free space. No close command is required after the data has been received.
|
||||
|
||||
- Command (single byte): `0x22`
|
||||
- Status: `0x01`
|
||||
- 2 bytes of padding.
|
||||
- Unsigned 32-bit integer encoding the location at which to write the next chunk.
|
||||
- Unsigned 32-bit integer encoding the amount of bytes to be written.
|
||||
- Data
|
||||
|
||||
Both of these commands receive the following response:
|
||||
|
||||
- Command (single byte): `0x21`
|
||||
- Status (signed 8-bit integer)
|
||||
- 2 bytes of padding
|
||||
- Unsigned 32-bit integer encoding the current offset in the file
|
||||
- Unsigned 64-bit integer encoding the unix timestamp with nanosecond resolution. This will be used as the modification time. At the time of writing, this is not implemented in InfiniTime, but may be in the future.
|
||||
- Unsigned 32-bit integer encoding the amount of data the client can send until the file is full.
|
||||
|
||||
### Delete file
|
||||
|
||||
- Command (single byte): `0x30`
|
||||
- 1 byte of padding
|
||||
- Unsigned 16-bit integer encoding the length of the file path.
|
||||
- File path: UTF-8 encoded string that is _not_ null terminated.
|
||||
|
||||
The response to this packet will be as follows:
|
||||
|
||||
- Command (single byte): `0x31`
|
||||
- Status (signed 8-bit integer)
|
||||
|
||||
### Make directory
|
||||
|
||||
- Command (single byte): `0x40`
|
||||
- 1 byte of padding
|
||||
- Unsigned 16-bit integer encoding the length of the file path.
|
||||
- 4 bytes of padding
|
||||
- Unsigned 64-bit integer encoding the unix timestamp with nanosecond resolution.
|
||||
- File path: UTF-8 encoded string that is _not_ null terminated.
|
||||
|
||||
The response to this packet will be as follows:
|
||||
|
||||
- Command (single byte): `0x41`
|
||||
- Status (signed 8-bit integer)
|
||||
- 6 bytes of padding
|
||||
- Unsigned 64-bit integer encoding the unix timestamp with nanosecond resolution.
|
||||
|
||||
### List directory
|
||||
|
||||
Paths returned by this command are relative to the path given in the request
|
||||
|
||||
- Command (single byte): `0x50`
|
||||
- 1 byte of padding
|
||||
- Unsigned 16-bit integer encoding the length of the file path.
|
||||
- File path: UTF-8 encoded string that is _not_ null terminated.
|
||||
|
||||
The response to this packet will be as follows. Responses will be sent until the final entry, which will have entry number == total entries
|
||||
|
||||
- Command (single byte): `0x51`
|
||||
- Status (signed 8-bit integer)
|
||||
- Unsigned 16-bit integer encoding the length of the file path.
|
||||
- Unsigned 32-bit integer encoding the entry number
|
||||
- Unsigned 32-bit integer encoding the total amount of entries
|
||||
- Flags: unsigned 32-bit integer
|
||||
+ Bit 0: Set when entry is a directory
|
||||
+ Bits 1-7: Reserved
|
||||
- Unsigned 64-bit integer encoding the unix timestamp of the modification time with nanosecond resolution
|
||||
- Unsigned 32-bit integer encoding the size of the file
|
||||
- Path: UTF-8 encoded string that is _not_ null terminated.
|
||||
|
||||
### Move file or directory
|
||||
|
||||
- Command (single byte): `0x60`
|
||||
- 1 byte of padding
|
||||
- Unsigned 16-bit integer encoding the length of the old path
|
||||
- Unsigned 16-bit integer encoding the length of the new path
|
||||
- Old path: UTF-8 encoded string that is _not_ null terminated.
|
||||
- 1 byte of padding
|
||||
- Newpath: UTF-8 encoded string that is _not_ null terminated.
|
||||
|
||||
The response to this packet will be as follows:
|
||||
|
||||
- Command (single byte): `0x61`
|
||||
- Status (signed 8-bit integer)
|
||||
|
||||
---
|
||||
|
||||
## Deviations
|
||||
|
||||
This section describes the differences between Adafruit's spec and InfiniTime's implementation.
|
||||
|
||||
### Status codes
|
||||
|
||||
The status codes returned by InfiniTime are a signed 8-bit integer, rather than an unsigned one as described in the spec.
|
||||
|
||||
InfiniTime uses LittleFS error codes rather than the ones described in the spec. Those codes can be found in [lfs.h](https://github.com/littlefs-project/littlefs/blob/master/lfs.h#L70).
|
@ -32,13 +32,13 @@ In this analysis, I used [Linkermapviz](https://github.com/PromyLOPh/linkermapvi
|
||||
|
||||
### Linkermapviz
|
||||
|
||||
[Linkermapviz](https://github.com/PromyLOPh/linkermapviz) parses the MAP file and displays its content in a graphical way into an HTML page:
|
||||
[Linkermapviz](https://github.com/PromyLOPh/linkermapviz) parses the MAP file and displays its content on an HTML page as a graphic:
|
||||
|
||||
![linkermapviz](./memoryAnalysis/linkermapviz.png)
|
||||
|
||||
Using this tool, you can easily see the size of each symbol relative to the other one, and check what is using most of the space,...
|
||||
Using this tool, you can compare the relative size of symbols. This can be helpful for checking memory usage at a glance.
|
||||
|
||||
Also, as Linkermapviz is written in Python, you can easily modify it to adapt it to your firmware, export data in another format,... For example, [I modified it to parse the contents of the MAP file and export it in a CSV file](https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-842338620). I could later on open this file in LibreOffice Calc and use sort/filter functionality to search for specific symbols in specific files...
|
||||
Also, as Linkermapviz is written in Python, you can easily modify and adapt it to your firmware or export data in another format. For example, [here it is modified to parse the contents of the MAP file and export it in a CSV file](https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-842338620). This file could later be opened in LibreOffice Calc where sort/filter functionality could be used to search for specific symbols in specific files...
|
||||
|
||||
### Puncover
|
||||
[Puncover](https://github.com/HBehrens/puncover) is another useful tools that analyses the binary file generated by the compiler (the .out file that contains all debug information). It provides valuable information about the symbols (data and code): name, position, size, max stack of each functions, callers, callees...
|
||||
@ -46,27 +46,27 @@ Also, as Linkermapviz is written in Python, you can easily modify it to adapt it
|
||||
|
||||
Puncover is really easy to install:
|
||||
|
||||
- clone the repo and cd into the cloned directory
|
||||
- setup a venv
|
||||
- Clone the repo and cd into the cloned directory
|
||||
- Setup a venv
|
||||
- `python -m virtualenv venv`
|
||||
- `source venv/bin/activate`
|
||||
- Install : `pip install .`
|
||||
- Run : `puncover --gcc_tools_base=/path/to/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi- --elf_file /path/to/build/directory/src/pinetime-app-1.1.0.out --src_root /path/to/sources --build_dir /path/to/build/directory`
|
||||
- Run : `puncover --gcc_tools_base=/path/to/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin/arm-none-eabi- --elf_file /path/to/build/directory/src/pinetime-app-1.1.0.out --src_root /path/to/sources --build_dir /path/to/build/directory`
|
||||
- Replace
|
||||
* `/path/to/gcc-arm-none-eabi-9-2020-q2-update/bin` with the path to your gcc-arm-none-eabi toolchain
|
||||
* `/path/to/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin` with the path to your gcc-arm-none-eabi toolchain
|
||||
* `/path/to/build/directory/src/pinetime-app-1.1.0.out` with the path to the binary generated by GCC (.out file)
|
||||
* `/path/to/sources` with the path to the root folder of the sources (checkout directory)
|
||||
* `/path/to/build/directory` with the path to the build directory
|
||||
- Launch a browser at http://localhost:5000/
|
||||
|
||||
### Analysis
|
||||
Using the MAP file and tools, we can easily see what symbols are using most of the FLASH memory space. In this case, with no surprise, fonts and graphics are the biggest flash space consumer.
|
||||
Using the MAP file and tools, we can easily see what symbols are using most of the flash memory. In this case, unsurprisingly, fonts and graphics are the largest use of flash memory.
|
||||
|
||||
![Puncover](./memoryAnalysis/puncover-all-symbols.png)
|
||||
|
||||
This way, you can easily check what needs to be optimized : we should find a way to store big static data (like fonts and graphics) in the external flash memory, for example.
|
||||
This way, you can easily check what needs to be optimized. We should find a way to store big static data (like fonts and graphics) in the external flash memory, for example.
|
||||
|
||||
It's always a good idea to check the flash memory space when working on the project : this way, you can easily check that your developments are using a reasonable amount of space.
|
||||
It's always a good idea to check the flash memory space when working on the project. This way, you can easily check that your developments are using a reasonable amount of space.
|
||||
|
||||
### Links
|
||||
- Analysis with linkermapviz : https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-842338620
|
||||
@ -150,7 +150,7 @@ You can then display the file using objdump:
|
||||
hexdump ram.bin -v | less
|
||||
```
|
||||
|
||||
The stack is positionned at the end of the RAM -> 0xFFFF. Its size is 8192 bytes, so the end of the stack is at 0xE000.
|
||||
The stack is positioned at the end of the RAM -> 0xFFFF. Its size is 8192 bytes, so the end of the stack is at 0xE000.
|
||||
On the following dump, the maximum stack usage is 520 bytes (0xFFFF - 0xFDF8):
|
||||
|
||||
```
|
||||
@ -210,7 +210,7 @@ NRF_LOG_INFO("heap : %d", m.uordblks);
|
||||
```
|
||||
|
||||
#### Analysis
|
||||
According to my experimentation, InfiniTime uses ~6000bytes of heap most of the time. Except when the Navigation app is launched, where the heap usage increases to... more than 9500 bytes (meaning that the heap overflows and could potentially corrupt the stack!!!). This is a bug that should be fixed in #362.
|
||||
According to my experimentation, InfiniTime uses ~6000bytes of heap most of the time. Except when the Navigation app is launched, where the heap usage exceeds 9500 bytes (meaning that the heap overflows and could potentially corrupt the stack). This is a bug that should be fixed in #362.
|
||||
|
||||
To know exactly what's consuming heap memory, you can `wrap` functions like `malloc()` into your own functions. In this wrapper, you can add logging code or put breakpoints:
|
||||
|
||||
@ -245,7 +245,7 @@ Using this technique, I was able to trace all malloc calls at boot (boot -> digi
|
||||
- https://www.embedded.com/mastering-stack-and-heap-for-system-reliability-part-3-avoiding-heap-errors/
|
||||
|
||||
## LVGL
|
||||
I did a deep analysis of the usage of the buffer dedicated for lvgl (managed by lv_mem).
|
||||
I did a deep analysis of the usage of the buffer dedicated to lvgl (managed by lv_mem).
|
||||
This buffer is used by lvgl to allocated memory for drivers (display/touch), screens, themes, and all widgets created by the apps.
|
||||
|
||||
The usage of this buffer can be monitored using this code :
|
||||
@ -256,7 +256,7 @@ lv_mem_monitor(&mon);
|
||||
NRF_LOG_INFO("\t Free %d / %d -- max %d", mon.free_size, mon.total_size, mon.max_used);
|
||||
```
|
||||
|
||||
The most interesting metric is `mon.max_used` which specifies the maximum number of bytes that were used from this buffer since the initialization of lvgl.
|
||||
The most interesting metric is `mon.max_used` which specifies the maximum number of bytes used from this buffer since the initialization of lvgl.
|
||||
According to my measurements, initializing the theme, display/touch driver and screens cost **4752** bytes!
|
||||
Then, initializing the digital clock face costs **1541 bytes**.
|
||||
For example a simple lv_label needs **~140 bytes** of memory.
|
||||
|
@ -3,13 +3,13 @@
|
||||
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**
|
||||
The service UUID is **00030000-78fc-48fe-8e23-433b3a1942d0**
|
||||
|
||||
## Characteristics
|
||||
### Step count (UUID 00020001-78fc-48fe-8e23-433b3a1942d0)
|
||||
### Step count (UUID 00030001-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)
|
||||
### Raw motion values (UUID 00030002-78fc-48fe-8e23-433b3a1942d0)
|
||||
The current raw motion values. This is a 3 `int16_t` array:
|
||||
|
||||
- [0] : X
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Navigation Service
|
||||
## Introduction
|
||||
The navigation ble service provides 4 characteristics to allow the the watch to display navigation instructions from a companion application. The intended purpose is when performing some outdoor activities, for example running or cycling.
|
||||
The navigation ble service provides 4 characteristics to allow the watch to display navigation instructions from a companion application. This service is intended to be used when performing some outdoor activities, for example running or cycling.
|
||||
|
||||
The 4 characteristics are:
|
||||
flag (string) - Upcoming icon name
|
||||
@ -13,7 +13,7 @@ The service UUID is 00010000-78fc-48fe-8e23-433b3a1942d0
|
||||
|
||||
## Characteristics
|
||||
## Flags (UUID 00010001-78fc-48fe-8e23-433b3a1942d0)
|
||||
All included icons are from pure-maps, which provides the actual routing from the client. The icon names ultimately come from the mapbox project "direction-icons", See https://github.com/rinigus/pure-maps/tree/master/qml/icons/navigation See the end of this document for the full lsit of supported icon names.
|
||||
All included icons are from pure-maps, which provides the actual routing from the client. The icon names ultimately come from the mapbox project "direction-icons", See https://github.com/rinigus/pure-maps/tree/master/qml/icons/navigation See the end of this document for the full list of supported icon names.
|
||||
|
||||
## Narrative (UUID 00010002-78fc-48fe-8e23-433b3a1942d0)
|
||||
This is a client supplied string describing the upcoming instruction such as "At the roundabout take the first exit".
|
||||
@ -22,7 +22,7 @@ This is a client supplied string describing the upcoming instruction such as "At
|
||||
This is a short string describing the distance to the upcoming instruction such as "50 m".
|
||||
|
||||
## Progress (UUID 00010004-78fc-48fe-8e23-433b3a1942d0)
|
||||
The percent complete in a uint8. The watch displays this as an overall progress in a progress bar.
|
||||
The percent complete in a uint8. The watch displays this as an overall progress in a progress bar.
|
||||
|
||||
## Full icon list
|
||||
* arrive
|
||||
|
@ -1,11 +1,11 @@
|
||||
# Build a stub for PineTime using NRF52-DK
|
||||
[NRF52-DK](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52-DK) is the official developpment kit for NRF52832 SoC from Nordic Semiconductor.
|
||||
[NRF52-DK](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52-DK) is the official development kit for the NRF52832 SoC from Nordic Semiconductor used in the PineTime.
|
||||
|
||||
It can be very useful for PineTime development:
|
||||
* You can use it embedded JLink SWD programmer/debugger to program and debug you code on the PineTime
|
||||
* As it's based on the same SoC than the PineTime, you can program it to actually run the same code than the PineTime.
|
||||
This development kit can be very useful for PineTime development:
|
||||
* You can use its embedded JLink SWD programmer/debugger to program and debug your code on the PineTime
|
||||
* As it's based on the same SoC than the PineTime, you can program it to actually run the same code as the PineTime.
|
||||
|
||||
This page is about the 2nd point : we will build a stub that will allow us to run the same code than the one you could run on the PineTime. This will allow you to work more easily if you don't have a PineTime dev kit around, if you don't want to modify your dev kit for SWD programming, or if you want to use some feature from the DK (like power measurement).
|
||||
This page is about the 2nd point. We will build a stub that will allow us to run the same code you can run on the PineTime. This will allow you to work more easily if you don't have a PineTime dev kit around, if you don't want to modify your dev kit for SWD programming, or if you want to use some feature from the NRF52-DK (like power measurement).
|
||||
|
||||
This stub only implements the display, the button and the BLE radio. The other features from the pintime are missing:
|
||||
* heart rate sensor
|
||||
@ -41,7 +41,7 @@ You just need to make the following connections:
|
||||
| P0.13 | Button IN (D3 in my case) |
|
||||
| GND | GND |
|
||||
|
||||
You also need to enable the I/O expander to disconnect pins from buttons and led on the NRF52-DK and leave them available on the pin headers:
|
||||
You also need to enable the I/O expander to disconnect pins from the buttons and LED on the NRF52-DK and leave them available on the pin headers:
|
||||
|
||||
| NRF52 -DK | NRF52- DK |
|
||||
| --------- | --------- |
|
||||
|
@ -1,6 +1,6 @@
|
||||
# The SPI LCD driver
|
||||
## Introduction
|
||||
The LCD controller that drive the display of the Pinetime is the Sitronix ST7789V. This controller is easy to integrate with an MCU thanks to its SPI interface, and has some interesting features like:
|
||||
The LCD controller that drives the display of the Pinetime is the [Sitronix ST7789V](https://wiki.pine64.org/images/5/54/ST7789V_v1.6.pdf). This controller is easy to integrate with an MCU thanks to its SPI interface, and has some interesting features like:
|
||||
- an on-chip display data RAM that can store the whole framebuffer
|
||||
- partial screen update
|
||||
- hardware assisted vertical scrolling
|
||||
|
14
doc/SWD.md
Normal file
@ -0,0 +1,14 @@
|
||||
# How to flash InfiniTime using the SWD interface
|
||||
Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphics-x.y.z.bin** from the release page:
|
||||
|
||||
![Image file](gettingStarted/imageFile.png)
|
||||
|
||||
The bootloader reads a boot logo from the external SPI flash memory. The first step consists of flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommended (the bootloader will display garbage on screen for a few second if you don't do it).
|
||||
Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few seconds until the logo is completely drawn on the display.
|
||||
|
||||
Then, using your SWD tool, flash these file at the following offsets:
|
||||
|
||||
- bootloader.bin : **0x0000**
|
||||
- image-x.y.z.bin : **0x8000**
|
||||
|
||||
Reset and voilà, you're running InfiniTime on your PineTime!
|
36
doc/ble.md
@ -2,13 +2,14 @@
|
||||
## Introduction
|
||||
This page describes the BLE implementation and API built in this firmware.
|
||||
|
||||
**Note** : I'm a beginner in BLE related technologies and the information in this document reflects my current knowledge and understanding of the BLE stack. This information might be erroneous or incomplete. Feel free to submit a PR if you think you can improve it.
|
||||
**Note**: I'm a beginner in BLE related technologies and the information in this document reflects my current knowledge and understanding of the BLE stack. This information might be erroneous or incomplete. Feel free to submit a PR if you think you can improve it.
|
||||
|
||||
---
|
||||
|
||||
### Table of Contents
|
||||
|
||||
- [BLE Connection](#ble-connection)
|
||||
- [BLE FS](#ble-fs)
|
||||
- [BLE UUIDs](#ble-uuids)
|
||||
- [BLE Services](#ble-services)
|
||||
- [CTS](#cts)
|
||||
@ -51,6 +52,13 @@ If **CTS** is detected, it'll request the current time to the companion applicat
|
||||
|
||||
---
|
||||
|
||||
## BLE FS
|
||||
|
||||
The documentation for BLE FS can be found here:
|
||||
[BLEFS.md](./BLEFS.md)
|
||||
|
||||
---
|
||||
|
||||
## BLE UUIDs
|
||||
When possible, InfiniTime tries to implement BLE services defined by the BLE specification.
|
||||
|
||||
@ -72,12 +80,16 @@ The following custom services are implemented in InfiniTime:
|
||||
* [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) : 00030000-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): 00030000-78fc-48fe-8e23-433b3a1942d0
|
||||
|
||||
|
||||
- Since InfiniTime 1.8:
|
||||
* [Weather Service](/src/components/ble/weather/WeatherService.h): 00040000-78fc-48fe-8e23-433b3a1942d0
|
||||
|
||||
---
|
||||
|
||||
@ -108,11 +120,11 @@ Reading a value from the firmware version characteristic will yield a UTF-8 enco
|
||||
|
||||
#### Battery Level
|
||||
|
||||
Reading from the battery level characteristic yields a single byte of data. This byte can be converted to an unsigned 8-bit integer which will be the battery percentage. This characteristic allows notify for updates as the value changes.
|
||||
Reading from the battery level characteristic yields a single byte of data. This byte can be converted to an unsigned 8-bit integer which will be the battery percentage. This characteristic allows notifications for updates as the value changes.
|
||||
|
||||
#### Heart Rate
|
||||
|
||||
Reading from the heart rate characteristic yields two bytes of data. I am not sure of the function of the first byte. It appears to always be zero. The second byte can be converted to an unsigned 8-bit integer which is the current heart rate. This characteristic also allows notify for updates as the value changes.
|
||||
Reading from the heart rate characteristic yields two bytes of data. I am not sure of the function of the first byte. It appears to always be zero. The second byte can be converted to an unsigned 8-bit integer which is the current heart rate. This characteristic also allows notifications for updates as the value changes.
|
||||
|
||||
---
|
||||
|
||||
@ -134,14 +146,14 @@ The new alert characteristic allows sending new notifications to InfiniTime. It
|
||||
For example, here is what a normal notification looks like in Golang (language of `itd`):
|
||||
|
||||
```go
|
||||
// \x00 is the category for simple alert, and there is one new notifcation, hence \x01.
|
||||
// \x00 is the category for simple alert, and there is one new notification, hence \x01.
|
||||
"\x00\x01\x00Test Title\x00Test Body"
|
||||
```
|
||||
|
||||
A call notification looks like so:
|
||||
|
||||
```go
|
||||
// \x03 is the category for calls, and there is one new call notifcation, hence \x01.
|
||||
// \x03 is the category for calls, and there is one new call notification, hence \x01.
|
||||
"\x03\x01\x00Mary"
|
||||
```
|
||||
|
||||
@ -285,4 +297,4 @@ This characteristic expects a particular format:
|
||||
- Microsecond divided by `1e6*256` (`uint8`)
|
||||
- Binary 0001 (`uint8`)
|
||||
|
||||
Write all of these together, encoded as little-endian, to the current time characteristic.
|
||||
Write all of these together, encoded as little-endian, to the current time characteristic.
|
||||
|
@ -3,7 +3,7 @@ Pinetime --> CompanionApp: Start advertising
|
||||
|
||||
group BLE Connection
|
||||
CompanionApp -> Pinetime: Connection request
|
||||
CompanionApp <-> Pinetime: Connection parameters negociation, security procedure,...
|
||||
CompanionApp <-> Pinetime: Connection parameters negotiation, security procedure,...
|
||||
end
|
||||
|
||||
group Service Discovery
|
||||
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 187 KiB |
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 208 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
@ -1,12 +1,12 @@
|
||||
# Branches
|
||||
The branching model of this project is based on the workflow named [Git flow](https://nvie.com/posts/a-successful-git-branching-model/).
|
||||
|
||||
It is based on 2 main branches:
|
||||
The project is based on 2 main branches:
|
||||
- **master** : this branch is always ready to be deployed. It means that at any time, we should be able to build the branch and release a new version of the application.
|
||||
- **develop** : this branch contains the latest development that will be integrated in the next release once it's considered as stable.
|
||||
|
||||
New features should be implemented in **feature branches** created from **develop**. When the feature is ready, a pull-request is created and it'll be merge into **develop** when it is succesfully reviewed and accepted.
|
||||
New features should be implemented in **feature branches** created from **develop**. When the feature is ready, a pull-request is created and it'll be merge into **develop** when it is successfully reviewed and accepted.
|
||||
|
||||
To release a new version of the application, when develop is considered stable, a **release** branch is created from **develop**. This can be considered as a *release candidate* branch. When everything is OK, this release branch is merged into **master** and the release is generated (a tag is applied to git, the release note is finalized, binaries are built,...) from **master**.
|
||||
|
||||
Git flow also supports the creation of **hotfix** branches when a bug is discovered in a released version. The **hotfix** branch is created from **master** and will be used only to implement a fix to this bug. Multiple hotfix branches can be created for the same release if more than one bugs are discovered.
|
||||
Git flow also supports the creation of **hotfix** branches when a bug is discovered in a released version. The **hotfix** branch is created from **master** and will be used only to implement a fix to this bug. Multiple hotfix branches can be created for the same release if multiple bugs are discovered.
|
@ -1,10 +1,10 @@
|
||||
# Build
|
||||
## Dependencies
|
||||
To build this project, you'll need:
|
||||
- A cross-compiler : [ARM-GCC (9-2020-q2-update)](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads/9-2020-q2-update)
|
||||
- A cross-compiler : [ARM-GCC (arm-none-eabi 11.2-2022.02)](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads)
|
||||
- The NRF52 SDK 15.3.0 : [nRF-SDK v15.3.0](https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip)
|
||||
- The Python 3 modules `cbor`, `intelhex`, `click` and `cryptography` modules for the `mcuboot` tool (see [requirements.txt](../tools/mcuboot/requirements.txt))
|
||||
- To to keep the system clean a python virtual environment (`venv`) can be used to install the python modules into
|
||||
- To keep the system clean, you can install python modules into a python virtual environment (`venv`)
|
||||
```sh
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate
|
||||
@ -12,6 +12,10 @@ To build this project, you'll need:
|
||||
python -m pip install -r tools/mcuboot/requirements.txt
|
||||
```
|
||||
- A reasonably recent version of CMake (I use 3.16.5)
|
||||
- lv_font_conv, to generate the font .c files
|
||||
- see [lv_font_conv](https://github.com/lvgl/lv_font_conv#install-the-script)
|
||||
- install npm (commonly done via the package manager, ensure node's version is at least 12)
|
||||
- install lv_font_conv: `npm install lv_font_conv`
|
||||
|
||||
## Build steps
|
||||
### Clone the repo
|
||||
@ -27,7 +31,7 @@ CMake configures the project according to variables you specify the command line
|
||||
|
||||
Variable | Description | Example|
|
||||
----------|-------------|--------|
|
||||
**ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`-DARM_NONE_EABI_TOOLCHAIN_PATH=/home/jf/nrf52/gcc-arm-none-eabi-9-2020-q2-update/`|
|
||||
**ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`-DARM_NONE_EABI_TOOLCHAIN_PATH=/home/jf/nrf52/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/`|
|
||||
**NRF5_SDK_PATH**|path to the NRF52 SDK|`-DNRF5_SDK_PATH=/home/jf/nrf52/Pinetime/sdk`|
|
||||
**USE_JLINK, USE_GDB_CLIENT and USE_OPENOCD**|Enable *JLink* mode, *GDB Client* (Black Magic Probe) mode or *OpenOCD* mode (set the one you want to use to `1`)|`-DUSE_JLINK=1`
|
||||
**CMAKE_BUILD_TYPE (\*)**| Build type (Release or Debug). Release is applied by default if this variable is not specified.|`-DCMAKE_BUILD_TYPE=Debug`
|
||||
@ -43,7 +47,7 @@ By default, this variable is set to *Release*. It compiles the code with size an
|
||||
The *Debug* mode disables all optimizations, which makes the code easier to debug. However, the binary size will likely be too big to fit in the internal flash memory. If you want to build and debug a *Debug* binary, you'll need to disable some parts of the code. For example, the icons for the **Navigation** app use a lot of memory space. You can comment the content of `m_iconMap` in the [Navigation](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/displayapp/screens/Navigation.h#L148) application to free some memory.
|
||||
|
||||
####(**) Note about **BUILD_DFU**:
|
||||
DFU files are the files you'll need to install your build of InfiniTime using OTA (over-the-air) mecanism. To generate the DFU file, the Python tool [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) is needed on your system. Check that this tool is properly installed before enabling this option.
|
||||
DFU files are the files you'll need to install your build of InfiniTime using OTA (over-the-air) mechanism. To generate the DFU file, the Python tool [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) is needed on your system. Check that this tool is properly installed before enabling this option.
|
||||
|
||||
#### CMake command line for JLink
|
||||
```
|
||||
@ -260,4 +264,4 @@ Finally, merge them together with **mergehex**:
|
||||
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.
|
||||
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.
|
||||
|
@ -1,62 +1,58 @@
|
||||
# Build the project using Docker
|
||||
|
||||
A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures. These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed.
|
||||
A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures.
|
||||
These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed.
|
||||
|
||||
Based on Ubuntu 18.04 with the following build dependencies:
|
||||
Based on Ubuntu 22.04 with the following build dependencies:
|
||||
|
||||
* ARM GCC Toolchain
|
||||
* nRF SDK
|
||||
* MCUBoot
|
||||
* adafruit-nrfutil
|
||||
* lv_font_conv
|
||||
|
||||
## Run a container to build the project
|
||||
|
||||
The `infinitime-build` image contains all the dependencies you need. The default `CMD` will compile sources found in `/sources`, so you need only mount your code.
|
||||
The `infinitime-build` image contains all the dependencies you need.
|
||||
The default `CMD` will compile sources found in `/sources`, so you need only mount your code.
|
||||
|
||||
Before continuing, make sure you first build the image as indicated in the [Build the image](#build-the-image) section, or check the [Using the image from Docker Hub](#using-the-image-from-docker-hub) section if you prefer to use a pre-made image.
|
||||
|
||||
This example will build the firmware, generate the MCUBoot image and generate the DFU file. For cloning the repo, see [these instructions](../doc/buildAndProgram.md#clone-the-repo). Outputs will be written to **<project_root>/build/output**:
|
||||
This example will build the firmware, generate the MCUBoot image and generate the DFU file.
|
||||
For cloning the repo, see [these instructions](../doc/buildAndProgram.md#clone-the-repo). Outputs will be written to **<project_root>/build/output**:
|
||||
|
||||
```bash
|
||||
cd <project_root> # e.g. cd ./work/Pinetime
|
||||
docker run --rm -it -v $(pwd):/sources infinitime-build
|
||||
docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime-build
|
||||
```
|
||||
|
||||
If you only want to build a single CMake target, you can pass it in as the first parameter to the build script. This means calling the script explicitly as it will override the `CMD`. Here's an example For `pinetime-app`:
|
||||
By default, the container runs as `root`, which is not convenient as all the files generated by the build will also belong to `root`.
|
||||
The parameter `--user` overrides that default behavior.
|
||||
The command above will run as your current user.
|
||||
|
||||
If you only want to build a single CMake target, you can pass it in as the first parameter to the build script.
|
||||
This means calling the script explicitly as it will override the `CMD`.
|
||||
Here's an example for `pinetime-app`:
|
||||
|
||||
```bash
|
||||
docker run --rm -it -v $(pwd):/sources infinitime-build /opt/build.sh pinetime-app
|
||||
```
|
||||
|
||||
The image is built using 1000:1000 for the user id and group id. If this is different to your user or group ids (run `id -u` and `id -g` to find out what your id values are if you are unsure), you will need to override them via the `--user` parameter in order to prevent permission errors with the output files (and the cmake build cache).
|
||||
|
||||
Running with this image is the same as above, you just specify the ids to `docker run`:
|
||||
|
||||
```bash
|
||||
docker run --rm -it -v $(pwd):/sources --user $(id -u):$(id -g) infinitime-build
|
||||
```
|
||||
|
||||
Or you can specify your user id and group id (by number, not by name) directly:
|
||||
|
||||
```bash
|
||||
docker run --rm -it -v $(pwd):/sources --user 1234:1234 infinitime-build
|
||||
docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime-build /opt/build.sh pinetime-app
|
||||
```
|
||||
|
||||
## Using the image from Docker Hub
|
||||
|
||||
The image is available via Docker Hub for both the amd64 and arm64v8 architectures at [pfeerick/infinitime-build](https://hub.docker.com/r/pfeerick/infinitime-build).
|
||||
The image is available via Docker Hub for both the amd64 and arm64v8 architectures at [infinitime/infinitime-build](https://hub.docker.com/repository/docker/infinitime/infinitime-build).
|
||||
|
||||
It can be pulled (downloaded) using the following command:
|
||||
You can run it using the following command:
|
||||
|
||||
```bash
|
||||
docker pull pfeerick/infinitime-build
|
||||
docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime/infinitime-build
|
||||
```
|
||||
|
||||
The default `latest` tag *should* automatically identify the correct image architecture, but if for some reason Docker does not, you can specify it manually:
|
||||
|
||||
* For AMD64 (x86_64) systems: `docker pull pfeerick/infinitime-build:amd64`
|
||||
* For AMD64 (x86_64) systems: `docker pull --platform linux/amd64 infinitime/infinitime-build`
|
||||
|
||||
* For ARM64v8 (ARM64/aarch64) systems: `docker pull pfeerick/infinitime-build:arm64v8`
|
||||
* For ARM64v8 (ARM64/aarch64) systems: `docker pull --platform linux/arm64 infinitime/infinitime-build`
|
||||
|
||||
## Build the image
|
||||
|
||||
@ -65,11 +61,5 @@ You can build the image yourself if you like!
|
||||
The following commands must be run from the root of the project. This operation will take some time but, when done, a new image named *infinitime-build* is available.
|
||||
|
||||
```bash
|
||||
docker image build -t infinitime-build ./docker
|
||||
```
|
||||
|
||||
The `PUID` and `PGID` build arguments are used to set the user and group ids used in the container, meaning you will not need to specify it later unless they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make the command you need to run later a bit shorter. In the below examples, they are set to your current user id and group id automatically. You can specify them manually, but they must be specified by number, not by name.
|
||||
|
||||
```bash
|
||||
docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) ./docker
|
||||
```
|
||||
docker build -t infinitime-build ./docker
|
||||
```
|
@ -8,7 +8,7 @@ To support as many setups as possible the VS Code configuration files expect the
|
||||
|
||||
Variable | Description | Example
|
||||
----------|-------------|--------
|
||||
**ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`export ARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update`
|
||||
**ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`export ARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi`
|
||||
**NRF5_SDK_PATH**|path to the NRF52 SDK|`export NRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345`
|
||||
|
||||
## VS Code Extensions
|
||||
|
@ -1,14 +1,15 @@
|
||||
# Apps
|
||||
This page will teach you:
|
||||
- what apps in InfiniTime are
|
||||
- what screens and apps are in InfiniTime
|
||||
- how to implement your own app
|
||||
|
||||
## Theory
|
||||
Apps are the things you can launch from the app selection you get by swiping up.
|
||||
At the moment, settings and even the app launcher itself or the clock are implemented very similarly, this might change in the future though.
|
||||
|
||||
The user interface of InfiniTime is made up of **screens**.
|
||||
Screens that are opened from the app launcher are considered **apps**.
|
||||
Every app in InfiniTime is it's own class.
|
||||
An instance of the class is created when the app is launched and destroyed when the user exits the app.
|
||||
They run inside the "displayapp" task (briefly discussed [here](./Intro.md)).
|
||||
An instance of the class is created when the app is launched, and destroyed when the user exits the app.
|
||||
Apps run inside the "displayapp" task (briefly discussed [here](./Intro.md)).
|
||||
Apps are responsible for everything drawn on the screen when they are running.
|
||||
By default, apps only do something (as in a function is executed) when they are created or when a touch event is detected.
|
||||
|
||||
@ -20,30 +21,24 @@ A destructor is needed to clean up LVGL and restore any changes (for example re-
|
||||
App classes can override `bool OnButtonPushed()`, `bool OnTouchEvent(TouchEvents event)` and `bool OnTouchEvent(uint16_t x, uint16_t y)` to implement their own functionality for those events.
|
||||
If an app only needs to display some text and do something upon a touch screen button press,
|
||||
it does not need to override any of these functions, as LVGL can also handle touch events for you.
|
||||
If you have any doubts, you can always look at how the other apps are doing things.
|
||||
If you have any doubts, you can always look at how the other apps function for reference.
|
||||
|
||||
### Continuous updating
|
||||
If your app needs to be updated continuously, yo can do so by overriding the `Refresh()` function in your class
|
||||
If your app needs to be updated continuously, you can do so by overriding the `Refresh()` function in your class
|
||||
and calling `lv_task_create` inside the constructor.
|
||||
An example call could look like this: <br>
|
||||
`taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);` <br>
|
||||
|
||||
An example call could look like this:
|
||||
```cpp
|
||||
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
|
||||
```
|
||||
|
||||
With `taskRefresh` being a member variable of your class and of type `lv_task_t*`.
|
||||
Remember to delete the task again using `lv_task_del`.
|
||||
The function `RefreshTaskCallback` is inherited from screen and just calls your `Refresh` function.
|
||||
|
||||
### Apps with multiple screens
|
||||
InfiniTime provides a mini-library in [displayapp/screens/ScreenList.h](/src/displayapp/screens/ScreenList.h)
|
||||
which makes it relatively easy to add multiple screens to your app.
|
||||
To use it, #include it in the header file of your app and add a ScreenList member to your class.
|
||||
The template argument should be the number of screens you need.
|
||||
You will also need to add `CreateScreen` functions that return `std::unique_ptr<Screen>`
|
||||
to your class, one for every screen you have.
|
||||
There are still some things left to to that I won't cover here.
|
||||
To figure them out, have a look at the "apps" ApplicationList, Settings and SystemInfo.
|
||||
|
||||
The function `RefreshTaskCallback` is inherited from `Screen` and just calls your `Refresh` function.
|
||||
|
||||
## Creating your own app
|
||||
A minimal app could look like this: <br>
|
||||
A minimal app could look like this:
|
||||
|
||||
MyApp.h:
|
||||
```cpp
|
||||
#pragma once
|
||||
@ -66,13 +61,13 @@ namespace Pinetime {
|
||||
|
||||
MyApp.cpp:
|
||||
```cpp
|
||||
#include "MyApp.h"
|
||||
#include "displayapp/screens/MyApp.h"
|
||||
#include "displayapp/DisplayApp.h"
|
||||
|
||||
using namespace Pinetime::Applications::Screens;
|
||||
|
||||
MyApp::MyApp(DisplayApp* app) : Screen(app) {
|
||||
lv_obj_t* title = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr);
|
||||
lv_label_set_text_static(title, "My test application");
|
||||
lv_label_set_align(title, LV_LABEL_ALIGN_CENTER);
|
||||
lv_obj_align(title, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
|
||||
@ -95,12 +90,10 @@ Now, go to the function `DisplayApp::LoadApp` and add another case to the switch
|
||||
The case will be the id you gave your app earlier.
|
||||
If your app needs any additional arguments, this is the place to pass them.
|
||||
|
||||
If you want your app to be launched from the regular app launcher, go to [displayapp/screens/ApplicationList.cpp](/src/displayapp/screens/ApplicationList.cpp).
|
||||
Add your app to one of the `CreateScreen` functions, or add another `CreateScreen` function if there are no empty spaces for your app. <br>
|
||||
If your app is a setting, do the same procedure in [displayapp/screens/settings/Settings.cpp](/src/displayapp/screens/settings/Settings.cpp).
|
||||
If you want to add your app in the app launcher, add your app in [displayapp/screens/ApplicationList.cpp](/src/displayapp/screens/ApplicationList.cpp) to one of the `CreateScreen` functions, or add another `CreateScreen` function if there are no empty spaces for your app. If your app is a setting, do the same procedure in [displayapp/screens/settings/Settings.cpp](/src/displayapp/screens/settings/Settings.cpp).
|
||||
|
||||
You should now be able to [build](../buildAndProgram.md) the firmware
|
||||
and flash it to your PineTime. Yay!
|
||||
|
||||
Please remember to pay attention to the [UI guidelines](../ui_guidelines.md)
|
||||
when designing an app that you want to include in mainstream InfiniTime.
|
||||
when designing an app that you want to be included in InfiniTime.
|
||||
|
@ -21,11 +21,12 @@ Both functions are located inside [systemtask/SystemTask.cpp](/src/systemtask/Sy
|
||||
It also starts the **task "displayapp"**, which is responsible for launching and running apps, controlling the screen and handling touch events (or forwarding them to the active app).
|
||||
You can find the "displayapp" task inside [displayapp/DisplayApp.cpp](/src/displayapp/DisplayApp.cpp).
|
||||
There are also other tasks that are responsible for Bluetooth ("ll" and "ble" inside [libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c](/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c))
|
||||
and periodic tasks like heartrate measurements ([heartratetask/HeartRateTask.cpp](/src/heartratetask/HeartRateTask.cpp)). <br>
|
||||
and periodic tasks like heartrate measurements ([heartratetask/HeartRateTask.cpp](/src/heartratetask/HeartRateTask.cpp)).
|
||||
|
||||
While it is possible for you to create your own task when you need it, it is recommended to just add functionality to `SystemTask::Work()` if possible.
|
||||
If you absolutely need to create another task, try to guess how much [stack space](https://www.freertos.org/FAQMem.html#StackSize) (in words/4-byte packets)
|
||||
If you absolutely need to create another task, try to estimate how much [stack space](https://www.freertos.org/FAQMem.html#StackSize) (in words/4-byte packets)
|
||||
it will need instead of just typing in a large-ish number.
|
||||
You can use the define `configMINIMAL_STACK_SIZE` which is currently set to 120 words.
|
||||
You can use `configMINIMAL_STACK_SIZE` which is currently set to 120 words.
|
||||
|
||||
## Controllers
|
||||
Controllers in InfiniTime are singleton objects that can provide access to certain resources to apps.
|
||||
|
41
doc/coding-convention.md
Normal file
@ -0,0 +1,41 @@
|
||||
# Coding convention
|
||||
|
||||
## Language
|
||||
|
||||
The language of this project is **C++**, and all new code must be written in C++. (Modern) C++ provides a lot of useful tools and functionalities that are beneficial for embedded software development like `constexpr`, `template` and anything that provides zero-cost abstraction.
|
||||
|
||||
C code is accepted if it comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK.
|
||||
|
||||
## Coding style
|
||||
|
||||
The most important rule to follow is to try to keep the code as easy to read and maintain as possible.
|
||||
|
||||
Using an autoformatter is highly recommended, but make sure it's configured properly.
|
||||
|
||||
There are preconfigured autoformatter rules for:
|
||||
|
||||
* CLion (IntelliJ) in [.idea/codeStyles/Project.xml](/.idea/codeStyles/Project.xml)
|
||||
* `clang-format`
|
||||
|
||||
Also use `clang-tidy` to check the code for other issues.
|
||||
|
||||
If there are no preconfigured rules for your IDE, you can use one of the existing ones to configure your IDE.
|
||||
|
||||
- **Indentation** : 2 spaces, no tabulation
|
||||
- **Opening brace** at the end of the line
|
||||
- **Naming** : Choose self-describing variable name
|
||||
- **class** : PascalCase
|
||||
- **namespace** : PascalCase
|
||||
- **variable** : camelCase, **no** prefix/suffix ('_', 'm_',...) for class members
|
||||
- **Include guard** : `#pragma once` (no `#ifdef __MODULE__ / #define __MODULE__ / #endif`)
|
||||
- **Includes** :
|
||||
- files from the project : `#include "relative/path/to/the/file.h"`
|
||||
- external files and std : `#include <file.h>`
|
||||
- use includes relative to included directories like `src`, not relative to the current file. Don't do: `#include "../file.h"`
|
||||
- Only use [primary spellings for operators and tokens](https://en.cppreference.com/w/cpp/language/operator_alternative)
|
||||
- Use auto sparingly. Don't use auto for [fundamental/built-in types](https://en.cppreference.com/w/cpp/language/types) and [fixed width integer types](https://en.cppreference.com/w/cpp/types/integer), except when initializing with a cast to avoid duplicating the type name.
|
||||
- Examples:
|
||||
- `auto* app = static_cast<DisplayApp*>(instance);`
|
||||
- `auto number = static_cast<uint8_t>(variable);`
|
||||
- `uint8_t returnValue = MyFunction();`
|
||||
- Use nullptr instead of NULL
|
@ -1,16 +0,0 @@
|
||||
# Amazfish
|
||||
[Amazfish](https://openrepos.net/content/piggz/amazfish) is a companion app that supports many smartwatches and activity trackers running on [SailfishOS](https://sailfishos.org/).
|
||||
|
||||
## Features
|
||||
The following features are implemented:
|
||||
- Scanning & detection of Pinetime-JF / InfiniTime
|
||||
- Connection / disconnection
|
||||
- Time synchronization
|
||||
- Notifications
|
||||
- Music control
|
||||
- Navigation with Puremaps
|
||||
|
||||
## Demo
|
||||
[This video](https://seafile.codingfield.com/f/21c5d023452740279e36/) shows how to connect to the Pinetime and control the playback of the music on the phone.
|
||||
Amazfish and Sailfish OS are running on the [Pinephone](https://www.pine64.org/pinephone/), another awesome device from Pine64.
|
||||
|
@ -1,13 +0,0 @@
|
||||
# Integration with Gadgetbridge
|
||||
[Gadgetbridge](https://gadgetbridge.org/) is an Android application that supports many smartwatches and fitness trackers.
|
||||
|
||||
The integration of InfiniTime (previously Pinetime-JF) is now merged into the master branch (https://codeberg.org/Freeyourgadget/Gadgetbridge/) and initial support is available [starting with version 0.47](https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/CHANGELOG.md). Note that the official version is only available on F-Droid (as of May 2021), and the unofficial fork available on the Play Store is outdated and does not support Infinitime.
|
||||
|
||||
## Features
|
||||
The following features are implemented:
|
||||
- Scanning & detection of Pinetime-JF / InfiniTime
|
||||
- Connection / disconnection
|
||||
- Notifications
|
||||
|
||||
## Demo
|
||||
[This video](https://seafile.codingfield.com/f/0a2920b9d765462385e4/) shows how to scan, connect, send notification (using the debug screen) and disconnect from the Pinetime.
|
@ -1,12 +0,0 @@
|
||||
# OTA using NRFConnect
|
||||
[NRFConnect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile) is a powerful application (running on Android and iOS) which allows to scan and connect to BLE devices.
|
||||
|
||||
## Features
|
||||
- Scanning, connect, disconnect
|
||||
- Time synchronization
|
||||
- OTA
|
||||
|
||||
InfiniTime implements the Nordic DFU protocol for the OTA functionality. NRFConnect also supports this protocol.
|
||||
|
||||
# Demo
|
||||
[This video](https://seafile.codingfield.com/f/a52b69683a05472a90c7/) shows how to use NRFConnect to update the firmware running on the Pinetime.
|
@ -14,10 +14,6 @@ As the documentation is part of the source code, you can submit your improvement
|
||||
|
||||
You want to fix a bug, add a cool new functionality or improve the code? See *How to submit a pull request below*.
|
||||
|
||||
## Spread the word
|
||||
|
||||
The Pinetime is a cool open source project that deserves to be known. Talk about it around you, on social networks, on your blog,... and let people know that we are working on an open source firmware for a smartwatch!
|
||||
|
||||
# How to submit a pull request?
|
||||
|
||||
## TL;DR
|
||||
@ -25,7 +21,7 @@ The Pinetime is a cool open source project that deserves to be known. Talk about
|
||||
- Create a branch from develop
|
||||
- Work on a single subject in this branch. Create multiple branches/pulls-requests if you want to work on multiple subjects (bugs, features,...)
|
||||
- Test your modifications on the actual hardware
|
||||
- Check the code formatting against our coding conventions and [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy)
|
||||
- Check your code against the [coding conventions](/doc/coding-convention.md) and [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy)
|
||||
- Clean your code and remove files that are not needed
|
||||
- Write documentation related to your new feature if applicable
|
||||
- Create a pull request and write a great description about it: what does your PR do, why, how,... Add pictures and video if possible
|
||||
@ -38,9 +34,9 @@ If you want to fix a bug, add functionality or improve the code, you'll first ne
|
||||
|
||||
When your feature branch is ready, **make sure it actually works** and **do not forget to write documentation** about it if it's relevant.
|
||||
|
||||
**Creating a pull request containing modifications that haven't been tested is strongly discouraged.** If, for any reason, you cannot test your modifications but want to publish them anyway, **please mention it in the description**. This way, other contributors might be willing to test it and provide feedback about your code.
|
||||
**Creating a pull request containing modifications that haven't been tested is strongly discouraged.** If for any reason you cannot test your modifications, but want to publish them anyway, **please mention it in the description**. This way, other contributors might be willing to test it and provide feedback about your code.
|
||||
|
||||
Also, before submitting your PR, check the coding style of your code against the **coding conventions** detailed below. This project also provides [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) configuration files. You can use them to ensure correct formatting of your code.
|
||||
Before submitting a PR, check your code against the [coding conventions](/doc/coding-convention.md). This project also provides [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) configuration files. You should use them to ensure correct formatting of your code.
|
||||
|
||||
Don't forget to check the files you are going to commit and remove those which aren't necessary (config files from your IDE, for example). Remove old comments, commented code,...
|
||||
|
||||
@ -50,54 +46,16 @@ Other contributors can post comments about the pull request, maybe ask for more
|
||||
|
||||
Once the pull request is reviewed and accepted, it'll be merged into **develop** and will be released in the next version of the firmware.
|
||||
|
||||
## Why all these rules?
|
||||
## Why all these rules?
|
||||
|
||||
Reviewing pull requests is a **very time consuming task** for the creator of this project ([JF002](https://github.com/JF002)) and for other contributors who take the time to review them. Everything you do to make reviewing easier will **get your PR merged faster**.
|
||||
Reviewing pull requests is a **very time consuming task**. Everything you do to make reviewing easier will **get your PR merged faster**.
|
||||
|
||||
When reviewing PRs, the author and contributors will first look at the **description**. If it's easy to understand what the PR does, why the modification is needed or interesting and how it's done, a good part of the work is already done : we understand the PR and its context.
|
||||
Reviewers will first look at the **description**. If it's easy to understand what the PR does, why the modification is needed or interesting and how it's done, a good part of the work is already done : we understand the PR and its context.
|
||||
|
||||
Then, reviewing **a few files that were modified for a single purpose** is a lot more easier than to review 30 files modified for many reasons (bug fix, UI improvements, typos in doc,...), even if all these changes make sense. Also, it's possible that we agree on some modification but not on some other, so we won't be able to merge the PR because of the changes that are not accepted.
|
||||
Reviewing **a few files that were modified for a single purpose** is a lot easier than reviewing 30 files modified for many reasons (bug fix, UI improvements, typos in doc,...), even if all the changes make sense. Also, it's possible that we agree on some modification but not on another, so we won't be able to merge the PR because of the changes that are not accepted.
|
||||
|
||||
We do our best to keep the code as consistent as possible. If the formatting of the code in your PR is not consistent with our code base, we'll ask you to review it, which will take more time.
|
||||
The code base should be kept as consistent as possible. If the formatting of your code is not consistent with the rest of the code base, we'll ask you to review it.
|
||||
|
||||
The last step of the review consists of **testing** the modification. If it doesn't work out of the box, we'll ask your to review your code and to ensure that it works as expected.
|
||||
Lastly the changes are tested. If it doesn't work out of the box, we'll ask you to review your code and to ensure that it works as expected.
|
||||
|
||||
It's totally normal for a PR to need some more work even after it was created, that's why we review them. But every round trip takes time, so it's good practice to try to reduce them as much as possible by following those simple rules.
|
||||
|
||||
# Coding convention
|
||||
|
||||
## Language
|
||||
|
||||
The language of this project is **C++**, and all new code must be written in C++. (Modern) C++ provides a lot of useful tools and functionalities that are beneficial for embedded software development like `constexpr`, `template` and anything that provides zero-cost abstraction.
|
||||
|
||||
C code is accepted if it comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK.
|
||||
|
||||
## Coding style
|
||||
|
||||
The most important rule to follow is to try to keep the code as easy to read and maintain as possible.
|
||||
|
||||
Using an autoformatter is highly recommended, but make sure it's configured properly.
|
||||
|
||||
There are preconfigured autoformatter rules for:
|
||||
|
||||
* CLion (IntelliJ) in .idea/codeStyles/Project.xml
|
||||
|
||||
If there are no preconfigured rules for your IDE, you can use one of the existing ones to configure your IDE.
|
||||
|
||||
- **Indentation** : 2 spaces, no tabulation
|
||||
- **Opening brace** at the end of the line
|
||||
- **Naming** : Choose self-describing variable name
|
||||
- **class** : PascalCase
|
||||
- **namespace** : PascalCase
|
||||
- **variable** : camelCase, **no** prefix/suffix ('_', 'm_',...) for class members
|
||||
- **Include guard** : `#pragma once` (no `#ifdef __MODULE__ / #define __MODULE__ / #endif`)
|
||||
- **Includes** :
|
||||
- files from the project : `#include "relative/path/to/the/file.h"`
|
||||
- external files and std : `#include <file.h>`
|
||||
- Only use [primary spellings for operators and tokens](https://en.cppreference.com/w/cpp/language/operator_alternative)
|
||||
- Use auto sparingly. Don't use auto for [fundamental/built-in types](https://en.cppreference.com/w/cpp/language/types) and [fixed width integer types](https://en.cppreference.com/w/cpp/types/integer), except when initializing with a cast to avoid duplicating the type name.
|
||||
- Examples:
|
||||
- `auto* app = static_cast<DisplayApp*>(instance);`
|
||||
- `auto number = static_cast<uint8_t>(variable);`
|
||||
- `uint8_t returnValue = MyFunction();`
|
||||
- Use nullptr instead of NULL
|
||||
|
26
doc/gettingStarted/about-software.md
Normal file
@ -0,0 +1,26 @@
|
||||
# Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it?
|
||||
|
||||
You may have already encountered these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and you may find them confusing if you're not familiar with the project.
|
||||
|
||||
A **firmware** is software running on the embedded hardware of a device.
|
||||
|
||||
InfiniTime has three distinct firmwares:
|
||||
|
||||
- **[InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)** is the operating system.
|
||||
- **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying firmware updates and runs before booting into InfiniTime.
|
||||
- **The recovery firmware** is a special *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.
|
||||
|
||||
**OTA** (**O**ver **T**he **A**ir) refers to updating of the firmware over BLE (**B**luetooth **L**ow **E**nergy). This is a functionality that allows the user to update the firmware on their device wirelessly.
|
||||
|
||||
**DFU** (**D**evice **F**irmware **U**pdate) is the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implements the (legacy) DFU protocol from Nordic Semiconductor (NRF).
|
||||
|
||||
## Bootloader
|
||||
|
||||
Most of the time, the bootloader just runs without your intervention (updating and loading the firmware).
|
||||
|
||||
However, you can use the bootloader to rollback to the previous firmware, or load the recovery firmware using the push button:
|
||||
|
||||
- Press and hold the button until the pine cone is drawn in **blue** to force the rollback of the previous version of the firmware, even if you've already validated the current one.
|
||||
- Press and hold the button until the pine cone is drawn in **red** to load the recovery firmware. This recovery firmware only provides BLE connectivity and OTA functionality.
|
||||
|
||||
More info about the bootloader in [its project page](https://github.com/JF002/pinetime-mcuboot-bootloader/blob/master/README.md).
|
Before Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 72 KiB |
@ -1,119 +1,57 @@
|
||||
# Getting started with InfiniTime 1.0
|
||||
# Getting started with InfiniTime
|
||||
|
||||
On April 22 2021, InfiniTime and Pine64 [announced the release of InfiniTime 1.0](https://www.pine64.org/2021/04/22/its-time-infinitime-1-0/) and the availability of PineTime smartwatches as *enthusiast grade end-user product*. This page aims to guide you with your first step with your new PineTime.
|
||||
On April 22 2021, InfiniTime and Pine64 [announced the release of InfiniTime 1.0.0](https://www.pine64.org/2021/04/22/its-time-infinitime-1-0/) and the availability of PineTime smartwatches as an *enthusiast grade end-user product*. This page aims to guide you with your first step with your new PineTime.
|
||||
|
||||
## Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it?
|
||||
It is highly recommended to update the firmware to the latest version when you receive your watch and when a new InfiniTime version is released. More information on updating the firmware [here](/doc/gettingStarted/updating-software.md).
|
||||
|
||||
You might have already seen these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and, you may find them misleading if you're not familiar with the project.
|
||||
|
||||
Basically, a **firmware** is just a software running on the embedded hardware of a device, the PineTime in this case.
|
||||
**InfiniTime** is based on 3 distinct **firmwares**:
|
||||
- **[InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)** itself, this is the *application firmware* running on the PineTime. This is the main firmware which provides most of the functionalities you'll use on a daily basis : bluetooth low-energy (BLE) connectivity, applications, watchfaces,...
|
||||
- **[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**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?
|
||||
|
||||
Since September 2020, all PineTimes (devkits or sealed) are flashed using the **[first iteration of the bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/releases/tag/v4.1.7)** and **[InfiniTime 0.7.1](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.7.1)**. There was no recovery firmware at that time.
|
||||
|
||||
The bootloader only runs when the watch starts (from an empty battery, for example) or after a reset (after a successful OTA or a manual reset - long push on the button).
|
||||
|
||||
You can recognize this first iteration of the bootloader with it greenish **PINETIME** logo.
|
||||
|
||||
![Old bootloader logo](oldbootloaderlogo.jpg)
|
||||
|
||||
You can check the version of InfiniTime by opening the app *SystemInfo*. For version < 1.0:
|
||||
|
||||
![InfiniTime 0.7.1 Application menu](appmenu-071.jpg)
|
||||
![InfiniTime 0.7.1 version](version-071.jpg)
|
||||
|
||||
And for version >= 1.0 :
|
||||
|
||||
![InfiniTime 1.0 version](version-1.0.jpg)
|
||||
|
||||
PineTime shipped from June 2021 (to be confirmed) will be flashed with the [new version of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0), the [recovery firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1) and [InfiniTime 1.0](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/1.0.0).
|
||||
|
||||
The bootloader is easily recognizable with it white pine cone that is progressively drawn in green. It also displays its own version on the bottom (1.0.0 as of now).
|
||||
|
||||
![Bootloader 1.0](bootloader-1.0.jpg)
|
||||
|
||||
## How to update your PineTime?
|
||||
|
||||
To update your PineTime, you can use one of the compatible companion applications. Here are the main ones:
|
||||
|
||||
- **[Amazfish](https://github.com/piggz/harbour-amazfish)** (Desktop Linux, mobile Linux, SailfishOS, runs on the PinebookPro and the Pinephone)
|
||||
- **[Gadgetbridge](https://www.gadgetbridge.org/)** (Android)
|
||||
- **[Siglo](https://github.com/alexr4535/siglo)** (Linux, GTK based)
|
||||
- **NRFConnect** (closed source, Android & iOS).
|
||||
|
||||
See [this page](ota-gadgetbridge-nrfconnect.md) for more info about the OTA procedure using Gadgetbridge and NRFConnect.
|
||||
|
||||
### From InfiniTime 0.7.1 / old bootloader
|
||||
|
||||
If your PineTime is currently running InfiniTime 0.7.1 and the old bootloader, we strongly recommend you update them to more recent version (Bootloader 1.0.0 and InfiniTime 1.0.0 as of now). We also recommend you install the recovery firmware once the bootloader is up-do-date.
|
||||
|
||||
Using the companion app of your choice, you'll need to apply the OTA procedure for these 3 firmwares in this sequence (failing to follow this specific order might temporarily or permanently brick your device):
|
||||
|
||||
1. Flash the latest version of InfiniTime. The file to upload is named **pinetime-mcuboot-app-dfu-x.y.z.zip**. Here is the link to [InfiniTime 1.0](https://github.com/InfiniTimeOrg/InfiniTime/releases/download/1.0.0/pinetime-mcuboot-app-dfu-1.0.0.zip).
|
||||
2. Update the bootloader by applying the OTA procedure with the file named [**reloader-mcuboot.zip** from the repo of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/download/1.0.0/reloader-mcuboot.zip).
|
||||
3. Install the recovery firmware by applying the OTA procedure with the file named [**pinetime-mcuboot-recovery-loader-dfu-0.14.1.zip** from the version 0.14.1 of InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime/releases/download/0.14.1/pinetime-mcuboot-recovery-loader-dfu-0.14.1.zip).
|
||||
|
||||
You'll find more info about this process in [this wiki page](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0). You can also see the procedure in video [here](https://video.codingfield.com/videos/watch/831077c5-16f3-47b4-9b2b-c4bbfecc6529) and [here (from Amazfish)](https://video.codingfield.com/videos/watch/f7bffb3d-a6a1-43c4-8f01-f4aeff4adf9e)
|
||||
|
||||
### From version > 1.0
|
||||
|
||||
If you are already running the new "1.0.0" bootloader, all you have to do is update your version of InfiniTime when it'll be available. We'll write specific instructions when (if) we release a new version of the bootloader.
|
||||
|
||||
### Firmware validation
|
||||
|
||||
The bootloader requires a (manual) validation of the firmware. If the watch reset with an updated firmware that was not validated, the bootloader will consider it as non-functioning and will revert to the previous version of the firmware. This is a safety feature to prevent bricking your device with a faulty firmware.
|
||||
|
||||
You can validate your updated firmware on InfiniTime >= 1.0 by following this simple procedure:
|
||||
|
||||
- From the watchface, swipe **right** to display the *Quick Actions menu*
|
||||
- Open the **Settings** app by tapping the *gear* icon on the bottom right
|
||||
- Swipe down and tap on the entry named **Firmware**
|
||||
- This app shows the version that is currently running. If it's not validated yet, it displays 2 buttons:
|
||||
- **Validate** to validate your firmware
|
||||
- **Reset** to reset the watch and revert to the previously running version of the firmware
|
||||
|
||||
## InfiniTime 1.0 quick user guide
|
||||
## InfiniTime quick user guide
|
||||
|
||||
### Setting the time
|
||||
|
||||
By default, InfiniTime starts on the digital watchface. It'll probably display the epoch time (1 Jan 1970, 00:00). The time will be automatically synchronized once you connect on of the companion app to your PineTime using BLE connectivity. InfiniTime does not provide any way to manually set the time for now.
|
||||
By default, InfiniTime starts on the digital watchface. It'll probably display the epoch time (1 Jan 1970, 00:00).
|
||||
|
||||
You can sync the time using companion apps.
|
||||
|
||||
- Gadgetbridge automatically synchronizes the time when you connect it to your watch. More information on Gadgetbridge [here](/doc/gettingStarted/ota-gadgetbridge.md)
|
||||
- [Sync the time with NRFConnect](/doc/gettingStarted/time-nrfconnect.md)
|
||||
- Sync the time with your browser https://hubmartin.github.io/WebBLEWatch/
|
||||
|
||||
You can also set the time in the settings without a companion app. (version >1.7.0)
|
||||
|
||||
InfiniTime doesn't handle daylight savings automatically, so make sure to set the correct time or sync it with a companion app.
|
||||
|
||||
### Digital watch face
|
||||
|
||||
![Digital watch face](ui/watchface.jpg)
|
||||
|
||||
This is what the default digital watch face looks like. You can change watch faces in the settings.
|
||||
|
||||
The indicator on the top left is visible if you have unread notifications
|
||||
|
||||
On the top right there are status icons
|
||||
|
||||
- The battery icon shows roughly how much charge is remaining
|
||||
- The Bluetooth icon is visible when the watch is connected to a companion app
|
||||
- A plug icon is shown when the watch is plugged into a charger.
|
||||
|
||||
On the bottom left you can see your heart rate if you have the measurement enabled in the heart rate app.
|
||||
|
||||
On the bottom right you can see how many steps you have taken today.
|
||||
|
||||
### Navigation in the menu
|
||||
|
||||
![Quick actions](quickactions.jpg)
|
||||
![Settings](settings.jpg)
|
||||
![Application menu](appmenu.jpg)
|
||||
![Application menu](ui/applist.jpg)
|
||||
![Notifications](ui/notifications.jpg)
|
||||
![Quick actions](ui/quicksettings.jpg)
|
||||
![Settings](ui/settings.jpg)
|
||||
|
||||
- Swipe **down** to display the notification panel. Notification sent by your companion app will be displayed in this panel.
|
||||
- Swipe **up** to display the application menus. Apps (stopwatch, music, step, games,...) can be started from this menu.
|
||||
- Swipe **down** to display the notification panel. Notification sent by your companion app will be displayed here.
|
||||
- Swipe **right** to display the Quick Actions menu. This menu allows you to
|
||||
- Set the brightness of the display
|
||||
- Start the **flashlight** app
|
||||
- Enable/disable vibrations on notifications (Do Not Disturb mode)
|
||||
- Enable/disable notifications (Do Not Disturb mode)
|
||||
- Enter the **settings** menu
|
||||
- Settings
|
||||
- Display timeout
|
||||
- Wake up event (Tap, wrist rotation)
|
||||
- Time format (12/24H)
|
||||
- Default watchface (digital / analog)
|
||||
- Battery info
|
||||
- Firmware validation
|
||||
- About (system info, firmware version,...)
|
||||
|
||||
### Bootloader
|
||||
|
||||
Most of the time, the bootloader just runs without your intervention (update and load the firmware).
|
||||
|
||||
However, you can enable 2 functionalities using the push button:
|
||||
|
||||
- Push the button until the pine cone is drawn in **blue** to force the rollback of the previous version of the firmware, even if you've already validated the updated one
|
||||
- Push the button until the pine cone is drawn in **red** to load the recovery firmware. This recovery firmware only provides BLE connectivity and OTA functionality.
|
||||
|
||||
More info about the bootloader in [its project page](https://github.com/JF002/pinetime-mcuboot-bootloader/blob/master/README.md).
|
||||
- Swipe up and down to see all options
|
||||
- Click the button to go back a screen.
|
||||
- You can hold the button for a short time to return to the watch face. (version >1.7.0)
|
||||
|
Before Width: | Height: | Size: 114 KiB |
@ -1,109 +0,0 @@
|
||||
# Flash and upgrade InfiniTime
|
||||
If you just want to flash or upgrade InfiniTime on your PineTime, this page is for you!
|
||||
|
||||
- [InfiniTime releases and versions](#infinitime-releases-and-versions)
|
||||
- [How to upgrade Over-The-Air (OTA)](#how-to-upgrade-over-the-air-ota)
|
||||
- [Using Gadgetbridge](#using-gadgetbridge)
|
||||
- [Using NRFConnect](#Using-nrfconnect)
|
||||
- [How to flash InfiniTime using the SWD interface](#how-to-flash-infinitime-using-the-swd-interface)
|
||||
|
||||
## InfiniTime releases and versions
|
||||
All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases).
|
||||
|
||||
Versions that are tagged as **RELEASE CANDIDATE** are pre-release versions, that are available for testing before actually releasing a new stable version. If you want to help us debug the project and provide stable versions to other user, you can use them. If you want stable and tested version, you should not flash these release candidate version.
|
||||
|
||||
Release files are available under the *Assets* button.
|
||||
|
||||
## How to upgrade Over-The-Air (OTA)
|
||||
OTA is the easiest method to upgrade InfiniTime. Note that it's only possible is your PineTime is already running InfiniTime (>= 0.7.1).
|
||||
|
||||
2 companion apps provide support for OTA :
|
||||
- [Gadgetbridge](https://gadgetbridge.org/) (open source, runs on Android, [available on F-Droid](https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/)).
|
||||
- [NRFConnect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile) (close source, runs on Android and iOS).
|
||||
|
||||
Both applications need you to download the **DFU file** of InfiniTime. This file contains the new version of InfiniTime that will be flashed into your device. It's called **dfu-x.y.z.zip** (ex: dfu-0.9.0.zip) in the release note.
|
||||
![Dfu file](dfuFile.png )
|
||||
|
||||
### Using Gadgetbridge
|
||||
Launch Gadgetbridge and tap on the **"+"** button on the bottom right to add a new device:
|
||||
|
||||
![Gadgetbridge 0](gadgetbridge0.jpg)
|
||||
|
||||
Wait for the scan to complete, your PineTime should be detected:
|
||||
|
||||
![Gadgetbridge 1](gadgetbridge1.jpg)
|
||||
|
||||
Tap on it. Gadgdetbridge will pair and connect to your device:
|
||||
|
||||
![Gadgetbridge 2](gadgetbridge2.jpg)
|
||||
|
||||
Now that Gadgetbridge is connected to your PineTime, use a file browser application (I'm using Seafile to browse my NAS) and browse to the DFU file (image-xxx.zip) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer:
|
||||
|
||||
![Gadgetbridge 3](gadgetbridge3.jpg)
|
||||
|
||||
Read carefully the warning and tap **Install**:
|
||||
|
||||
![Gadgetbridge 4](gadgetbridge4.jpg)
|
||||
|
||||
Wait for the transfer to finish. Your PineTime should reset and reboot with the new version of InfiniTime!
|
||||
|
||||
Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used.
|
||||
|
||||
![Gadgetbridge 5](gadgetbridge5.jpg)
|
||||
|
||||
### Using NRFConnect
|
||||
Open NRFConnect. Swipe down in the *Scanner* tab and wait for your device to appear:
|
||||
|
||||
![NRFConnect 0](nrfconnect0.jpg)
|
||||
|
||||
Tap on the *Connect* button on the right of your device. NRFConnect will connect to your PineTime and discover its characteristics. Tap on the **DFU** button on the top right:
|
||||
|
||||
![NRFConnect 1](nrfconnect1.jpg)
|
||||
|
||||
Select **Distribution packet (ZIP)**:
|
||||
|
||||
![NRFConnect 2](nrfconnect2.jpg)
|
||||
|
||||
Browse to the DFU file you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime!
|
||||
|
||||
Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used.
|
||||
|
||||
![NRFConnect 3](nrfconnect3.jpg)
|
||||
|
||||
## How to flash InfiniTime using the SWD interface
|
||||
Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphics-x.y.z.bin** from the release page:
|
||||
|
||||
![Image file](imageFile.png )
|
||||
|
||||
The bootloader reads a boot logo from the external SPI flash memory. The first step consists in flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommanded (the bootloader will display garbage on screen for a few second if you don't do it).
|
||||
Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few second, until the logo is completely drawn on the display.
|
||||
|
||||
Then, using your SWD tool, flash those file at specific offset:
|
||||
|
||||
- bootloader.bin : **0x0000**
|
||||
- image-x.y.z.bin : **0x8000**
|
||||
|
||||
Reset and voilà, you're running InfiniTime on your PineTime!
|
||||
|
||||
If you are using OpenOCD with a STLinkV2, you can find more info [on this page](../openOCD.md).
|
||||
|
||||
## How to synchronize the time
|
||||
|
||||
### Using Gadgetbridge
|
||||
Good news! Gadgetbridge **automatically** synchronizes the time when connecting to your PineTime!
|
||||
|
||||
### Using any Chromium-based web browser
|
||||
You can use it from your PC, Mac, Android. Browsers now have BLE support.
|
||||
https://hubmartin.github.io/WebBLEWatch/
|
||||
|
||||
### Using NRFConnect
|
||||
You must enable the **CTS** *GATT server* into NRFConnect so that InfiniTime can synchronize the time with your smartphone.
|
||||
|
||||
Launch NRFConnect, tap the sandwich button on the top left and select *Configure GATT server*:
|
||||
|
||||
![NRFConnect CTS 0](nrfconnectcts0.jpg)
|
||||
|
||||
|
||||
Tap *Add service* and select the server configuration *Current Time service*. Tap OK and connect to your PineTime, it should automcatically sync the time once the connection is established!
|
||||
|
||||
![NRFConnect CTS 1](nrfconnectcts1.jpg)
|
29
doc/gettingStarted/ota-gadgetbridge.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Connecting to Gadgetbridge
|
||||
|
||||
Launch Gadgetbridge and tap on the **"+"** button on the bottom right to add a new device:
|
||||
|
||||
![Gadgetbridge 0](gadgetbridge0.jpg)
|
||||
|
||||
Wait for the scan to complete, your PineTime should be detected:
|
||||
|
||||
![Gadgetbridge 1](gadgetbridge1.jpg)
|
||||
|
||||
Tap on it. Gadgdetbridge will pair and connect to your device:
|
||||
|
||||
![Gadgetbridge 2](gadgetbridge2.jpg)
|
||||
|
||||
# Updating with Gadgetbridge
|
||||
|
||||
Now that Gadgetbridge is connected to your PineTime, use a file browser application and find the DFU file (`pinetime-mcuboot-app-dfu-x.x.x.zip`) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer:
|
||||
|
||||
![Gadgetbridge 3](gadgetbridge3.jpg)
|
||||
|
||||
Read the warning carefully and tap **Install**:
|
||||
|
||||
![Gadgetbridge 4](gadgetbridge4.jpg)
|
||||
|
||||
Wait for the transfer to finish. Your PineTime should reset and reboot with the new version of InfiniTime!
|
||||
|
||||
Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used.
|
||||
|
||||
![Gadgetbridge 5](gadgetbridge5.jpg)
|
22
doc/gettingStarted/ota-nrfconnect.md
Normal file
@ -0,0 +1,22 @@
|
||||
# Updating with NRFConnect
|
||||
|
||||
Open NRFConnect. Swipe down in the *Scanner* tab and wait for your device to appear:
|
||||
|
||||
![NRFConnect 0](nrfconnect0.jpg)
|
||||
|
||||
Tap on the *Connect* button on the right of your device. NRFConnect will connect to your PineTime and discover its characteristics. Tap on the **DFU** button on the top right:
|
||||
|
||||
![NRFConnect 1](nrfconnect1.jpg)
|
||||
|
||||
Select **Distribution packet (ZIP)**:
|
||||
|
||||
![NRFConnect 2](nrfconnect2.jpg)
|
||||
|
||||
Find the DFU file (`pinetime-mcuboot-app-dfu-x.x.x.zip`) you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime!
|
||||
|
||||
Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used.
|
||||
|
||||
![NRFConnect 3](nrfconnect3.jpg)
|
||||
|
||||
# Demo
|
||||
[This video](https://seafile.codingfield.com/f/a52b69683a05472a90c7/) shows how to use NRFConnect to update the firmware running on the Pinetime.
|
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 127 KiB |
11
doc/gettingStarted/time-nrfconnect.md
Normal file
@ -0,0 +1,11 @@
|
||||
### Syncing time
|
||||
|
||||
You must enable the **CTS** *GATT server* in NRFConnect so that InfiniTime can synchronize the time with your smartphone.
|
||||
|
||||
Launch NRFConnect, tap the sandwich button on the top left and select *Configure GATT server*:
|
||||
|
||||
![NRFConnect CTS 0](nrfconnectcts0.jpg)
|
||||
|
||||
Tap *Add service* and select the server configuration *Current Time service*. Tap OK and connect to your PineTime, it should automcatically sync the time once the connection is established!
|
||||
|
||||
![NRFConnect CTS 1](nrfconnectcts1.jpg)
|
BIN
doc/gettingStarted/ui/applist.jpg
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
doc/gettingStarted/ui/notifications.jpg
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
doc/gettingStarted/ui/quicksettings.jpg
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
doc/gettingStarted/ui/settings.jpg
Normal file
After Width: | Height: | Size: 135 KiB |
BIN
doc/gettingStarted/ui/watchface.jpg
Normal file
After Width: | Height: | Size: 101 KiB |
41
doc/gettingStarted/updating-software.md
Normal file
@ -0,0 +1,41 @@
|
||||
# Updating InfiniTime
|
||||
|
||||
If you just want to flash or upgrade InfiniTime on your PineTime, this page is for you! If you want more information about the software and the update procedure, check out [this](/doc/gettingStarted/about-software.md) page.
|
||||
|
||||
## Checking the version of InfiniTime
|
||||
|
||||
You can check the InfiniTime version by first swiping right on the watchface to open quick settings, tapping the cogwheel to open settings, swipe up until you find an entry named "About" and tap on it.
|
||||
|
||||
![InfiniTime 1.0 version](version-1.0.jpg)
|
||||
|
||||
PineTimes shipped after June 2021 will ship with the latest version of [the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0) and [recovery firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1)
|
||||
|
||||
The bootloader is run right before booting into InfiniTime. It is easily recognizable with its white pine cone that is progressively drawn in green. It also displays its own version on the bottom (1.0.0 as of now).
|
||||
|
||||
![Bootloader 1.0](bootloader-1.0.jpg)
|
||||
|
||||
## Updating with companion apps
|
||||
|
||||
To update your PineTime, you can use one of the [compatible companion applications](/README.md#companion-apps).
|
||||
|
||||
The updating process differs slightly on every companion app, so you'll need to familiarize yourself with the companion app of your choice.
|
||||
|
||||
All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases) under assets.
|
||||
|
||||
To update the firmware, you need to download the DFU of the firmware version that you'd like to install, for example `pinetime-mcuboot-app-dfu-1.6.0.zip`, and flash it with your companion app.
|
||||
|
||||
We have prepared instructions for flashing InfiniTime with Gadgetbridge and NRFConnect.
|
||||
|
||||
- [Updating with Gadgetbridge](/doc/gettingStarted/ota-gadgetbridge.md)
|
||||
- [Updating with NRFConnect](/doc/gettingStarted/ota-nrfconnect.md)
|
||||
|
||||
## Firmware validation
|
||||
|
||||
Firmware updates must be manually validated. If the firmware isn't validated and the watch resets, the watch will revert to the previous firmware. This is a safety feature to prevent bricking your device with faulty firmware.
|
||||
|
||||
You can validate your updated firmware on InfiniTime >= 1.0 by following this simple procedure:
|
||||
|
||||
- From the watchface, swipe **right** to display the *quick settings menu*
|
||||
- Open settings by tapping the cogwheel on the bottom right
|
||||
- Swipe up until you find an entry named **Firmware** and tap on it
|
||||
- If the firmware is not validated yet, you can either validate the running firmware, or reset and revert to the previous firmware version
|
Before Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 55 KiB |
@ -1,12 +1,12 @@
|
||||
# OpenOCD and STLink
|
||||
OpenOCD (**Open O**n **C**hip **D**ebugger) is an open source tool that interfaces with many SWD/JTAG debugger to provide debugging and *in-system* programming for embedded target devices.
|
||||
|
||||
It supports the **NRF52** (the CPU of the PineTime) and the **STLinkV2**, a cheap SWD debugger.
|
||||
OpenOCD supports the **NRF52** (the CPU of the PineTime) and the **STLinkV2**, a cheap SWD debugger.
|
||||
|
||||
It works on X86 computers, as well as ARM/ARM64 computers and SBC (like the RaspberryPi and Pine64 Pinebook Pro) !
|
||||
OpenOCD works on X86 computers, ARM/ARM64 computers, and SBCs (like the RaspberryPi and Pine64 Pinebook Pro)!
|
||||
|
||||
## Installation
|
||||
We will build OpenOCD from sources, as packages from Linux distributions are most of the time outdated and do not support the NRF52 correctly.
|
||||
We will build OpenOCD from sources, as packages from Linux distributions are most of the time outdated and do not support the NRF52 properly.
|
||||
|
||||
- Fetch the sources from GIT, and build and install it:
|
||||
|
||||
@ -27,7 +27,7 @@ sudo cp contrib/60-openocd.rules /etc/udev/rules.d/
|
||||
sudo udevadm control --reload-rules
|
||||
```
|
||||
|
||||
- You can now plug your STLinkV2 in a USB port and run OpenOCD to see if it's working correctly:
|
||||
- You can now plug your STLinkV2 into a USB port and run OpenOCD to see if it's working correctly:
|
||||
|
||||
```
|
||||
$ openocd -f interface/stlink.cfg -f target/nrf52.cfg
|
||||
@ -63,7 +63,7 @@ gdb_breakpoint_override hard
|
||||
|
||||
source [find target/nrf52.cfg]
|
||||
```
|
||||
This file specifies to OpenOCD which debugger and target it will be connected to..
|
||||
This file specifies to OpenOCD which debugger and target it will be connected to.
|
||||
|
||||
Then, we use various *user files* to use OpenOCD to flash InfiniTime binary files.
|
||||
|
||||
|
@ -4,13 +4,11 @@
|
||||
- Buttons should generally be at least 50px high
|
||||
- Buttons should generally be on the bottom edge
|
||||
- Make interactable objects **big**
|
||||
- Recommendations for inner padding, aka distance between buttons:
|
||||
- When aligning 4 objects: 4px, e.g. Settings
|
||||
- When aligning 3 objects: 6px, e.g. App list
|
||||
- When aligning 2 objects: 10px, e.g. Quick settings
|
||||
- When using a page indicator, leave 8px for it on the right side
|
||||
- It is acceptable to leave 8px on the left side as well to center the content
|
||||
- Top bar takes at least 20px + padding
|
||||
- Top bar right icons move 8px to the left when using a page indicator
|
||||
- A black background helps to hide the screen border, allowing the UI to look less cramped when utilizing the entire display area.
|
||||
- A switch should be twice as wide as it is tall.
|
||||
|
||||
![example layouts](./ui/example.png)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Versioning
|
||||
The versioning of this project is based on [Semantic versionning](https://semver.org/) :
|
||||
The versioning of this project is based on [Semantic versioning](https://semver.org/):
|
||||
|
||||
- The **patch** is incremented when we fix a bug on a **released** version (most of the time using a **hotfix** branch).
|
||||
- The **minor** is incremented when we release a new version with new features. It corresponds to a merge of **develop** into **master**.
|
||||
- The **major** should be incremented when a breaking change is made to the application. We still have to define what is a breaking change in the context of this project. For now, I suggest that it stays **0** until we have a fully functioning firmware suited for the final user.
|
||||
- The **patch** is incremented when a bug is fixed on a **released** version (most of the time using a **hotfix** branch).
|
||||
- The **minor** is incremented when a new version with new features is released. It corresponds to a merge of **develop** into **master**.
|
||||
- The **major** should be incremented when a breaking change is made to the application. We still have to define what is a breaking change in the context of this project.
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM ubuntu:18.04
|
||||
FROM ubuntu:22.04
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update -qq \
|
||||
@ -11,21 +11,27 @@ RUN apt-get update -qq \
|
||||
make \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python-is-python3 \
|
||||
tar \
|
||||
unzip \
|
||||
wget \
|
||||
# aarch64 packages
|
||||
wget \
|
||||
curl \
|
||||
# aarch64 packages
|
||||
libffi-dev \
|
||||
libssl-dev \
|
||||
python3-dev \
|
||||
python \
|
||||
git \
|
||||
apt-utils \
|
||||
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/*;
|
||||
|
||||
# Git needed for PROJECT_GIT_COMMIT_HASH variable setting
|
||||
|
||||
RUN pip3 install adafruit-nrfutil
|
||||
RUN pip3 install -Iv cryptography==3.3
|
||||
RUN pip3 install cbor
|
||||
RUN npm i lv_font_conv@1.5.2 -g
|
||||
|
||||
# build.sh knows how to compile
|
||||
COPY build.sh /opt/
|
||||
@ -38,10 +44,5 @@ RUN bash -c "source /opt/build.sh; GetNrfSdk;"
|
||||
# McuBoot
|
||||
RUN bash -c "source /opt/build.sh; GetMcuBoot;"
|
||||
|
||||
ARG PUID=1000
|
||||
ARG PGID=1000
|
||||
RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime
|
||||
|
||||
USER infinitime:infinitime
|
||||
ENV SOURCES_DIR /sources
|
||||
CMD ["/opt/build.sh"]
|
||||
|
@ -9,21 +9,23 @@ set -e
|
||||
export TOOLS_DIR="${TOOLS_DIR:=/opt}"
|
||||
export SOURCES_DIR="${SOURCES_DIR:=/sources}"
|
||||
export BUILD_DIR="${BUILD_DIR:=$SOURCES_DIR/build}"
|
||||
export OUTPUT_DIR="${OUTPUT_DIR:=$BUILD_DIR/output}"
|
||||
export OUTPUT_DIR="${OUTPUT_DIR:=$SOURCES_DIR/build/output}"
|
||||
|
||||
export BUILD_TYPE=${BUILD_TYPE:=Release}
|
||||
export GCC_ARM_VER=${GCC_ARM_VER:="gcc-arm-none-eabi-9-2020-q2-update"}
|
||||
export GCC_ARM_VER=${GCC_ARM_VER:="11.2-2022.02"}
|
||||
export NRF_SDK_VER=${NRF_SDK_VER:="nRF5_SDK_15.3.0_59ac345"}
|
||||
|
||||
MACHINE="$(uname -m)"
|
||||
[[ "$MACHINE" == "arm64" ]] && MACHINE="aarch64"
|
||||
|
||||
export GCC_ARM_PATH="gcc-arm-$GCC_ARM_VER-$MACHINE-arm-none-eabi"
|
||||
|
||||
main() {
|
||||
local target="$1"
|
||||
|
||||
mkdir -p "$TOOLS_DIR"
|
||||
|
||||
[[ ! -d "$TOOLS_DIR/$GCC_ARM_VER" ]] && GetGcc
|
||||
|
||||
[[ ! -d "$TOOLS_DIR/$GCC_ARM_PATH" ]] && GetGcc
|
||||
[[ ! -d "$TOOLS_DIR/$NRF_SDK_VER" ]] && GetNrfSdk
|
||||
[[ ! -d "$TOOLS_DIR/mcuboot" ]] && GetMcuBoot
|
||||
|
||||
@ -31,15 +33,14 @@ main() {
|
||||
|
||||
CmakeGenerate
|
||||
CmakeBuild $target
|
||||
BUILD_RESULT=$?
|
||||
BUILD_RESULT=$?
|
||||
if [ "$DISABLE_POSTBUILD" != "true" -a "$BUILD_RESULT" == 0 ]; then
|
||||
source "$BUILD_DIR/post_build.sh"
|
||||
fi
|
||||
}
|
||||
|
||||
GetGcc() {
|
||||
GCC_SRC="$GCC_ARM_VER-$MACHINE-linux.tar.bz"
|
||||
wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/$GCC_SRC -O - | tar -xj -C $TOOLS_DIR/
|
||||
wget -q https://developer.arm.com/-/media/Files/downloads/gnu/$GCC_ARM_VER/binrel/$GCC_ARM_PATH.tar.xz -O - | tar -xJ -C $TOOLS_DIR/
|
||||
}
|
||||
|
||||
GetMcuBoot() {
|
||||
@ -54,18 +55,14 @@ GetNrfSdk() {
|
||||
}
|
||||
|
||||
CmakeGenerate() {
|
||||
# We can swap the CD and trailing SOURCES_DIR for -B and -S respectively
|
||||
# once we go to newer CMake (Ubuntu 18.10 gives us CMake 3.10)
|
||||
cd "$BUILD_DIR"
|
||||
|
||||
cmake -G "Unix Makefiles" \
|
||||
-S "$SOURCES_DIR" \
|
||||
-B "$BUILD_DIR" \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DUSE_OPENOCD=1 \
|
||||
-DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_VER" \
|
||||
-DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_PATH" \
|
||||
-DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \
|
||||
-DBUILD_DFU=1 \
|
||||
"$SOURCES_DIR"
|
||||
cmake -L -N .
|
||||
-DBUILD_DFU=1
|
||||
}
|
||||
|
||||
CmakeBuild() {
|
||||
@ -76,4 +73,4 @@ CmakeBuild() {
|
||||
fi
|
||||
}
|
||||
|
||||
[[ $SOURCED == "false" ]] && main "$@" || echo "Sourced!"
|
||||
[[ $SOURCED == "false" ]] && main "$@" || echo "Sourced!"
|
||||
|
@ -15,12 +15,10 @@ cp "$BUILD_DIR/src/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/p
|
||||
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin"
|
||||
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip"
|
||||
|
||||
|
||||
mkdir -p "$OUTPUT_DIR/src"
|
||||
cd "$BUILD_DIR"
|
||||
cp src/*.bin "$OUTPUT_DIR/src"
|
||||
cp src/*.hex "$OUTPUT_DIR/src"
|
||||
cp src/*.out "$OUTPUT_DIR/src"
|
||||
cp src/*.map "$OUTPUT_DIR/src"
|
||||
cp $BUILD_DIR/src/*.bin "$OUTPUT_DIR/src/"
|
||||
cp $BUILD_DIR/src/*.hex "$OUTPUT_DIR/src/"
|
||||
cp $BUILD_DIR/src/*.out "$OUTPUT_DIR/src/"
|
||||
cp $BUILD_DIR/src/*.map "$OUTPUT_DIR/src/"
|
||||
|
||||
ls -RUv1 "$OUTPUT_DIR" | sed 's;^\([^/]\); \1;g'
|
@ -1,264 +0,0 @@
|
||||
# Build, flash and debug
|
||||
## Project branches
|
||||
## Versioning
|
||||
## Files included in the release notes
|
||||
## Build the project
|
||||
### Dependencies
|
||||
To build this project, you'll need:
|
||||
|
||||
- A cross-compiler : [ARM-GCC (9-2020-q2-update)](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads/9-2020-q2-update)
|
||||
- The NRF52 SDK 15.3.0 : [nRF-SDK v15.3.0](https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip)
|
||||
- The Python 3 modules `cbor`, `intelhex`, `click` and `cryptography` modules for the `mcuboot` tool (see [requirements.txt](../tools/mcuboot/requirements.txt))
|
||||
- To keep the system clean, you can install python modules into a python virtual environment (`venv`)
|
||||
|
||||
```
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install wheel
|
||||
python -m pip install -r tools/mcuboot/requirements.txt
|
||||
```
|
||||
|
||||
- A reasonably recent version of CMake (I use 3.16.5)
|
||||
|
||||
Note that you do not need to install those dependencies on your system if you use Docker to build the project.
|
||||
|
||||
### Using the command line
|
||||
|
||||
#### Build steps
|
||||
##### Clone the repo
|
||||
Clone the repo and update the submodules:
|
||||
|
||||
```
|
||||
git clone https://github.com/InfiniTimeOrg/InfiniTime.git
|
||||
cd InfiniTime
|
||||
git submodule update --init
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
|
||||
##### Generate the project with CMake
|
||||
Run CMake to generate the project. Here's the default command line
|
||||
```
|
||||
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=/path/to/the/toolchain -DNRF5_SDK_PATH=/path/to/the/sdk ..
|
||||
```
|
||||
|
||||
You can specify a few more options:
|
||||
|
||||
- `-DCMAKE_BUILD_TYPE` : specify the build type (`Release` or `Debug`). The `Release` mode is selected by default. It enables various optimizations from the compiler to reduce the binary size and increase perfromances. `Debug` mode does not enable those optimizations. It makes the binary easier to debug but it'll run slower and the binary file will be bigger.
|
||||
- `-DBUILD_DFU` : enables (`1`) or disables (`0`) the generation of the DFU file (needed for this OTA udate). Note that this option needs [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) installed on your system.
|
||||
|
||||
#### Build
|
||||
Run make to build the project:
|
||||
|
||||
```
|
||||
make -j
|
||||
```
|
||||
|
||||
This command will build all the targets of the project (see below). You can also specify a specific target you want to build:
|
||||
|
||||
```
|
||||
make -j pinetime-mcuboot-app
|
||||
```
|
||||
|
||||
Here's the list of CMake targets:
|
||||
|
||||
- pinetime-app
|
||||
- pinetime-mcuboot-app
|
||||
- pinetime-recovery
|
||||
- pinetime-mcuboot-recovery
|
||||
- pinetime-recovery-loader
|
||||
- pinetime-mcuboot-recovery-loader
|
||||
|
||||
Binary files are generated in the `src/` subfolder.
|
||||
|
||||
These files are named with various extensions:
|
||||
|
||||
- **.bin** files are binary files corresponding to the firmware. These files are intended to be ran by the MCU of the PineTime.
|
||||
- **.hex** files are binary files formatted in the [Intel HEX format](https://en.wikipedia.org/wiki/Intel_HEX).
|
||||
- **.map** files contains the [memory mapping generated by the compiler](https://en.wikipedia.org/wiki/MAP_(file_format)). Useful to understand the memory usage and mapping of the firmware.
|
||||
- **.out** files are intended to be used by a debugger (GDB) to debug the firmware running on the PineTime
|
||||
|
||||
You'll find various files named according to their respective `cmake target`:
|
||||
|
||||
- **pinetime-app** : The standalone version of the firmware. This firmware must be flashed at offset 0x00 and runs without the bootloader. You can use this binary to debug (using a SWD debugger) the firmware faster and more easily as it doesn't rely on the bootloader.
|
||||
- **pinetime-mcuboot-app** : The firmware with support for the bootloader. The file `pinetime-mcuboot-app-x.y.z.bin` must be converted into an *MCUBoot* image for the bootloader to be able to run it. This image is named pinetime-mcuboot-app-image-x-y-z.bin and it can be flashed at offset **0x8000**. A DFU file for the OTA update is also generated (if the option BUILD_DFU was enabled during `cmake` generation) : pinetime-mcuboot-app-dfu-x.y.z.zip.
|
||||
- **pinetime-recovery** is the recovery firmware (standalone).
|
||||
- **pinetime-mcuboot-recovery** is the bootloader variant of the recovery firmware. The MCUBoot image (pinetime-mcuboot-recovery-image) and the DFU file (pinetime-mcboot-recovery-dfu) are also generated.
|
||||
- **pinetime-recovery-loader** is a firmware that updates the bootloader of the PineTime. Use this firmware with caution as it erases and overwrites the bootloader of your PineTime. There's no fallback in case of issue during this operation. The MCUBoot image and DFU file are also generated.
|
||||
|
||||
Most of the time, you'll only need the file `pinetime-mcuboot-app-image` to update the firmware using a SWD debugger or the file `pinetime=-mcuboot-app-dfu` to update it over the air using a BLE device.
|
||||
|
||||
See below for more info on flashing and upgrading your firmware on your PineTime.
|
||||
|
||||
### Using docker
|
||||
|
||||
A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures. These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed.
|
||||
|
||||
Based on Ubuntu 18.04 with the following build dependencies:
|
||||
|
||||
* ARM GCC Toolchain
|
||||
* nRF SDK
|
||||
* MCUBoot
|
||||
* adafruit-nrfutil
|
||||
|
||||
#### Run a container to build the project
|
||||
|
||||
The `infinitime-build` image contains all the dependencies you need. The default `CMD` will compile sources found in `/sources`, so you need only mount your code.
|
||||
|
||||
Before continuing, make sure you first build the image as indicated in the [Build the image](#build-the-image) section, or check the [Using the image from Docker Hub](#using-the-image-from-docker-hub) section if you prefer to use a pre-made image.
|
||||
|
||||
This example will build the firmware, generate the MCUBoot image and generate the DFU file. For cloning the repo, see [these instructions](../doc/buildAndProgram.md#clone-the-repo). Outputs will be written to **<project_root>/build/output**:
|
||||
|
||||
```bash
|
||||
cd <project_root> # e.g. cd ./work/Pinetime
|
||||
docker run --rm -it -v $(pwd):/sources infinitime-build
|
||||
```
|
||||
|
||||
If you only want to build a single CMake target, you can pass it in as the first parameter to the build script. This means calling the script explicitly as it will override the `CMD`. Here's an example For `pinetime-app`:
|
||||
|
||||
```bash
|
||||
docker run --rm -it -v $(pwd):/sources infinitime-build /opt/build.sh pinetime-app
|
||||
```
|
||||
|
||||
The image is built using 1000:1000 for the user id and group id. If this is different to your user or group ids (run `id -u` and `id -g` to find out what your id values are if you are unsure), you will need to override them via the `--user` parameter in order to prevent permission errors with the output files (and the cmake build cache).
|
||||
|
||||
Running with this image is the same as above, you just specify the ids to `docker run`:
|
||||
|
||||
```bash
|
||||
docker run --rm -it -v $(pwd):/sources --user $(id -u):$(id -g) infinitime-build
|
||||
```
|
||||
|
||||
Or you can specify your user id and group id (by number, not by name) directly:
|
||||
|
||||
```bash
|
||||
docker run --rm -it -v $(pwd):/sources --user 1234:1234 infinitime-build
|
||||
```
|
||||
|
||||
#### Using the image from Docker Hub
|
||||
|
||||
**NOTE** : This image is provided by a contributor and might not be up-to-date.
|
||||
|
||||
The image is available via Docker Hub for both the amd64 and arm64v8 architectures at [pfeerick/infinitime-build](https://hub.docker.com/r/pfeerick/infinitime-build).
|
||||
|
||||
It can be pulled (downloaded) using the following command:
|
||||
|
||||
```bash
|
||||
docker pull pfeerick/infinitime-build
|
||||
```
|
||||
|
||||
The default `latest` tag *should* automatically identify the correct image architecture, but if for some reason Docker does not, you can specify it manually:
|
||||
|
||||
* For AMD64 (x86_64) systems: `docker pull pfeerick/infinitime-build:amd64`
|
||||
|
||||
* For ARM64v8 (ARM64/aarch64) systems: `docker pull pfeerick/infinitime-build:arm64v8`
|
||||
|
||||
#### Build the image
|
||||
|
||||
You can build the image yourself if you like!
|
||||
|
||||
The following commands must be run from the root of the project. This operation will take some time but, when done, a new image named *infinitime-build* is available.
|
||||
|
||||
```bash
|
||||
docker image build -t infinitime-build ./docker
|
||||
```
|
||||
|
||||
The `PUID` and `PGID` build arguments are used to set the user and group ids used in the container, meaning you will not need to specify it later unless they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make the command you need to run later a bit shorter. In the below examples, they are set to your current user id and group id automatically. You can specify them manually, but they must be specified by number, not by name.
|
||||
|
||||
```bash
|
||||
docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) ./docker
|
||||
```
|
||||
|
||||
### Using VSCode
|
||||
|
||||
The .VS Code folder contains configuration files for developing InfiniTime with VS Code. Effort was made to have these rely on Environment variables instead of hardcoded paths.
|
||||
|
||||
At the moment building using VSCode on Windows has not been done yet. Using the [devcontainer](#vs-codedocker-devcontainer) is probably the easiest way.
|
||||
#### Environment Setup
|
||||
|
||||
|
||||
To support as many setups as possible the VS Code configuration files expect there to be certain environment variables to be set.
|
||||
|
||||
Variable | Description | Example
|
||||
----------|-------------|--------
|
||||
**ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`export ARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update`
|
||||
**NRF5_SDK_PATH**|path to the NRF52 SDK|`export NRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345`
|
||||
|
||||
#### VS Code Extensions
|
||||
|
||||
We leverage a few VS Code extensions for ease of development.
|
||||
|
||||
###### Required Extensions
|
||||
|
||||
- [C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) - C/C++ IntelliSense, debugging, and code browsing.
|
||||
- [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) - Extended CMake support in Visual Studio Code
|
||||
|
||||
###### Optional Extensions
|
||||
|
||||
[Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) - ARM Cortex-M GDB Debugger support for VS Code
|
||||
|
||||
Cortex-Debug is only required for interactive debugging using VS Codes built in GDB support.
|
||||
|
||||
|
||||
|
||||
#### VS Code/Docker DevContainer
|
||||
|
||||
The .devcontainer folder contains the configuration and scripts for using a Docker dev container for building InfiniTime
|
||||
|
||||
Using the [Remote-Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension is recommended. It will handle configuring the Docker virtual machine and setting everything up.
|
||||
|
||||
More documentation is available in the [readme in .devcontainer](.devcontainer/readme.md)
|
||||
|
||||
##### DevContainer on Ubuntu
|
||||
To use the DevContainer configuration on Ubuntu based systems two changes need to be made:
|
||||
|
||||
1. Modify the file ``.devcontainer/devcontainer.json`` and add the argument ``"--net=host"`` to the ``"runArgs"`` parameter making the line look like this:
|
||||
`` "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", "--net=host"],
|
||||
``
|
||||
2. Modify the file ``.vscode/launch.json`` and change the argument of ``"gdbTarget"`` to ``"127.0.0.1:3333"``, making the line look like:
|
||||
``"gdbTarget": "127.0.0.1:3333",``
|
||||
3. To start debugging launch openocd on your host system with the appropriate configuration, for example with a stlink-v2 the command is:
|
||||
``openocd -f interface/stlink.cfg -f target/nrf52.cfg``. This launches openocd with the default ports ``3333``, ``4444`` and ``6666``.
|
||||
4. In VsCode go to the Debug pane on the left of the screen and select the configuration ``Debug - Openocd docker Remote`` and hit the play button on the left.
|
||||
|
||||
##### Dev Container on Windows
|
||||
|
||||
To use the DevContainer configuration on Windows a few files need their line endings changed, e.g. by using [notepad++](https://notepad-plus-plus.org/)
|
||||
|
||||
```
|
||||
\InfiniTime\tools\mcuboot\imgtool.py
|
||||
\InfiniTime\tools\mcuboot\imgtool_init_.py
|
||||
\InfiniTime\tools\mcuboot\imgtool\boot_record.py
|
||||
\InfiniTime\tools\mcuboot\imgtool\image.py
|
||||
\InfiniTime\tools\mcuboot\imgtool\version.py
|
||||
```
|
||||
|
||||
You also need to install ```cbor``` with ```pip install cbor``` or by running ```pip install -r requirements.txt``` in ```\Infitime\tools\mcuboot```.
|
||||
|
||||
## Build the documentation
|
||||
### Setup
|
||||
The documentation is written in Markdown (.md) files and generated using the Sphinx documentation generator.
|
||||
|
||||
First, we need to install Sphinx and its dependencies:
|
||||
- `myst-parser` : add support for markdown files
|
||||
- `sphinx_rtd_theme` : theme from ReadTheDocs
|
||||
```
|
||||
pip install sphinx
|
||||
pip install myst-parser
|
||||
pip install sphinx_rtd_theme
|
||||
```
|
||||
|
||||
### Build the doc
|
||||
Run the following command in the folder `docs`
|
||||
```
|
||||
sphinx-build -b html ./ ./generated
|
||||
```
|
||||
|
||||
Then display the doc by browsing to `generated/index.html` using your favorite web browser.
|
||||
|
||||
## Flash the firmware using OpenOCD and STLinkV2
|
||||
## Build the project with Docker
|
||||
## Build the project with VSCode
|
||||
## Bootloader, OTA and DFU
|
||||
## Stub using NRF52-DK
|
||||
## Logging with JLink RTT
|
||||
## Using files from the releases
|
39
docs/conf.py
@ -1,39 +0,0 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
|
||||
# -- Project information
|
||||
|
||||
project = 'InfiniTime'
|
||||
copyright = '2021, InfiniTime'
|
||||
author = 'InfiniTime'
|
||||
|
||||
release = '1.7'
|
||||
version = '1.7.1'
|
||||
|
||||
# -- General configuration
|
||||
|
||||
extensions = [
|
||||
'sphinx.ext.duration',
|
||||
'sphinx.ext.doctest',
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.autosummary',
|
||||
'sphinx.ext.intersphinx',
|
||||
'myst_parser',
|
||||
]
|
||||
|
||||
source_suffix = ['.md']
|
||||
|
||||
intersphinx_mapping = {
|
||||
'python': ('https://docs.python.org/3/', None),
|
||||
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
|
||||
}
|
||||
intersphinx_disabled_domains = ['std']
|
||||
|
||||
templates_path = ['_templates']
|
||||
|
||||
# -- Options for HTML output
|
||||
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
|
||||
# -- Options for EPUB output
|
||||
epub_show_urls = 'footnote'
|
||||
|
@ -1,24 +0,0 @@
|
||||
# Credits
|
||||
|
||||
Many people work on InfiniTime, creating PR, submitting bugs and issues, ...
|
||||
There is also the whole #Pinetime community : a lot of people all
|
||||
around the world who are hacking, searching, experimenting and programming the
|
||||
Pinetime. We exchange our ideas, experiments and code in the chat rooms and
|
||||
forums.
|
||||
|
||||
Here are some people we would like to highlight:
|
||||
|
||||
- [Atc1441](https://github.com/atc1441/) : He works on an Arduino based
|
||||
firmware for the Pinetime and many other smartwatches based on similar
|
||||
hardware. He was of great help when JF was implementing support for the BMA421
|
||||
motion sensor and I²C driver.
|
||||
- [Koen](https://github.com/bosmoment) : He’s working on a firmware based on
|
||||
RiotOS. He integrated similar libs as me : NimBLE, LittleVGL,… His help was
|
||||
invaluable too!
|
||||
- [Lup Yuen Lee](https://github.com/lupyuen) : He is everywhere: he works on a
|
||||
Rust firmware, builds a MCUBoot based bootloader for the Pinetime, designs a
|
||||
Flutter based companion app for smartphones and writes a lot of articles
|
||||
about the Pinetime!
|
||||
|
||||
*If you feel like you should appear on this list, just get in touch with us or submit a PR :)*
|
||||
|
Before Width: | Height: | Size: 110 KiB |
@ -1,270 +0,0 @@
|
||||
# Developer documentation
|
||||
|
||||
## Global architecture
|
||||
|
||||
![Project structure](architecture.png)
|
||||
|
||||
The project is composed of multiple layers:
|
||||
|
||||
### The low level layer
|
||||
The low level layer is composed of mostly hardware dependent software modules : startup code, low level drivers for clocks, busses, peripherals,...
|
||||
Most of these modules are provided by the NRF SDK, but some drivers (I2C and SPI, for example) were reimplemented to better fit the needs of the project.
|
||||
|
||||
### The abtraction layer
|
||||
The abstraction layer is composed of components and controllers that abtracts the hardware from the upper layers while providing higher level APIs and services for these layers.
|
||||
|
||||
Those [controllers](https://github.com/InfiniTimeOrg/InfiniTime/tree/develop/src/components) are, among others:
|
||||
- The [**battery controller**](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/components/battery/BatteryController.h) that handles the battery level measurements and conversion
|
||||
- The [**file system**](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/components/fs/FS.h) that allows the application to easily read and write data to the flash memory
|
||||
- The [**motion controller**](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/components/motion/MotionController.h) that provides motion and step information from the motion sensor
|
||||
- and many others...
|
||||
|
||||
### The system layer
|
||||
The system layer is composed of the RTOS (FreeRTOS) and the tasks needed for the firmware to run properly. These tasks are mainly the System task and the display task. This layer also implements a message passing mecanism (based on message queues) that allows tasks to exchange messages and events.
|
||||
|
||||
#### FreeRTOS
|
||||
InfiniTime is based on [FreeRTOS](https://www.freertos.org), a real-time operating system. FreeRTOS provides several quality of life abstractions (for example easy software timers) and most importantly supports multiple tasks. If you want to read up on real-time operating systems, you can look
|
||||
[here](https://www.freertos.org/implementation/a00002.html) and [here](https://www.freertos.org/features.html). The main "process" (the function `main()`)creates at least one task and then starts the FreeRTOS task scheduler. The task scheduler is responsible for giving every task enough cpu time. As
|
||||
there is only one core on the SoC of the PineTime, real concurrency is impossible and the scheduler has to swap tasks in and out to emulate it.
|
||||
|
||||
#### Tasks
|
||||
Tasks are created by calling `xTaskCreate()` and passing a function with the signature `void functionName(void*)`. For more info on task creation see the [FreeRTOS Documentation](https://www.freertos.org/a00125.html).
|
||||
|
||||
**System task** is the main task of the project. It's responsible for initializing all devices and peripheral at startup, for managing and routing events between the tasks and the controllers, for managing the wake and sleep mode, for responding to external events (button press, touch even),...
|
||||
It's implement in the class [`PineTime::System::SystemTask`](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/systemtask/SystemTask.h). It provides 2 main methods: `SystemTask::Start()` that starts the task, and `SystemTask::Work()` which is the method the task executes. It starts by initializing all device and peripherals and then enters into its main loop.
|
||||
|
||||
**Display task** is implemented in the class [`PineTime::Applications::DisplayApp`](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/displayapp/DisplayApp.h). Similarly to **System task**, it provides the methods `Start()` and `Work()`. Display task handles the whole UI : it responds to touch and button events, it switches between apps, refresh the UI according to user interactions,...
|
||||
|
||||
The [BLE stack (NimBLE)](https://github.com/apache/mynewt-nimble) creates [2 other tasks (**ll** and **ble**)](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c) to handle the whole BLE processing.
|
||||
|
||||
An additional task handles the signal processing for the heart rate monitor : [`PineTime::Applications::HeartRateTask`](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/heartratetask/HeartRateTask.h).
|
||||
|
||||
### The application layer
|
||||
The **application layer** implements the applications visible to the user (watch faces, settings, music application, games,...).
|
||||
|
||||
The UI is based on the [*Light and versatile graphics library (LVGL)*](https://lvgl.io/).
|
||||
|
||||
## Bluetooth
|
||||
|
||||
Header files with short documentation for the functions are inside
|
||||
[libs/mynewt-nimble/nimble/host/include/host/](/src/libs/mynewt-nimble/nimble/host/include/host/).
|
||||
|
||||
## How to implement an app
|
||||
|
||||
### Theory
|
||||
|
||||
The user interface of InfiniTime is made up of **screens**.
|
||||
Screens that are opened from the app launcher are considered **apps**.
|
||||
Every app in InfiniTime is it's own class.
|
||||
An instance of the class is created when the app is launched and destroyed when
|
||||
the user exits the app.
|
||||
They run inside the "displayapp" task (briefly discussed [here](./Intro.md)).
|
||||
Apps are responsible for everything drawn on the screen when they are running.
|
||||
By default, apps only do something (as in a function is executed) when they are
|
||||
created or when a touch event is detected.
|
||||
|
||||
### Interface
|
||||
|
||||
Every app class has to be inside the namespace `Pinetime::Applications::Screens`
|
||||
and inherit from `Screen`.
|
||||
The constructor should have at least one parameter `DisplayApp* app`, which it
|
||||
needs for the constructor of its parent class Screen.
|
||||
Other parameters should be references to controllers that the app needs.
|
||||
A destructor is needed to clean up LVGL and restore any changes (for example
|
||||
re-enable sleeping).
|
||||
App classes can override `bool OnButtonPushed()`, `bool OnTouchEvent(TouchEvents
|
||||
event)` and `bool OnTouchEvent(uint16_t x, uint16_t y)` to implement their own
|
||||
functionality for those events.
|
||||
If an app only needs to display some text and do something upon a touch screen
|
||||
button press,
|
||||
it does not need to override any of these functions, as LVGL can also handle
|
||||
touch events for you.
|
||||
If you have any doubts, you can always look at how the other apps are doing
|
||||
things.
|
||||
|
||||
#### Continuous updating
|
||||
|
||||
If your app needs to be updated continuously, you can do so by overriding the
|
||||
`Refresh()` function in your class and calling `lv_task_create` inside the
|
||||
constructor.
|
||||
|
||||
An example call could look like this:
|
||||
```cpp
|
||||
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
|
||||
```
|
||||
|
||||
With `taskRefresh` being a member variable of your class and of type
|
||||
`lv_task_t*`.
|
||||
Remember to delete the task again using `lv_task_del`.
|
||||
The function `RefreshTaskCallback` is inherited from `Screen` and just calls
|
||||
your `Refresh` function.
|
||||
|
||||
### Creating your own app
|
||||
|
||||
A minimal app could look like this:
|
||||
|
||||
MyApp.h:
|
||||
```cpp
|
||||
#pragma once
|
||||
|
||||
#include "displayapp/screens/Screen.h"
|
||||
#include <lvgl/lvgl.h>
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Applications {
|
||||
namespace Screens {
|
||||
class MyApp : public Screen {
|
||||
public:
|
||||
MyApp(DisplayApp* app);
|
||||
~MyApp() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
MyApp.cpp:
|
||||
```cpp
|
||||
#include "displayapp/screens/MyApp.h"
|
||||
#include "displayapp/DisplayApp.h"
|
||||
|
||||
using namespace Pinetime::Applications::Screens;
|
||||
|
||||
MyApp::MyApp(DisplayApp* app) : Screen(app) {
|
||||
lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr);
|
||||
lv_label_set_text_static(title, "My test application");
|
||||
lv_label_set_align(title, LV_LABEL_ALIGN_CENTER);
|
||||
lv_obj_align(title, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
MyApp::~MyApp() {
|
||||
lv_obj_clean(lv_scr_act());
|
||||
}
|
||||
```
|
||||
|
||||
Both of these files should be in [displayapp/screens/](/src/displayapp/screens/)
|
||||
or [displayapp/screens/settings/](/src/displayapp/screens/settings/) if it's a
|
||||
setting app.
|
||||
|
||||
Now we have our very own app, but InfiniTime does not know about it yet.
|
||||
The first step is to include your MyApp.cpp (or any new cpp files for that
|
||||
matter)
|
||||
in the compilation by adding it to [CMakeLists.txt](/CMakeLists.txt).
|
||||
The next step to making it launchable is to give your app an id.
|
||||
To do this, add an entry in the enum class `Pinetime::Applications::Apps`
|
||||
([displayapp/Apps.h](/src/displayapp/Apps.h)).
|
||||
Name this entry after your app. Add `#include "displayapp/screens/MyApp.h"` to
|
||||
the file [displayapp/DisplayApp.cpp](/src/displayapp/DisplayApp.cpp).
|
||||
Now, go to the function `DisplayApp::LoadApp` and add another case to the switch
|
||||
statement.
|
||||
The case will be the id you gave your app earlier.
|
||||
If your app needs any additional arguments, this is the place to pass them.
|
||||
|
||||
If you want to add your app in the app launcher, add your app in
|
||||
[displayapp/screens/ApplicationList.cpp](/src/displayapp/screens/ApplicationList.cpp)
|
||||
to one of the `CreateScreen` functions, or add another `CreateScreen` function
|
||||
if there are no empty spaces for your app. If your app is a setting, do the same
|
||||
procedure in
|
||||
[displayapp/screens/settings/Settings.cpp](/src/displayapp/screens/settings/Settings.cpp).
|
||||
|
||||
You should now be able to [build](../buildAndProgram.md) the firmware
|
||||
and flash it to your PineTime. Yay!
|
||||
|
||||
Please remember to pay attention to the [UI guidelines](../ui_guidelines.md)
|
||||
when designing an app that you want to be included in InfiniTime.
|
||||
|
||||
## Generating the fonts and symbols
|
||||
|
||||
You can download fonts using the links below:
|
||||
|
||||
* [Jetbrains Mono](https://www.jetbrains.com/fr-fr/lp/mono/)
|
||||
* [Awesome font from LVGL](https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff)
|
||||
* [Open Sans Light from Google](https://fonts.google.com/specimen/Open+Sans)
|
||||
|
||||
### Generate the fonts:
|
||||
|
||||
* Open the [LVGL font converter](https://lvgl.io/tools/fontconverter)
|
||||
* Name : jetbrains_mono_bold_20
|
||||
* Size : 20
|
||||
* Bpp : 1 bit-per-pixel
|
||||
* Do not enable font compression and horizontal subpixel hinting
|
||||
* Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x20-0x7f, 0x410-0x44f`
|
||||
* Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following
|
||||
range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015`
|
||||
* Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts`
|
||||
* Add the font .c file path to src/CMakeLists.txt
|
||||
* Add an LV_FONT_DECLARE line in src/libs/lv_conf.h
|
||||
|
||||
Add new symbols:
|
||||
|
||||
* Browse the [cheatsheet](https://fontawesome.com/cheatsheet/free/solid) and find your new symbols
|
||||
* For each symbol, add its hex code (0xf641 for the 'Ad' icon, for example) to the *Range* list (Remember to keep this
|
||||
readme updated with newest range list)
|
||||
* Convert this hex value into a UTF-8 code
|
||||
using [this site](http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=f185&mode=hex)
|
||||
* Define the new symbols in `src/displayapp/screens/Symbols.h`:
|
||||
|
||||
```
|
||||
static constexpr const char* newSymbol = "\xEF\x86\x85";
|
||||
```
|
||||
|
||||
### Simple method to generate a font
|
||||
|
||||
If you want to generate a basic font containing only numbers and letters, you
|
||||
can use the above settings but instead of specifying a range, simply list the
|
||||
characters you need in the Symbols field and leave the range blank. This is the
|
||||
approach used for the PineTimeStyle watchface.
|
||||
This works well for fonts which will only be used to display numbers, but will
|
||||
fail if you try to add a colon or other punctuation.
|
||||
|
||||
* Open the [LVGL font converter](https://lvgl.io/tools/fontconverter)
|
||||
* Name : open_sans_light
|
||||
* Size : 150
|
||||
* Bpp : 1 bit-per-pixel
|
||||
* Do not enable font compression and horizontal subpixel hinting
|
||||
* Load the file `open_sans_light.tff` (use the file in this repo to ensure the
|
||||
version matches) and specify the following symbols : `0123456789`
|
||||
* Click on Convert, and download the file `open_sans_light.c` and copy it in
|
||||
`src/DisplayApp/Fonts`
|
||||
* Add the font .c file path to src/CMakeLists.txt (search for jetbrains to find
|
||||
the appropriate location/format)
|
||||
* Add an LV_FONT_DECLARE line in src/libs/lv_conf.h (as above)
|
||||
|
||||
#### Navigation font
|
||||
|
||||
To create the navigtion.ttf I use the web app [icomoon](https://icomoon.io/app).
|
||||
This app can import the svg files from the folder
|
||||
*src/displayapp/icons/navigation/unique* and create a ttf file the
|
||||
project for the site is *lv_font_navi_80.json* you can import it to add or
|
||||
remove icons
|
||||
|
||||
You can also use the online LVGL tool to create the .c
|
||||
|
||||
ttf file : navigation.ttf name : lv_font_navi_80 size : 80px Bpp : 2 bit-per-pixel range : 0xe900-0xe929
|
||||
|
||||
$lv_font_conv --font navigation.ttf -r '0xe900-0xe929' --size 80 --format lvgl --bpp 2 --no-prefilter -o
|
||||
lv_font_navi_80.c
|
||||
|
||||
#### I use the method above to create the other ttf
|
||||
|
||||
## Creating a stopwatch in PineTime
|
||||
|
||||
[This article](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html) from
|
||||
Pankaj Raghav describes in details how to create a stopwatch app in InfiniTime.
|
||||
|
||||
## Tips on designing an app UI
|
||||
|
||||
- Align objects all the way to the edge or corner
|
||||
- Buttons should generally be at least 50px high
|
||||
- Buttons should generally be on the bottom edge
|
||||
- Make interactable objects **big**
|
||||
- When using a page indicator, leave 8px for it on the right side
|
||||
- It is acceptable to leave 8px on the left side as well to center the content
|
||||
- Top bar takes at least 20px + padding
|
||||
- Top bar right icons move 8px to the left when using a page indicator
|
||||
- A black background helps to hide the screen border, allowing the UI to look
|
||||
less cramped when utilizing the entire display area.
|
||||
|
||||
(add link to ![example layouts](./ui/example.png))
|
||||
|
||||
## BLE implementation and API
|
@ -1,5 +0,0 @@
|
||||
# Going further
|
||||
* The [PineTime wiki](https://wiki.pine64.org/wiki/PineTime)
|
||||
* InfiniTime resources from other people
|
||||
* Videos
|
||||
* Articles
|
@ -1,108 +0,0 @@
|
||||
# How to contribute
|
||||
|
||||
## Report bugs
|
||||
|
||||
Have you found a bug in the firmware? [Create an issue on
|
||||
Github](https://github.com/InfiniTimeOrg/InfiniTime/issues) explaining the bug,
|
||||
how to reproduce it, the version of the firmware you use...
|
||||
|
||||
## Write and improve documentation
|
||||
|
||||
Documentation might be incomplete, or not clear enough, and it is always
|
||||
possible to improve it with better wording, pictures, photo, video,...
|
||||
|
||||
As the documentation is part of the source code, you can submit your
|
||||
improvements to the documentation by submitting a pull request (see below).
|
||||
|
||||
## Fix bugs, add functionalities and improve the code
|
||||
|
||||
You want to fix a bug, add a cool new functionality or improve the code? See
|
||||
*How to submit a pull request below*.
|
||||
|
||||
# How to submit a pull request?
|
||||
|
||||
## TL;DR
|
||||
|
||||
- Create a branch from develop
|
||||
- Work on a single subject in this branch. Create multiple
|
||||
branches/pulls-requests if you want to work on multiple subjects (bugs,
|
||||
features,...)
|
||||
- Test your modifications on the actual hardware
|
||||
- Check your code against the [coding conventions](/doc/coding-convention.md)
|
||||
and [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy)
|
||||
- Clean your code and remove files that are not needed
|
||||
- Write documentation related to your new feature if applicable
|
||||
- Create a pull request and write a great description about it: what does your
|
||||
PR do, why, how,... Add pictures and video if possible
|
||||
- Wait for someone to review your PR and take part in the review process
|
||||
- Your PR will eventually be merged :)
|
||||
|
||||
Your contributions are more than welcome!
|
||||
|
||||
If you want to fix a bug, add functionality or improve the code, you'll first
|
||||
need to create a branch from the **develop** branch (see [this page about the
|
||||
branching model](./branches.md)). This branch is called a feature branch, and
|
||||
you should choose a name that explains what you are working on (ex:
|
||||
"add-doc-about-contributions"). In this branch, **focus on only one topic, bug
|
||||
or feature**. For example, if you created this branch to work on the UI of a
|
||||
specific application, do not commit modifications about the SPI driver. If you
|
||||
want to work on multiple topics, create one branch for each topic.
|
||||
|
||||
When your feature branch is ready, **make sure it actually works** and **do not
|
||||
forget to write documentation** about it if it's relevant.
|
||||
|
||||
**Creating a pull request containing modifications that haven't been tested is
|
||||
strongly discouraged.** If for any reason you cannot test your modifications,
|
||||
but want to publish them anyway, **please mention it in the description**. This
|
||||
way, other contributors might be willing to test it and provide feedback about
|
||||
your code.
|
||||
|
||||
Before submitting a PR, check your code against the [coding
|
||||
conventions](/doc/coding-convention.md). This project also provides
|
||||
[clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) configuration
|
||||
files. You should use them to ensure correct formatting of your code.
|
||||
|
||||
Don't forget to check the files you are going to commit and remove those which
|
||||
aren't necessary (config files from your IDE, for example). Remove old comments,
|
||||
commented code,...
|
||||
|
||||
Then, you can submit a pull request for review. Try to **describe your pull
|
||||
request as much as possible**: what did you do in this branch, how does it work,
|
||||
how it is designed, are there any limitations,... This will help the
|
||||
contributors to understand and review your code easily. You can add pictures and
|
||||
video to the description so that contributors will have a quick overview of your
|
||||
work.
|
||||
|
||||
Other contributors can post comments about the pull request, maybe ask for more
|
||||
info or adjustments in the code.
|
||||
|
||||
Once the pull request is reviewed and accepted, it'll be merged into **develop**
|
||||
and will be released in the next version of the firmware.
|
||||
|
||||
## Why all these rules?
|
||||
|
||||
Reviewing pull requests is a **very time consuming task**. Everything you do to
|
||||
make reviewing easier will **get your PR merged faster**.
|
||||
|
||||
Reviewers will first look at the **description**. If it's easy to understand
|
||||
what the PR does, why the modification is needed or interesting and how it's
|
||||
done, a good part of the work is already done : we understand the PR and its
|
||||
context.
|
||||
|
||||
Reviewing **a few files that were modified for a single purpose** is a lot
|
||||
easier than reviewing 30 files modified for many reasons (bug fix, UI
|
||||
improvements, typos in doc,...), even if all the changes make sense. Also, it's
|
||||
possible that we agree on some modification but not on another, so we won't be
|
||||
able to merge the PR because of the changes that are not accepted.
|
||||
|
||||
The code base should be kept as consistent as possible. If the formatting of
|
||||
your code is not consistent with the rest of the code base, we'll ask you to
|
||||
review it.
|
||||
|
||||
Lastly the changes are tested. If it doesn't work out of the box, we'll ask you
|
||||
to review your code and to ensure that it works as expected.
|
||||
|
||||
It's totally normal for a PR to need some more work even after it was created,
|
||||
that's why we review them. But every round trip takes time, so it's good
|
||||
practice to try to reduce them as much as possible by following those simple
|
||||
rules.
|
@ -1,13 +0,0 @@
|
||||
# InfiniTime
|
||||
|
||||
```{toctree}
|
||||
what-is-infinitime/index.md
|
||||
user-documentation/index.md
|
||||
user-documentation/apps.md
|
||||
developer-documentation/index.md
|
||||
build-flash-and-debug/index.md
|
||||
how-to-contribute.md
|
||||
going-further.md
|
||||
licences.md
|
||||
credits.md
|
||||
```
|
@ -1,12 +0,0 @@
|
||||
# Licences
|
||||
|
||||
This project is released under the GNU General Public License version 3 or, at
|
||||
your option, any later version.
|
||||
|
||||
It integrates the following projects:
|
||||
- RTOS : **[FreeRTOS](https://freertos.org)** under the MIT license
|
||||
- UI : **[LittleVGL/LVGL](https://lvgl.io/)** under the MIT license
|
||||
- BLE stack : **[NimBLE](https://github.com/apache/mynewt-nimble)** under the Apache 2.0 license
|
||||
- Font : **[Jetbrains Mono](https://www.jetbrains.com/fr-fr/lp/mono/)** under the Apache 2.0 license
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
myst-parser
|
@ -1,4 +0,0 @@
|
||||
[options.extras_require]
|
||||
docs =
|
||||
sphinx
|
||||
myst-parser
|
@ -1,142 +0,0 @@
|
||||
# How to use InfiniTime apps
|
||||
|
||||
## Stopwatch
|
||||
|
||||
![Stopwatch](./pictures/stopwatch.png)
|
||||
|
||||
The stopwatch measures passed time in minutes, seconds and hundredths of seconds.
|
||||
|
||||
When the stop watch is not running, the left button shows a stop symbol and resets the current time to zero. It is not clickable when the time is already zero.
|
||||
The right button shows a start symbol and starts the stop watch.
|
||||
|
||||
While the stop watch is running, the left button shows a flag.
|
||||
Tapping it allows to register an intermediate time without stopping the measurement.
|
||||
The last two intermediate times are shown below the running time besides.
|
||||
The right button shows a pause symbol. Tapping it pauses the measurement (without resetting it).
|
||||
|
||||
## Music player
|
||||
|
||||
![Music control](./pictures/music.png)
|
||||
|
||||
## Navigation directions
|
||||
|
||||
![Navigation](./pictures/navigation.png)
|
||||
|
||||
## Steps
|
||||
|
||||
![Steps](./pictures/steps.png)
|
||||
|
||||
The steps screen shows the current number of steps in the middle and your current steps goal and trip count underneath.
|
||||
Around it is a circular meter that shows how much of your goal you already achieved.
|
||||
|
||||
The steps count is measured daily and will be reset at midnight.
|
||||
You can configure your step goal in the settings.
|
||||
|
||||
Your trip steps will not be reset at midnight.
|
||||
You can do this yourself by pressing the Reset button on the bottom of the screen.
|
||||
|
||||
## Heart-rate
|
||||
|
||||
![Heart-rate](./pictures/hr.png)
|
||||
|
||||
The heart rate app measures your heart rate using the sensor on the backside of the watch. When you activate the heart rate measurement, a fast blinking green light comes out of .
|
||||
|
||||
At the beginning, the measurement is turned off.
|
||||
The screen shows a grey "000" and "stopped" underneath.
|
||||
Press the "Start"-button at the bottom of the screen activate the measurement.
|
||||
After starting the measurement, the measurement should become green and the text underneath should be "Not enough data, please wait ...".
|
||||
After a short while (~ 10 seconds), the text should be "Measuring ..." and on the top there should be a number that is your measured heart rate.
|
||||
|
||||
To stop the measurement, press the button at the bottom, which should now be labeled with "Stop".
|
||||
|
||||
*Keep in mind that InfiniTime and the PineTime watch are no medical devices. The measured number is not guaranteed to be your actual heart rate. See this feature more as a toy.*
|
||||
|
||||
## Timer
|
||||
|
||||
![Timer](./pictures/timer.png)
|
||||
|
||||
The Timer app lets you set a timer after which your watch will vibrate once and wake up if it was asleep.
|
||||
|
||||
The screen shows two digits for minutes and two digits for seconds, each with a button labeled "+" above and a button labeled "-" beneath.
|
||||
Tapping those buttons lets you set the desired duration until the timer vibrates.
|
||||
|
||||
At the bottom of the screen is a button with a play icon.
|
||||
Tapping it activates the timer and changes the play button to a pause button.
|
||||
Tapping the pause button pauses the timer.
|
||||
|
||||
## Paint
|
||||
|
||||
![InfiniPaint](./pictures/paint.png)
|
||||
|
||||
InfiniPaint is an app that lets you draw using the touchscreen.
|
||||
|
||||
At the start, the app will show a black screen.
|
||||
Touching the screen will let you draw white pixels.
|
||||
If you hold a touch for long enough, there will be a vibration and you will have a new color.
|
||||
|
||||
## Pong
|
||||
|
||||
![Paddle](./pictures/paddle.png)
|
||||
|
||||
Pong is a little game that you can play.
|
||||
In the middle of the screen is a little ball that will bounce of the walls except the left one.
|
||||
At the left side there is a bar that will bounce the ball.
|
||||
You can control it by touching the screen
|
||||
Each time you keep the ball inside the screen will earn you one point.
|
||||
Your points are shown at the top of the screen.
|
||||
Try to get as many points as possible.
|
||||
|
||||
## 2048
|
||||
|
||||
![2048](./pictures/twos.png)
|
||||
|
||||
2048 is a puzzle game you can play.
|
||||
At the start, you can see a four by four grid of cells and your score at the top, which should be zero.
|
||||
Some of the cells will be filled with numbers that are powers of two.
|
||||
Your goal is to make as many moves as possible and thereby earn as many points as possible.
|
||||
You make a move by swiping either up, down, left or right.
|
||||
All numbers on the grid will then move as far in this direction as possible.
|
||||
When two numbers with the same values collide, they will be added to a single cell.
|
||||
|
||||
## Accelerometer
|
||||
|
||||
![Accelerometer](./pictures/accelerometer.png)
|
||||
|
||||
The accelerometer visualizes the accelerations along the x, y and z axis that are measured by the motion sensor of the watch.
|
||||
In the bottom left corner, it also shows your current step count.
|
||||
|
||||
## Metronome
|
||||
|
||||
![Metronome](./pictures/metronome.png)
|
||||
|
||||
The metronome app lets you have a vibrating metronome on your wrist.
|
||||
The metronome vibrates on each beat.
|
||||
The first beat of each bar is stronger than the other ones.
|
||||
|
||||
Move the dot on the arc to change the bpm (beats per minute) that are shown in the middle.
|
||||
|
||||
On the bottom are two buttons.
|
||||
Tapping the left one opens a scrollable list from which you can select how many bpb (beats per bar) you would like to have.
|
||||
Tap a number in the list to select it.
|
||||
The right button shows a play sign if the metronome is paused and a pause sign if the metronome is running.
|
||||
Use it to start or pause the metronome.
|
||||
|
||||
## Alarm
|
||||
|
||||
![Alarm](./pictures/alarm.png)
|
||||
|
||||
The alarm app lets you set an alarm to wake you up in the morning (or whenever).
|
||||
|
||||
The screen contains two digits for the hour on the left and two digits for the minutes on the right.
|
||||
Above and beneath each are buttons labeled with "+" and "-" that let you modify the time.
|
||||
|
||||
At the bottom of the screen there are two buttons.
|
||||
The left one is either grey and labeled "OFF" or green and labeled "ON". Tapping it, toggles it between those two. It shows whether the alarm is active or not.
|
||||
The right button is labeled either "ONCE", "DAILY" or "MON-FRI". Tapping it cycles between those three. It shows on which days the alarm will ring when it is active.
|
||||
|
||||
At the top, in the middle is a button labeled "i".
|
||||
Tapping it informs you, how many time is left before the next alarm.
|
||||
|
||||
When the alarm rings, the watch vibrates repeatedly and shows the alarm app.
|
||||
The bottom left button is then red and labeled with a stop sign.
|
||||
Press it, to end the ringing.
|
@ -1,430 +0,0 @@
|
||||
# User documentation
|
||||
|
||||
This part of the documentation is meant for end users.
|
||||
For developer documentation, please refer to [this page](/developer-documentation/index.html)
|
||||
|
||||
## Getting started with InfiniTime
|
||||
|
||||
### Unboxing your PineTime
|
||||
|
||||
The box contains:
|
||||
|
||||
- the PineTime,
|
||||
- a USB-A charger/craddle,
|
||||
- a quick user guide.
|
||||
|
||||
### Boot/Reboot/Switch off InfiniTime
|
||||
|
||||
The PineTime has a single button, located on the left hand side.
|
||||
|
||||
- To start/boot your PineTime, simply hold the button for a few seconds until
|
||||
the Pine64 logo appears,
|
||||
- if nothing happens, you may have to charge the watch beforehand.
|
||||
- To reboot/restart the watch, press and hold the button for approximately 8
|
||||
seconds
|
||||
- Release the button at that stage, otherwise you will trigger another action
|
||||
(see [Recovery
|
||||
firmware](index.html#firmware-bootloader-recovery-firmware) and [Firmware
|
||||
validation](index.html#firmware-validation)
|
||||
for more details).
|
||||
- It is **not** possible to switch it off.
|
||||
|
||||
### Setting up date and time
|
||||
|
||||
By default, InfiniTime starts on the digital watchface. It'll probably display
|
||||
the epoch time (1 Jan 1970, 00:00).
|
||||
|
||||
You can set the time (and date) manually, or have a companion app do it for you.
|
||||
|
||||
InfiniTime doesn't handle daylight savings automatically, so make sure to set
|
||||
the correct time or sync with a companion app.
|
||||
|
||||
#### Using companion apps
|
||||
|
||||
Date and time are set by the companion app once the PineTime is connected over
|
||||
BLE.
|
||||
|
||||
#### Manually
|
||||
|
||||
Starting with InfiniTime 1.7, it is possible to configure the date and
|
||||
time directly from the watch.
|
||||
|
||||
This can be done from the Settings menu, then "Set date" and "Set time"
|
||||
respectively:
|
||||
|
||||
![Set date manually](./pictures/set_date.png)
|
||||
![Set time manually](./pictures/set_time.png)
|
||||
|
||||
#### Using any Chromium-based web-browser
|
||||
|
||||
You can use [WebBLE](https://hubmartin.github.io/WebBLEWatch/) from a
|
||||
Chromium-based browser (Chrome, Chromium, Edge, Chrome Android) to setup the
|
||||
date and time.
|
||||
|
||||
(insert here pics of WebBLE GH)
|
||||
|
||||
#### Using NRFConnect
|
||||
|
||||
You must enable the **CTS** *GATT* server into NRFConnect so that InfiniTime can
|
||||
synchronize the time with your smartphone.
|
||||
|
||||
Launch NRFConnect, tap the sandwich button on the top left and select *Configure
|
||||
GATT server*:
|
||||
|
||||
Tap *Add service* and select the server configuration *Current Time service*.
|
||||
Tap OK and connect to your PineTime, it should automcatically sync the time once
|
||||
the connection is established!
|
||||
|
||||
(insert pics from
|
||||
https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md#using-nrfconnect-1)
|
||||
|
||||
### Companion apps
|
||||
|
||||
PineTime can be used as a standalone watch, displaying date and time (which can
|
||||
be configured from the watch itself since InfiniTime 1.7.0), as well as
|
||||
heart-rate, number of steps, used as a torchlight, or just to play the included
|
||||
games (2048, Pong, and Draw).
|
||||
|
||||
To get more features, Companion apps, which are applications running on a
|
||||
smartphone or a computer, and are paired to the PineTime, are required.
|
||||
|
||||
There are multiple Companion apps available:
|
||||
|
||||
- Smartphones:
|
||||
- Android: [GadgetBridge](https://gadgetbridge.org/)
|
||||
- SailfishOS: [Amazfish](https://openrepos.net/content/piggz/amazfish/)
|
||||
- iOS: [InfiniLink](https://github.com/xan-m/InfiniLink)
|
||||
- PinePhone (Linux phone): [Siglo](https://github.com/alexr4535/siglo)
|
||||
- Linux Computer:
|
||||
- [Amazfish](https://openrepos.net/content/piggz/amazfish/) and
|
||||
[Siglo](https://github.com/alexr4535/siglo) will also work, but may require
|
||||
some manual installation.
|
||||
- [ITD](https://gitea.arsenm.dev/Arsen6331/itd/)
|
||||
|
||||
### The InfiniTime UI
|
||||
|
||||
The UI is composed of 4 different areas:
|
||||
- the main watchface
|
||||
- the notification screen (swipe down)
|
||||
- apps drawer (swipe up)
|
||||
- quick settings (swipe right)
|
||||
|
||||
#### Watchfaces
|
||||
|
||||
The default watchface is the "digital one", which displays date and time, as
|
||||
well as the number of steps, heart-rate, bluetooth icon (when connected),
|
||||
battery status, and possibly missed notifications.
|
||||
|
||||
There are 2 other watchfaces:
|
||||
|
||||
- Analog
|
||||
- PineTimeStyle
|
||||
|
||||
![Digital watchface](./pictures/watchface_digital.png)
|
||||
![Analog watchface](./pictures/watchface_analog.png)
|
||||
![PTS watchface](./pictures/watchface_pts.png)
|
||||
|
||||
#### Notification screen
|
||||
|
||||
When swiping down, the last notification is displayed.
|
||||
Up to 5 notifications can be displayed: simply swipe up again the display the
|
||||
next notification.
|
||||
To come back to the watchface, press the left button.
|
||||
|
||||
It is currently not possible to discard notifications, unless you restart
|
||||
InfiniTime (long press on the button for ~8 seconds).
|
||||
|
||||
![Notification](./pictures/notifications.png)
|
||||
|
||||
#### Apps drawer
|
||||
|
||||
When swiping up, the apps drawer allows launching applications.
|
||||
|
||||
There are 2 pages with each 6 applications (2 rows of 3 apps):
|
||||
|
||||
Page 1:
|
||||
- Stopwatch
|
||||
- Music control
|
||||
- Navigation (only works with PureMaps/Sailfish OS)
|
||||
- Steps counter
|
||||
- Heart-rate
|
||||
- Countdown
|
||||
|
||||
Page 2:
|
||||
- Draw
|
||||
- Pong game
|
||||
- 2048 game
|
||||
- Accelerometer
|
||||
- Metronome
|
||||
- Alarm
|
||||
|
||||
![App menu 1](./pictures/app_menu_1.png)
|
||||
![App menu 2](./pictures/app_menu_2.png)
|
||||
|
||||
#### Quick settings
|
||||
|
||||
When swiping right, you get access to 4 icons :
|
||||
|
||||
![Quick settings](./pictures/quick_settings.png)
|
||||
|
||||
- brightness level: pressing it will cycle between 3 levels (low/medium/high)
|
||||
- torch:
|
||||
- a tap launches it,
|
||||
- another tap switches it on,
|
||||
- another one switches it off,
|
||||
- swiping to the right or left changes the brightness level of the torch
|
||||
- silent mode:
|
||||
- a green bell symbol means silent mode is off (so the watch will vibrate when
|
||||
receiving a notification),
|
||||
- taping it enables it: the icon becomes grey, and the watch will not vibrate
|
||||
when receiving notifications)
|
||||
- settings: access to InfiniTime settings
|
||||
|
||||
The following settings are available:
|
||||
|
||||
![Settings 1](./pictures/settings_menu_1.png)
|
||||
![Settings 2](./pictures/settings_menu_2.png)
|
||||
![Settings 3](./pictures/settings_menu_3.png)
|
||||
|
||||
- Display timeout (in seconds)
|
||||
- Wake up: how to wake up the watch
|
||||
- nothing selected means only the left button wakes up the watch
|
||||
- single tap: tap one time on the screen to wake up the watch
|
||||
- double tap: tap two times to wake it up
|
||||
- raise wrist: screen will wake up when you raise your wrist
|
||||
- Time format: 12h or 24h
|
||||
- Watch face: choose between digital, analog and PineTimeStyle
|
||||
- Steps: define your daily goal
|
||||
- Set date: allows manually setting date
|
||||
- Set time: allows manually setting time
|
||||
- Battery: displays battery level and voltage
|
||||
- Chimes: Emit a small vibration every hour or half-hour
|
||||
- Shake calibration: calibration the sensitivity of the "shake to wake" functionality
|
||||
- Firmware: displays information about the InfiniTime version
|
||||
- About: displays information about InfiniTime, the Bootloader, uptime, etc
|
||||
|
||||
## Flash And Upgrade
|
||||
|
||||
### Bootloader, Firmware and recovery firmware
|
||||
|
||||
#### Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it?
|
||||
|
||||
You may have already encountered these words by reading the announcement,
|
||||
release notes, or [the wiki
|
||||
guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and
|
||||
you may find them confusing if you're not familiar with the project.
|
||||
|
||||
A **firmware** is software running on the embedded hardware of a device.
|
||||
|
||||
InfiniTime has three distinct firmwares:
|
||||
- [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) is the operating system.
|
||||
- [The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader) is responsible for safely applying firmware updates and runs before booting into InfiniTime.
|
||||
- **The recovery firmware** is a special *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.
|
||||
|
||||
**OTA** (**O**ver **T**he **A**ir) refers to updating of the firmware over BLE
|
||||
(Bluetooth Low Energy). This is a functionality that allows the user to update
|
||||
the firmware on their device wirelessly.
|
||||
|
||||
**DFU** (**D**evice **F**irmware **U**pdate) is the file format and protocol
|
||||
used to send the update of the firmware to the watch over-the-air. InfiniTime
|
||||
implements the (legacy) DFU protocol from Nordic Semiconductor (NRF).
|
||||
|
||||
#### Bootloader
|
||||
|
||||
The
|
||||
[bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0)
|
||||
is run right before booting into InfiniTime.
|
||||
It is easily recognizable with its white pine cone that is progressively drawn
|
||||
in green. It also displays its own version at the bottom (1.0.0 as of now).
|
||||
|
||||
![Bootloader_v1](./pictures/bootloader-1.0.jpg)
|
||||
|
||||
Most of the time, the bootloader just runs without your intervention (update and load the firmware).
|
||||
|
||||
However, you can enable 2 functionalities using the push button:
|
||||
|
||||
- Push the button until the pine cone is drawn in blue to force the rollback of
|
||||
the previous version of the firmware, even if you've already validated the
|
||||
updated one
|
||||
- Push the button until the pine cone is drawn in red to load the recovery
|
||||
firmware. This recovery firmware only provides BLE connectivity and OTA
|
||||
functionality.
|
||||
|
||||
More info about the bootloader on [its project
|
||||
page](https://github.com/JF002/pinetime-mcuboot-bootloader/blob/master/README.md).
|
||||
|
||||
#### The firmware
|
||||
|
||||
Well, it's InfiniTime :)
|
||||
|
||||
You can check the InfiniTime version by first swiping right on the watchface to
|
||||
open quick settings, tapping the cogwheel to open settings, swipe up until you
|
||||
find an entry named "About" and tap on it.
|
||||
|
||||
![Firmware_v1.0](./pictures/firmware-v1.0.jpg)
|
||||
|
||||
#### Recovery firmware
|
||||
|
||||
The *recovery functionality* allows to load a [recovery
|
||||
firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1) from
|
||||
the external flash memory to recover the PineTime when the current firmware
|
||||
cannot boot anymore.
|
||||
|
||||
This recovery firmware is a slightly modified version of InfiniTime that only
|
||||
provides a basic UI and the OTA functionality. You'll be able to use this
|
||||
firmware to load a new firmware over-the-air using BLE connectivity.
|
||||
|
||||
[This
|
||||
article](https://www.ncartron.org/pinetimes-infinitime-new-bootloader-and-a-recovery-firmware.html)
|
||||
describes how to upgrade your PineTime to benefit from this feature.
|
||||
|
||||
PineTime units shipped after (confirm date with JF) come with the recovery
|
||||
firmware already installed, so there's no need to follow this procedure.
|
||||
|
||||
### Upgrading your PineTime
|
||||
|
||||
There are 2 ways to upgrade your PineTime:
|
||||
- "Over-The-Air", i.e. using the Bluetooth connectivity to send firmware from a
|
||||
companion app: this is recommended for sealed devices
|
||||
- using the SWD interface: only possible for dev / non-sealed units, as it
|
||||
requires access to the internals of the watch.
|
||||
|
||||
#### Over-The-Air (OTA)
|
||||
|
||||
To update your PineTime, you can use one of the compatible companion
|
||||
applications.
|
||||
|
||||
The updating process differs slightly on every companion app, so you'll need to
|
||||
familiarize yourself with the companion app of your choice.
|
||||
|
||||
All releases of InfiniTime are available on [the release page of the GitHub
|
||||
repo](https://github.com/InfiniTimeOrg/InfiniTime/releases)
|
||||
under assets.
|
||||
|
||||
To update the firmware, you need to download the DFU of the firmware version
|
||||
that you'd like to install, for example `pinetime-mcuboot-app-dfu-1.6.0.zip`, and
|
||||
flash it with your companion app.
|
||||
|
||||
##### Using Gadgetbridge
|
||||
|
||||
(Pics from [the original
|
||||
article](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/doc/gettingStarted/ota-gadgetbridge.md)
|
||||
will be added soon).
|
||||
|
||||
###### Connecting to Gadgetbridge
|
||||
|
||||
- Launch Gadgetbridge and tap on the "+" button on the bottom right to add a new device:
|
||||
(add pic)
|
||||
|
||||
- Wait for the scan to complete, your PineTime should be detected:
|
||||
(add pic)
|
||||
|
||||
- Tap on it. Gadgdetbridge will pair and connect to your device:
|
||||
(add pic)
|
||||
|
||||
###### Updating with Gadgetbridge
|
||||
|
||||
Now that Gadgetbridge is connected to your PineTime, use a file browser
|
||||
application and find the DFU file (`pinetime-mcuboot-app-dfu-x.x.x.zip`) you
|
||||
downloaded previously.
|
||||
Tap on it and open it using the Gadgetbridge application/firmware installer:
|
||||
(add pic)
|
||||
|
||||
Read carefully the warning and tap Install:
|
||||
(add pic)
|
||||
|
||||
Wait for the transfer to finish. Your PineTime should reset and reboot with the
|
||||
new version of InfiniTime!
|
||||
|
||||
Don't forget to validate your firmware. In the InfiniTime go to the settings
|
||||
(swipe right, select gear icon) and Firmware option and click validate.
|
||||
Otherwise after reboot the previous firmware will be used.
|
||||
|
||||
(add pic)
|
||||
|
||||
|
||||
##### Using Amazfish
|
||||
|
||||
Please see [this
|
||||
article](https://www.ncartron.org/upgrading-pinetimes-infinitime-firmware.html)
|
||||
which describes how to use Amazfish on Sailfish OS to upgrade your PineTime.
|
||||
Instructions also apply if you're running Amazfish on Linux.
|
||||
|
||||
##### Using ITD
|
||||
|
||||
ITD comes with a graphical user interface, called `itgui`, which allows
|
||||
upgrading InfiniTime.
|
||||
Please see [ITD's README](https://gitea.arsenm.dev/Arsen6331/itd/#itgui) for
|
||||
more details.
|
||||
|
||||
##### Using NRFConnect
|
||||
|
||||
- Open NRFConnect. Swipe down in the Scanner tab and wait for your device to appear:
|
||||
(add pic)
|
||||
|
||||
- Tap on the *Connect* button on the right of your device. NRFConnect will connect
|
||||
to your PineTime and discover its characteristics. Tap on the DFU button on
|
||||
the top right:
|
||||
(add pic)
|
||||
|
||||
- Select Distribution packet (ZIP):
|
||||
(add pic)
|
||||
|
||||
- Find the DFU file (`pinetime-mcuboot-app-dfu-x.x.x.zip`) you downloaded
|
||||
previously, the DFU transfer will start automatically. When the transfer is
|
||||
finished, your PineTime will reset and restart on the new version of
|
||||
InfiniTime!
|
||||
Don't forget to validate your firmware. In the InfiniTime go to the settings
|
||||
(swipe right, select gear icon) and Firmware option and click validate.
|
||||
Otherwise after reboot the previous firmware will be used.
|
||||
|
||||
#### Using the SWD interface
|
||||
|
||||
Download the files bootloader.bin, image-x.y.z.bin and
|
||||
pinetime-graphics-x.y.z.bin from the [releases
|
||||
page](https://github.com/InfiniTimeOrg/InfiniTime/releases).
|
||||
|
||||
The bootloader reads a boot logo from the external SPI flash memory. The first
|
||||
step consists of flashing a tool in the MCU that will flash the boot logo into
|
||||
this SPI flash memory. This first step is optional but recommended (the
|
||||
bootloader will display garbage on screen for a few second if you don't do it).
|
||||
Using your SWD tool, flash pinetime-graphics-x.y.z.bin at offset 0x0000. Reset
|
||||
the MCU and wait for a few second, until the logo is completely drawn on the
|
||||
display.
|
||||
|
||||
Then, using your SWD tool, flash those file at specific offset:
|
||||
|
||||
- bootloader.bin : **0x0000**
|
||||
- image-x.y.z.bin : **0x8000**
|
||||
|
||||
Reset and voilà, you're running InfiniTime on your PineTime!
|
||||
|
||||
### Firmware validation
|
||||
|
||||
Firmware updates must be manually validated. If the firmware isn't validated and
|
||||
the watch resets, the watch will revert to the previous firmware. This is a
|
||||
safety feature to prevent bricking your device with faulty firmware.
|
||||
|
||||
You can validate your updated firmware on InfiniTime >= 1.0 by following this
|
||||
simple procedure:
|
||||
|
||||
- From the watchface, swipe right to display the quick settings menu
|
||||
- Open settings by tapping the cogwheel on the bottom right
|
||||
- Swipe up until you find an entry named Firmware and tap on it
|
||||
- If the firmware is not validated yet, you can either validate the running
|
||||
firmware, or reset and revert to the previous firmware version
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Bluetooth connectivity
|
||||
|
||||
InfiniTime versions prior to 1.6.0 "Ice Apple" had a known BLE bug, which caused
|
||||
lost of Bluetooth connectivity after a few hours.
|
||||
The only way to fix this was to restart the watch (by holding the button for ~8
|
||||
seconds).
|
||||
|
||||
This bug has been fixed, and with 1.6 and onwards, BLE connectivity is a lot
|
||||
more reliable.
|
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 867 B |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.6 KiB |
@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
#convert
|
||||
for image in *.png; do
|
||||
convert "$image" -crop 240x240+0+29 "$image"
|
||||
done
|
||||
exit 0
|
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 608 B |