Skip to content

Commit f6d0ec4

Browse files
committed
Merge branch 'develop'
# Conflicts: # doc/buildAndProgram.md
2 parents f41aaad + a57fda6 commit f6d0ec4

File tree

86 files changed

+2079
-441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2079
-441
lines changed

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Checks: '*,
22
-altera-unroll-loops,
33
-llvmlibc-callee-namespace,
4+
-llvmlibc-restrict-system-libc-headers,
45
-llvm-header-guard,
56
-llvm-namespace-comment,
67
-google-build-using-namespace,
@@ -9,6 +10,7 @@ Checks: '*,
910
-fuchsia-statically-constructed-objects,
1011
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
1112
-cppcoreguidelines-pro-bounds-constant-array-index,
13+
-cppcoreguidelines-pro-type-static-cast-downcast,
1214
-cppcoreguidelines-pro-type-union-access,
1315
-cppcoreguidelines-pro-type-cstyle-cast,
1416
-cppcoreguidelines-pro-type-vararg,

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RUN unzip -q /tmp/nRF5_SDK_15.3.0_59ac345 -d /opt
5555
RUN rm /tmp/nRF5_SDK_15.3.0_59ac345
5656
# McuBoot
5757
# RUN bash -c "source /opt/build.sh; GetMcuBoot;"
58-
RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git
58+
RUN git clone https://github.com/mcu-tools/mcuboot.git
5959
RUN pip3 install -r ./mcuboot/scripts/requirements.txt
6060

6161
RUN adduser infinitime

.devcontainer/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ GetGcc() {
4343
}
4444

4545
GetMcuBoot() {
46-
git clone https://github.com/JuulLabs-OSS/mcuboot.git "$TOOLS_DIR/mcuboot"
46+
git clone https://github.com/mcu-tools/mcuboot.git "$TOOLS_DIR/mcuboot"
4747
pip3 install -r "$TOOLS_DIR/mcuboot/scripts/requirements.txt"
4848
}
4949

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Bug Report
2+
description: File a bug report
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
**Thanks for taking the time to fill out this bug report!**
9+
*Please, before opening a bug report, check if similar issues already exist. In that case, use those issues to provide your feedback instead.*
10+
- type: checkboxes
11+
attributes:
12+
options:
13+
- label: I searched for similar bug reports and found none was relevant.
14+
required: true
15+
- type: input
16+
id: desc-brief
17+
attributes:
18+
label: What happened?
19+
description: A one-line description of the bug.
20+
placeholder: "Ex. I woke up as a Kafkian insect this morning."
21+
validations:
22+
required: true
23+
- type: input
24+
id: desc-expected
25+
attributes:
26+
label: What should happen instead?
27+
description: The behaviour you were expecting to see.
28+
placeholder: "Ex. I was expecting to wake up as a human."
29+
- type: textarea
30+
id: desc-steps
31+
attributes:
32+
label: Reproduction steps
33+
description: "How do you trigger this bug? Please walk us through it step by step."
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: desc-long
38+
attributes:
39+
label: More details?
40+
description: Give us more details about the bug and any personal attempts you made to fix it.
41+
placeholder: Tell us more!
42+
- type: input
43+
id: version
44+
attributes:
45+
label: Version
46+
description: |
47+
What [version of the firmware](https://github.com/JF002/InfiniTime/blob/develop/doc/gettingStarted/gettingStarted-1.0.md#how-to-check-the-version-of-infinitime-and-the-bootloader) are you running?
48+
If you are running an older version, please consider [updating to the latest firmware](https://github.com/JF002/InfiniTime/blob/develop/doc/gettingStarted/gettingStarted-1.0.md#how-to-update-your-pinetime).
49+
If you are running directly from git, specify the branch or the commit hash directly.
50+
placeholder: "Ex. v1.6.0 or develop or fc922b60"
51+
validations:
52+
required: true
53+
- type: input
54+
id: companion-app
55+
attributes:
56+
label: Companion app
57+
description: Which companion app are you using (if relevant)?
58+
placeholder: "Ex. Gadgetbridge v0.60.0, Siglo v0.9.4"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Feature Request
2+
description: File a feature request
3+
labels: ["feature request"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
**Thanks for taking the time to fill out this feature request!**
9+
*Please, before opening a feature request, check if similar issues already exist. In that case, use those issues to provide your feedback instead.*
10+
- type: checkboxes
11+
attributes:
12+
options:
13+
- label: I searched for similar feature request and found none was relevant.
14+
required: true
15+
- type: markdown
16+
attributes:
17+
value: |
18+
**Note:** keep in mind that, while InfiniTime is usable, it is still under heavy development and as such it is continuously evolving.
19+
Some features you want to see implemented might not be compatible with the current state of the project, or might not even be suitable to include *in the firmware* of the watch.
20+
- type: input
21+
id: desc-brief
22+
attributes:
23+
label: Pitch us your idea!
24+
description: A one-line elevator pitch of the feature you'd like to see implemented.
25+
placeholder: "Ex. My dog wants InfiniTime on its smart collar."
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: desc-long
30+
attributes:
31+
label: Description
32+
description: |
33+
Give us a detailed description of the feature you are proposing. Mockups or a description of the possible use cases are highly appreciated.
34+
Tell us why this should be included in the firmware.
35+
placeholder: "Ex. Here is a drawing of my dog wearing an InfiniTime collar and smiling."
36+
- type: markdown
37+
id: companion-app
38+
attributes:
39+
value: |
40+
If this requires features missing from other software (for example a companion app), please take care of opening any relevant feature request over there as well.

.github/workflows/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ jobs:
153153
name: pinetime-app.out
154154
path: build/src/pinetime-app*.out
155155

156+
#########################################################################################
157+
# Make but don't Upload the Recovery Firmware to be sure it builds correctly
158+
159+
- name: Make pinetime-recovery
160+
run: |
161+
cd build
162+
make pinetime-recovery
163+
156164
#########################################################################################
157165
# Finish
158166

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.10)
2-
project(pinetime VERSION 1.6.0 LANGUAGES C CXX ASM)
2+
project(pinetime VERSION 1.7.0 LANGUAGES C CXX ASM)
33

44
set(CMAKE_C_STANDARD 99)
55
set(CMAKE_CXX_STANDARD 14)

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# InfiniTime
22

3-
[![Build PineTime Firmware](https://github.com/JF002/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)](https://github.com/JF002/InfiniTime/actions)
3+
[![Build PineTime Firmware](https://github.com/InfiniTimeOrg/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)](https://github.com/InfiniTimeOrg/InfiniTime/actions)
44

55
![InfiniTime logo](images/infinitime-logo.jpg "InfiniTime Logo")
66

@@ -65,14 +65,15 @@ As of now, here is the list of achievements of this project:
6565
* [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS and Linux)
6666
* [Siglo](https://github.com/alexr4535/siglo) (on Linux)
6767
* **[Experimental]** [WebBLEWatch](https://hubmartin.github.io/WebBLEWatch/) Synchronize time directly from your web browser. [video](https://youtu.be/IakiuhVDdrY)
68-
* **[Experimental]** [Infini-iOS](https://github.com/xan-m/Infini-iOS) (on iOS)
68+
* **[Experimental]** [InfiniLink](https://github.com/xan-m/InfiniLink) (on iOS)
6969
- OTA (Over-the-air) update via BLE
70-
- [Bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader) based on [MCUBoot](https://juullabs-oss.github.io/mcuboot/)
70+
- [Bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader) based on [MCUBoot](https://www.mcuboot.com)
7171

7272
## Documentation
7373

7474
### Develop
75-
75+
- [Rough structure of the code](doc/code/Intro.md)
76+
- [How to implement an application](doc/code/Apps.md)
7677
- [Generate the fonts and symbols](src/displayapp/fonts/README.md)
7778
- [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html)
7879

bootloader/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# About this bootloader
2-
The [bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/tree/master/libs/pinetime_boot/src) is mostly developed by [Lup Yuen](https://github.com/lupyuen). It is based on [MCUBoot](https://juullabs-oss.github.io/mcuboot/) and [Mynewt](https://mynewt.apache.org/).
2+
The [bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/tree/master/libs/pinetime_boot/src) is mostly developed by [Lup Yuen](https://github.com/lupyuen). It is based on [MCUBoot](https://www.mcuboot.com) and [Mynewt](https://mynewt.apache.org/).
33

44
The goal of this project is to provide a common bootloader for multiple (all?) Pinetime projects. It allows to upgrade the current bootloader and even replace the current application by another one that supports the same bootloader.
55

@@ -86,7 +86,7 @@ make pinetime-mcuboot-app
8686

8787
The binary is located in *<build directory>/src/pinetime-mcuboot-app.bin*.
8888

89-
It must me converted into a MCUBoot image using *imgtool.py* from [MCUBoot](https://github.com/JuulLabs-OSS/mcuboot/tree/master/scripts). Simply checkout the project and run the script <mcuboot root>/scripts/imgtool.py with the following command line:
89+
It must me converted into a MCUBoot image using *imgtool.py* from [MCUBoot](https://github.com/mcu-tools/mcuboot/tree/master/scripts). Simply checkout the project and run the script <mcuboot root>/scripts/imgtool.py with the following command line:
9090

9191
`
9292
imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header <build directory>/src/pinetime-mcuboot-app.bin image.bin

doc/MemoryAnalysis.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The PineTime is equipped with the following memories:
66

77
Note that the NRF52832 cannot execute code stored in the external flash : we need to store the whole firmware in the internal flash memory, and use the external one to store graphicals assets, fonts...
88

9-
This document describes how the RAM and Flash memories are used in InfiniTime and how to analyze and monitor their usage. It was written in the context of [this memory analysis effort](https://github.com/JF002/InfiniTime/issues/313).
9+
This document describes how the RAM and Flash memories are used in InfiniTime and how to analyze and monitor their usage. It was written in the context of [this memory analysis effort](https://github.com/InfiniTimeOrg/InfiniTime/issues/313).
1010

1111
## Code sections
1212
A binary is composed of multiple sections. Most of the time, these sections are : .text, .rodata, .data and .bss but more sections can be defined in the linker script.
@@ -38,7 +38,7 @@ In this analysis, I used [Linkermapviz](https://github.com/PromyLOPh/linkermapvi
3838

3939
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,...
4040

41-
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/JF002/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...
41+
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...
4242

4343
### Puncover
4444
[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...
@@ -69,8 +69,8 @@ This way, you can easily check what needs to be optimized : we should find a way
6969
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.
7070

7171
### Links
72-
- Analysis with linkermapviz : https://github.com/JF002/InfiniTime/issues/313#issuecomment-842338620
73-
- Analysis with Puncover : https://github.com/JF002/InfiniTime/issues/313#issuecomment-847311392
72+
- Analysis with linkermapviz : https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-842338620
73+
- Analysis with Puncover : https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-847311392
7474

7575
## RAM
7676
RAM memory contains all the data that can be modified at run-time: variables, stack, heap...
@@ -93,7 +93,7 @@ int main() {
9393
In Infinitime 1.1, the biggest buffers are the buffers allocated for LVGL (14KB) and the one for FreeRTOS (16KB). Nimble also allocated 9KB of RAM.
9494

9595
### Stack
96-
The stack will be used for everything except tasks, which have their own stack allocated by FreeRTOS. The stack is 8192B and is allocated in the [linker script](https://github.com/JF002/InfiniTime/blob/develop/nrf_common.ld#L148).
96+
The stack will be used for everything except tasks, which have their own stack allocated by FreeRTOS. The stack is 8192B and is allocated in the [linker script](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/nrf_common.ld#L148).
9797
An easy way to monitor its usage is by filling the section with a known pattern at boot time, then use the firmware and dump the memory. You can then check the maximum stack usage by checking the address from the beginning of the stack that were overwritten.
9898

9999
#### Fill the stack section by a known pattern:
@@ -197,10 +197,10 @@ On the following dump, the maximum stack usage is 520 bytes (0xFFFF - 0xFDF8):
197197
According to my experimentations, we don't use the stack that much, and 8192 bytes is probably way too big for InfiniTime!
198198

199199
#### Links
200-
- https://github.com/JF002/InfiniTime/issues/313#issuecomment-851035070
200+
- https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-851035070
201201

202202
### Heap
203-
The heap is declared in the [linker script](https://github.com/JF002/InfiniTime/blob/develop/nrf_common.ld#L136) and its current size is 8192 bytes. The heap is used for dynamic memory allocation(`malloc()`, `new`...).
203+
The heap is declared in the [linker script](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/nrf_common.ld#L136) and its current size is 8192 bytes. The heap is used for dynamic memory allocation(`malloc()`, `new`...).
204204

205205
Heap monitoring is not easy, but it seems that we can use the following code to know the current usage of the heap:
206206

@@ -239,7 +239,7 @@ Using this technique, I was able to trace all malloc calls at boot (boot -> digi
239239
- hr task = 304
240240

241241
#### Links
242-
- https://github.com/JF002/InfiniTime/issues/313#issuecomment-851035625
242+
- https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-851035625
243243
- https://www.embedded.com/mastering-stack-and-heap-for-system-reliability-part-1-calculating-stack-size/
244244
- https://www.embedded.com/mastering-stack-and-heap-for-system-reliability-part-2-properly-allocating-stacks/
245245
- https://www.embedded.com/mastering-stack-and-heap-for-system-reliability-part-3-avoiding-heap-errors/
@@ -263,7 +263,7 @@ For example a simple lv_label needs **~140 bytes** of memory.
263263

264264
I tried to monitor this max value while going through all the apps of InfiniTime 1.1 : the max value I've seen is **5660 bytes**. It means that we could probably **reduce the size of the buffer from 14KB to 6 - 10 KB** (we have to take the fragmentation of the memory into account).
265265
### Links
266-
- https://github.com/JF002/InfiniTime/issues/313#issuecomment-850890064
266+
- https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-850890064
267267

268268

269269
## FreeRTOS heap and task stack

0 commit comments

Comments
 (0)