From 65423b3c945002b5828f8be3b42e27bc9c83d8b4 Mon Sep 17 00:00:00 2001 From: Niall Cooling Date: Thu, 25 Feb 2021 16:18:08 +0000 Subject: [PATCH 01/17] added devcontainer files --- .devcontainer/Dockerfile | 43 ++++++++++++++++++ .devcontainer/build.sh | 78 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 32 ++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100755 .devcontainer/build.sh create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..c6a3588f --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,43 @@ +FROM ubuntu:18.04 + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update -qq \ + && apt-get install -y \ +# x86_64 / generic packages + bash \ + build-essential \ + cmake \ + git \ + make \ + python3 \ + python3-pip \ + tar \ + unzip \ + wget \ + curl \ +# aarch64 packages + libffi-dev \ + libssl-dev \ + python3-dev \ + rustc \ + && rm -rf /var/cache/apt/* /var/lib/apt/lists/*; + +RUN adduser infinitime + +RUN pip3 install adafruit-nrfutil +# required for McuBoot +RUN pip3 install setuptools_rust + +WORKDIR /opt/ +# build.sh knows how to compile +COPY build.sh . + +# Lets get each in a separate docker layer for better downloads +# GCC +RUN bash -c "source /opt/build.sh; GetGcc;" +# NrfSdk +RUN bash -c "source /opt/build.sh; GetNrfSdk;" +# McuBoot +RUN bash -c "source /opt/build.sh; GetMcuBoot;" + +ENV SOURCES_DIR /workspaces/Pinetime diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh new file mode 100755 index 00000000..8f0d0fa9 --- /dev/null +++ b/.devcontainer/build.sh @@ -0,0 +1,78 @@ +#!/bin/bash +(return 0 2>/dev/null) && SOURCED="true" || SOURCED="false" +export LC_ALL=C.UTF-8 +export LANG=C.UTF-8 +set -x +set -e + +# Default locations if the var isn't already set +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 BUILD_TYPE=${BUILD_TYPE:=Release} +export GCC_ARM_VER=${GCC_ARM_VER:="gcc-arm-none-eabi-9-2020-q2-update"} +export NRF_SDK_VER=${NRF_SDK_VER:="nRF5_SDK_15.3.0_59ac345"} + +MACHINE="$(uname -m)" +[[ "$MACHINE" == "arm64" ]] && MACHINE="aarch64" + +main() { + local target="$1" + + mkdir -p "$TOOLS_DIR" + + [[ ! -d "$TOOLS_DIR/$GCC_ARM_VER" ]] && GetGcc + [[ ! -d "$TOOLS_DIR/$NRF_SDK_VER" ]] && GetNrfSdk + [[ ! -d "$TOOLS_DIR/mcuboot" ]] && GetMcuBoot + + mkdir -p "$BUILD_DIR" + + CmakeGenerate + CmakeBuild $target + 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/ +} + +GetMcuBoot() { + git clone https://github.com/JuulLabs-OSS/mcuboot.git "$TOOLS_DIR/mcuboot" + pip3 install -r "$TOOLS_DIR/mcuboot/scripts/requirements.txt" +} + +GetNrfSdk() { + wget -q "https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/$NRF_SDK_VER.zip" -O /tmp/$NRF_SDK_VER + unzip -q /tmp/$NRF_SDK_VER -d "$TOOLS_DIR/" + rm /tmp/$NRF_SDK_VER +} + +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" \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DUSE_OPENOCD=1 \ + -DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_VER" \ + -DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \ + "$SOURCES_DIR" + cmake -L -N . +} + +CmakeBuild() { + local target="$1" + [[ -n "$target" ]] && target="--target $target" + if cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target -- -j$(nproc) + then return 0; else return 1; + fi +} + +[[ $SOURCED == "false" ]] && main "$@" || echo "Sourced!" \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..fb81d289 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.154.2/containers/cpp +{ + // "name": "Pinetime", + // "image": "feabhas/pinetime-dev" + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick an Debian / Ubuntu OS version: debian-10, debian-9, ubuntu-20.04, ubuntu-18.04 + // "args": { "VARIANT": "ubuntu-20.04" } + }, + "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"], + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-vscode.cpptools" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "gcc -v", + + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + // "remoteUser": "vscode" + "remoteUser": "infinitime" +} \ No newline at end of file From 273a94f298cc96a1415499d00559fed3a741af71 Mon Sep 17 00:00:00 2001 From: "AzureAD\\NiallCooling" Date: Thu, 25 Feb 2021 17:16:01 +0000 Subject: [PATCH 02/17] removed dependency on build.sh --- .devcontainer/Dockerfile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c6a3588f..7e961528 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -22,8 +22,6 @@ RUN apt-get update -qq \ rustc \ && rm -rf /var/cache/apt/* /var/lib/apt/lists/*; -RUN adduser infinitime - RUN pip3 install adafruit-nrfutil # required for McuBoot RUN pip3 install setuptools_rust @@ -34,10 +32,19 @@ COPY build.sh . # Lets get each in a separate docker layer for better downloads # GCC -RUN bash -c "source /opt/build.sh; GetGcc;" +# RUN bash -c "source /opt/build.sh; GetGcc;" +RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 -O - | tar -xj -C /opt +# RUN rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 # NrfSdk -RUN bash -c "source /opt/build.sh; GetNrfSdk;" +# RUN bash -c "source /opt/build.sh; GetNrfSdk;" +RUN wget -q "https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip" -O /tmp/nRF5_SDK_15.3.0_59ac345 +RUN unzip -q /tmp/nRF5_SDK_15.3.0_59ac345 -d /opt +RUN rm /tmp/nRF5_SDK_15.3.0_59ac345 # McuBoot -RUN bash -c "source /opt/build.sh; GetMcuBoot;" +# RUN bash -c "source /opt/build.sh; GetMcuBoot;" +RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git +RUN pip3 install -r ./mcuboot/scripts/requirements.txt + +RUN adduser infinitime ENV SOURCES_DIR /workspaces/Pinetime From 382db668ed513836a52ff4fdc49b0ee7a08a1527 Mon Sep 17 00:00:00 2001 From: Niall Cooling Date: Thu, 25 Feb 2021 17:49:40 +0000 Subject: [PATCH 03/17] macOS and Win10 dockerfile --- .devcontainer/Dockerfile | 5 +++-- .devcontainer/create_build_openocd.sh | 3 +++ .devcontainer/devcontainer.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100755 .devcontainer/create_build_openocd.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 7e961528..2c223bc1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -27,14 +27,15 @@ RUN pip3 install adafruit-nrfutil RUN pip3 install setuptools_rust WORKDIR /opt/ -# build.sh knows how to compile +# build.sh knows how to compile but it problimatic on Win10 COPY build.sh . +# create_build_openocd.sh uses cmake to crate to build directory +COPY create_build_openocd.sh . # Lets get each in a separate docker layer for better downloads # GCC # RUN bash -c "source /opt/build.sh; GetGcc;" RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 -O - | tar -xj -C /opt -# RUN rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 # NrfSdk # RUN bash -c "source /opt/build.sh; GetNrfSdk;" RUN wget -q "https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip" -O /tmp/nRF5_SDK_15.3.0_59ac345 diff --git a/.devcontainer/create_build_openocd.sh b/.devcontainer/create_build_openocd.sh new file mode 100755 index 00000000..860ffa1f --- /dev/null +++ b/.devcontainer/create_build_openocd.sh @@ -0,0 +1,3 @@ +#!/bin/bash +rm -rf build/ +cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DUSE_OPENOCD=1 -DARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update -DNRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345 -S . -Bbuild \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fb81d289..1740a8e4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,7 +24,7 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "gcc -v", + // "postCreateCommand": "/opt/create_build_openocd.sh", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. // "remoteUser": "vscode" From 937d3e19335758ac76607a1d75c8844b49dd3c3e Mon Sep 17 00:00:00 2001 From: Niall Cooling Date: Fri, 26 Feb 2021 08:14:30 +0000 Subject: [PATCH 04/17] added dos2unix to docker for Win10 and default to release build --- .devcontainer/Dockerfile | 1 + .devcontainer/create_build_openocd.sh | 2 +- .devcontainer/devcontainer.json | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2c223bc1..bb7dddba 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -15,6 +15,7 @@ RUN apt-get update -qq \ unzip \ wget \ curl \ + dos2unix \ # aarch64 packages libffi-dev \ libssl-dev \ diff --git a/.devcontainer/create_build_openocd.sh b/.devcontainer/create_build_openocd.sh index 860ffa1f..c5bff5c8 100755 --- a/.devcontainer/create_build_openocd.sh +++ b/.devcontainer/create_build_openocd.sh @@ -1,3 +1,3 @@ #!/bin/bash rm -rf build/ -cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DUSE_OPENOCD=1 -DARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update -DNRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345 -S . -Bbuild \ No newline at end of file +cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DUSE_OPENOCD=1 -DARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update -DNRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345 -S . -Bbuild \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1740a8e4..90b6eceb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,14 +17,15 @@ // Add the IDs of extensions you want installed when the container is created. "extensions": [ - "ms-vscode.cpptools" + "ms-vscode.cpptools", + "ms-vscode.cmake-tools", ], // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "/opt/create_build_openocd.sh", + // "postCreateCommand": "bash /opt/create_build_openocd.sh", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. // "remoteUser": "vscode" From c50f2b70c23ff36de8f290ab0e4408be7eeed62c Mon Sep 17 00:00:00 2001 From: Niall Cooling Date: Fri, 26 Feb 2021 15:09:58 +0000 Subject: [PATCH 05/17] added clang-tidy/format to container --- .devcontainer/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index bb7dddba..55f30136 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,6 +16,8 @@ RUN apt-get update -qq \ wget \ curl \ dos2unix \ + clang-format \ + clang-tidy \ # aarch64 packages libffi-dev \ libssl-dev \ From c0b84537b35fd358e929962a962c53e50019079e Mon Sep 17 00:00:00 2001 From: Niall Cooling Date: Fri, 26 Mar 2021 17:37:01 +0000 Subject: [PATCH 06/17] added extra .sh build files --- .devcontainer/build_app.sh | 2 ++ .devcontainer/make_build_dir.sh | 2 ++ .vscode/c_cpp_properties.json | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 .devcontainer/build_app.sh create mode 100644 .devcontainer/make_build_dir.sh create mode 100644 .vscode/c_cpp_properties.json diff --git a/.devcontainer/build_app.sh b/.devcontainer/build_app.sh new file mode 100644 index 00000000..0f578cc6 --- /dev/null +++ b/.devcontainer/build_app.sh @@ -0,0 +1,2 @@ +#!/bin/bash +cmake --build /workspaces/Pinetime/build --config Release -- -j6 pinetime-app \ No newline at end of file diff --git a/.devcontainer/make_build_dir.sh b/.devcontainer/make_build_dir.sh new file mode 100644 index 00000000..0b86b307 --- /dev/null +++ b/.devcontainer/make_build_dir.sh @@ -0,0 +1,2 @@ +#!/bin/bash +cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DUSE_OPENOCD=1 -DARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update -DNRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345 /workspaces/Pinetime diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 00000000..b409ec98 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,17 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "gnu11", + "cppStandard": "gnu++14", + "intelliSenseMode": "linux-gcc-x64", + "compileCommands": "${workspaceFolder}/build/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file From f7643a4d828ec3c60f418b6d9a660097eb44e05e Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Sun, 25 Jul 2021 20:12:34 +0000 Subject: [PATCH 07/17] Added cmake variants --- .devcontainer/Dockerfile | 17 +++++-- .devcontainer/README.md | 60 +++++++++++++++++++++++++ .devcontainer/build.sh | 0 .devcontainer/create_build_openocd.sh | 0 .devcontainer/devcontainer.json | 1 + .devcontainer/make_build_dir.sh | 2 +- .gitignore | 2 +- .vscode/c_cpp_properties.json | 15 ++++--- .vscode/cmake-variants.json | 62 +++++++++++++++++++++++++ .vscode/launch.json | 46 +++++++++++++++++++ .vscode/settings.json | 65 +++------------------------ .vscode/tasks.json | 44 ++++++++++++++++++ 12 files changed, 245 insertions(+), 69 deletions(-) create mode 100644 .devcontainer/README.md mode change 100755 => 100644 .devcontainer/build.sh mode change 100755 => 100644 .devcontainer/create_build_openocd.sh create mode 100644 .vscode/cmake-variants.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 55f30136..4534c7e2 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:latest ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq \ @@ -18,12 +18,20 @@ RUN apt-get update -qq \ dos2unix \ clang-format \ clang-tidy \ + locales \ + libncurses5 \ # aarch64 packages libffi-dev \ libssl-dev \ python3-dev \ rustc \ && rm -rf /var/cache/apt/* /var/lib/apt/lists/*; + +#SET LOCALE +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 RUN pip3 install adafruit-nrfutil # required for McuBoot @@ -32,9 +40,10 @@ RUN pip3 install setuptools_rust WORKDIR /opt/ # build.sh knows how to compile but it problimatic on Win10 COPY build.sh . +RUN chmod +x build.sh # create_build_openocd.sh uses cmake to crate to build directory COPY create_build_openocd.sh . - +RUN chmod +x create_build_openocd.sh # Lets get each in a separate docker layer for better downloads # GCC # RUN bash -c "source /opt/build.sh; GetGcc;" @@ -51,4 +60,6 @@ RUN pip3 install -r ./mcuboot/scripts/requirements.txt RUN adduser infinitime -ENV SOURCES_DIR /workspaces/Pinetime +ENV NRF5_SDK_PATH /opt/nRF5_SDK_15.3.0_59ac345 +ENV ARM_NONE_EABI_TOOLCHAIN_PATH /opt/gcc-arm-none-eabi-9-2020-q2-update +ENV SOURCES_DIR /workspaces/InfiniTime diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 00000000..ff9307b2 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,60 @@ +# VScode devcontainer +This is a docker-based interactive development environment using VSCode and Docker Devcontainers removing the need to install any tools locally* + + + +## Requirements + +- VScode + - [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension +- Docker +- OpenOCD - For debugging + +## Using + +### Code editing, and building. + +1. Clone InifiniTime and update submodules +2. Launch VSCode +3. Open InifiTime directory, +4. Allow VSCode to open folder with devcontainer. + +After this the environment will be built if you do not currently have a container setup, it will install all the necessary tools and extra VSCode extensions. + +In order to build InfiniTime we need to run the initial submodule init and Cmake commands. + +#### Manually + + You can use the VSCode terminal to run the CMake commands as outlined in the [build instructions](blob/develop/doc/buildAndProgram.md) + +#### Script + +The dev enviroment comes with some scripts to make this easier, They are located in /opt/. + +There are also VSCode tasks provided should you desire to use those. + +The task BuildInit will update submodules and configure for openocd + + + +### Build + +You can use the build.sh script located in /opt/ + +There will also eventually be a Build task. - Not written yet + + + +### Debugging + +Docker on windows does not support passing USB devices to the underlying WSL2 subsystem, To get around this we use openocd in server mode running on the host. + +`openocd -f -f ` + +This will launch openocd in server mode and attach it to the MCU. + +The default launch.json file expects openocd to be listening on port 3333, edit if needed + + +## Current Issues +Currently WSL2 Has some real performance issues with IO on a windows host. Accessing files on the virtualized filesystem is much faster. Using VSCodes "clone in container" feature of the Remote - Containers will get around this. After the container is built you will need to update the submodules and follow the build isntructions like normal \ No newline at end of file diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh old mode 100755 new mode 100644 diff --git a/.devcontainer/create_build_openocd.sh b/.devcontainer/create_build_openocd.sh old mode 100755 new mode 100644 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 90b6eceb..223b651f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -19,6 +19,7 @@ "extensions": [ "ms-vscode.cpptools", "ms-vscode.cmake-tools", + "marus25.cortex-debug" ], // Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/.devcontainer/make_build_dir.sh b/.devcontainer/make_build_dir.sh index 0b86b307..76240037 100644 --- a/.devcontainer/make_build_dir.sh +++ b/.devcontainer/make_build_dir.sh @@ -1,2 +1,2 @@ #!/bin/bash -cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DUSE_OPENOCD=1 -DARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update -DNRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345 /workspaces/Pinetime +cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DUSE_OPENOCD=1 -DARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update -DNRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345 ${SOURCES_DIR} diff --git a/.gitignore b/.gitignore index 2f9ac181..6de76a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ # CMake cmake-build-* -cmake-* +cmake-*/ CMakeFiles **/CMakeCache.txt cmake_install.cmake diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index b409ec98..f5c74b3a 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,15 +1,18 @@ { "configurations": [ { - "name": "Linux", + "name": "nrfCC", "includePath": [ - "${workspaceFolder}/**" + "${workspaceFolder}/**", + "${workspaceFolder}/src/**", + "${workspaceFolder}/src" ], "defines": [], - "compilerPath": "/usr/bin/gcc", - "cStandard": "gnu11", - "cppStandard": "gnu++14", - "intelliSenseMode": "linux-gcc-x64", + "compilerPath": "${env:ARM_NONE_EABI_TOOLCHAIN_PATH}/bin/arm-none-eabi-gcc", + "cStandard": "c11", + "cppStandard": "c++14", + "intelliSenseMode": "linux-gcc-arm", + "configurationProvider": "ms-vscode.cmake-tools", "compileCommands": "${workspaceFolder}/build/compile_commands.json" } ], diff --git a/.vscode/cmake-variants.json b/.vscode/cmake-variants.json new file mode 100644 index 00000000..d00e638e --- /dev/null +++ b/.vscode/cmake-variants.json @@ -0,0 +1,62 @@ +{ + "buildType": { + "default": "release", + "choices": { + "debug": { + "short": "Debug", + "long": "Emit debug information without performing optimizations", + "buildType": "Debug" + }, + "release": { + "short": "Release", + "long": "Perform optimizations", + "buildType": "Release" + } + } + }, + "programmer":{ + "default": "OpenOCD", + "choices":{ + "OpenOCD":{ + "short":"OpenOCD", + "long": "Use OpenOCD", + "settings":{ + "USE_OPENOCD":1 + } + }, + "JLink":{ + "short":"JLink", + "long": "Use JLink", + "settings":{ + "USE_JLINK":1 + } + }, + "GDB":{ + "short":"GDB", + "long": "Use GDB", + "settings":{ + "USE_GDB_CLIENT":1 + } + } + } + }, + "DFU": { + "default": "no", + "choices": { + "no": { + "short": "No DFU", + "long": "Do not build DFU", + "settings": { + "BUILD_DFU":0 + } + }, + "yes": { + "short": "Build DFU", + "long": "Build DFU", + "settings": { + "BUILD_DFU":1 + } + } + } + } +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..78fc1180 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,46 @@ + { + "version": "0.1.0", + "configurations": [ + { + "name": "Debug - Openocd docker Remote", + "type":"cortex-debug", + "cortex-debug.armToolchainPath":"${env:COMPILER_DIR}/bin", + "cwd": "${workspaceRoot}", + "executable": "${command:cmake.launchTargetPath}", + "request": "launch", + "servertype": "external", + // This may need to be arm-none-eabi-gdb depending on your system + "gdbPath" : "${env:COMPILER_DIR}/bin/arm-none-eabi-gdb", + // Connect to an already running OpenOCD instance + "gdbTarget": "host.docker.internal:3333", + "svdFile": "${workspaceRoot}/nrf52.svd", + "runToMain": true, + // Work around for stopping at main on restart + "postRestartCommands": [ + "break main", + "continue" + ] + }, + { + "name": "Debug - Openocd Local", + "type":"cortex-debug", + "cortex-debug.armToolchainPath":"${env:COMPILER_DIR}/bin", + "cwd": "${workspaceRoot}", + "executable": "${command:cmake.launchTargetPath}", + "request": "launch", + "servertype": "openocd", + // This may need to be arm-none-eabi-gdb depending on your system + "gdbPath" : "${env:COMPILER_DIR}/bin/arm-none-eabi-gdb", + // Connect to an already running OpenOCD instance + "gdbTarget": "localhost:3333", + "svdFile": "${workspaceRoot}/nrf52.svd", + "runToMain": true, + // Work around for stopping at main on restart + "postRestartCommands": [ + "break main", + "continue" + ] + } + + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 05b11756..3b686626 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,59 +1,8 @@ { - "files.associations": { - "chrono": "cpp", - "list": "cpp", - "array": "cpp", - "atomic": "cpp", - "bit": "cpp", - "*.tcc": "cpp", - "cctype": "cpp", - "charconv": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "condition_variable": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "deque": "cpp", - "unordered_map": "cpp", - "vector": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "functional": "cpp", - "iterator": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "netfwd": "cpp", - "numeric": "cpp", - "optional": "cpp", - "random": "cpp", - "ratio": "cpp", - "string": "cpp", - "string_view": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "utility": "cpp", - "fstream": "cpp", - "initializer_list": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "limits": "cpp", - "mutex": "cpp", - "new": "cpp", - "ostream": "cpp", - "sstream": "cpp", - "stdexcept": "cpp", - "streambuf": "cpp", - "thread": "cpp", - "cinttypes": "cpp", - "typeinfo": "cpp" - } -} \ No newline at end of file + "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", + "cmake.configureArgs": [ + "-DARM_NONE_EABI_TOOLCHAIN_PATH=${env:ARM_NONE_EABI_TOOLCHAIN_PATH}", + "-DNRF5_SDK_PATH=${env:NRF5_SDK_PATH}", + ], + "cmake.generator": "Unix Makefiles" +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..17f51f5e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,44 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "create openocd build", + "type": "shell", + "command": "/opt/create_build_openocd.sh", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "shared" + }, + "problemMatcher": [] + }, + { + "label": "update submodules", + "type": "shell", + "command": "git submodule update --init", + "options": { + "cwd": "${workspaceFolder}" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "shared" + }, + "problemMatcher": [] + }, + { + "label": "BuildInit", + "dependsOn": [ + "update submodules", + "create openocd build" + ], + "problemMatcher": [] + } + ] +} \ No newline at end of file From e9248b225e78e36ff04f7c26244adf200e17020e Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Mon, 26 Jul 2021 01:14:23 +0000 Subject: [PATCH 08/17] Updated documentation --- .devcontainer/README.md | 4 ++-- .vscode/cmake-variants.json | 4 ++-- .vscode/extensions.json | 3 +++ .vscode/launch.json | 8 +++---- README.md | 1 + doc/buildWithVScode.md | 42 +++++++++++++++++++++++++++++++++++++ 6 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 doc/buildWithVScode.md diff --git a/.devcontainer/README.md b/.devcontainer/README.md index ff9307b2..c8aef574 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -33,7 +33,7 @@ The dev enviroment comes with some scripts to make this easier, They are located There are also VSCode tasks provided should you desire to use those. -The task BuildInit will update submodules and configure for openocd +The task "update submodules" will update the git submodules @@ -41,7 +41,7 @@ The task BuildInit will update submodules and configure for openocd You can use the build.sh script located in /opt/ -There will also eventually be a Build task. - Not written yet +CMake is also configured and controlls for the CMake plugin are available in VSCode diff --git a/.vscode/cmake-variants.json b/.vscode/cmake-variants.json index d00e638e..9c95a631 100644 --- a/.vscode/cmake-variants.json +++ b/.vscode/cmake-variants.json @@ -47,14 +47,14 @@ "short": "No DFU", "long": "Do not build DFU", "settings": { - "BUILD_DFU":0 + "BUILD_DFU":"0" } }, "yes": { "short": "Build DFU", "long": "Build DFU", "settings": { - "BUILD_DFU":1 + "BUILD_DFU":"1" } } } diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..1cc05268 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["ms-vscode.cpptools","ms-vscode.cmake-tools","marus25.cortex-debug"] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 78fc1180..7cf3acd1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,13 +4,13 @@ { "name": "Debug - Openocd docker Remote", "type":"cortex-debug", - "cortex-debug.armToolchainPath":"${env:COMPILER_DIR}/bin", + "cortex-debug.armToolchainPath":"${env:ARM_NONE_EABI_TOOLCHAIN_PATH}/bin", "cwd": "${workspaceRoot}", "executable": "${command:cmake.launchTargetPath}", "request": "launch", "servertype": "external", // This may need to be arm-none-eabi-gdb depending on your system - "gdbPath" : "${env:COMPILER_DIR}/bin/arm-none-eabi-gdb", + "gdbPath" : "${env:ARM_NONE_EABI_TOOLCHAIN_PATH}/bin/arm-none-eabi-gdb", // Connect to an already running OpenOCD instance "gdbTarget": "host.docker.internal:3333", "svdFile": "${workspaceRoot}/nrf52.svd", @@ -24,13 +24,13 @@ { "name": "Debug - Openocd Local", "type":"cortex-debug", - "cortex-debug.armToolchainPath":"${env:COMPILER_DIR}/bin", + "cortex-debug.armToolchainPath":"${env:ARM_NONE_EABI_TOOLCHAIN_PATH}/bin", "cwd": "${workspaceRoot}", "executable": "${command:cmake.launchTargetPath}", "request": "launch", "servertype": "openocd", // This may need to be arm-none-eabi-gdb depending on your system - "gdbPath" : "${env:COMPILER_DIR}/bin/arm-none-eabi-gdb", + "gdbPath" : "${env:ARM_NONE_EABI_TOOLCHAIN_PATH}/bin/arm-none-eabi-gdb", // Connect to an already running OpenOCD instance "gdbTarget": "localhost:3333", "svdFile": "${workspaceRoot}/nrf52.svd", diff --git a/README.md b/README.md index bd23c867..4b067dce 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ As of now, here is the list of achievements of this project: - [Build the project](doc/buildAndProgram.md) - [Flash the firmware using OpenOCD and STLinkV2](doc/openOCD.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. diff --git a/doc/buildWithVScode.md b/doc/buildWithVScode.md new file mode 100644 index 00000000..31174d1c --- /dev/null +++ b/doc/buildWithVScode.md @@ -0,0 +1,42 @@ +# Build and Develop the project using VS Code + +The .VSCode folder contains configuration files for developing InfiniTime with VS Code. Effort was made to have these rely on Environment variables instead of hardcoded paths. + +## 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 VSCode + +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) + + + + + From 7f2ee62aedd359d34af6569bc691e216a49a7f5d Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Mon, 26 Jul 2021 15:43:48 +0000 Subject: [PATCH 09/17] Typos for days --- .devcontainer/README.md | 32 ++++++++++++++++---------------- doc/buildWithVScode.md | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index c8aef574..1932a9d4 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,11 +1,11 @@ -# VScode devcontainer -This is a docker-based interactive development environment using VSCode and Docker Devcontainers removing the need to install any tools locally* +# VS Code Dev Container +This is a docker-based interactive development environment using VS Code and Docker Dev Containers removing the need to install any tools locally* ## Requirements -- VScode +- VS Code - [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension - Docker - OpenOCD - For debugging @@ -14,24 +14,24 @@ This is a docker-based interactive development environment using VSCode and Dock ### Code editing, and building. -1. Clone InifiniTime and update submodules -2. Launch VSCode -3. Open InifiTime directory, -4. Allow VSCode to open folder with devcontainer. +1. Clone InfiniTime and update submodules +2. Launch VS Code +3. Open InfiniTime directory, +4. Allow VS Code to open folder with devcontainer. After this the environment will be built if you do not currently have a container setup, it will install all the necessary tools and extra VSCode extensions. -In order to build InfiniTime we need to run the initial submodule init and Cmake commands. +In order to build InfiniTime we need to run the initial submodule init and CMake commands. #### Manually - You can use the VSCode terminal to run the CMake commands as outlined in the [build instructions](blob/develop/doc/buildAndProgram.md) + You can use the VS Code terminal to run the CMake commands as outlined in the [build instructions](blob/develop/doc/buildAndProgram.md) #### Script -The dev enviroment comes with some scripts to make this easier, They are located in /opt/. +The dev environment comes with some scripts to make this easier, They are located in /opt/. -There are also VSCode tasks provided should you desire to use those. +There are also VS Code tasks provided should you desire to use those. The task "update submodules" will update the git submodules @@ -41,20 +41,20 @@ The task "update submodules" will update the git submodules You can use the build.sh script located in /opt/ -CMake is also configured and controlls for the CMake plugin are available in VSCode +CMake is also configured and controls for the CMake plugin are available in VS Code ### Debugging -Docker on windows does not support passing USB devices to the underlying WSL2 subsystem, To get around this we use openocd in server mode running on the host. +Docker on windows does not support passing USB devices to the underlying WSL2 subsystem, To get around this we use OpenOCD in server mode running on the host. `openocd -f -f ` -This will launch openocd in server mode and attach it to the MCU. +This will launch OpenOCD in server mode and attach it to the MCU. -The default launch.json file expects openocd to be listening on port 3333, edit if needed +The default launch.json file expects OpenOCD to be listening on port 3333, edit if needed ## Current Issues -Currently WSL2 Has some real performance issues with IO on a windows host. Accessing files on the virtualized filesystem is much faster. Using VSCodes "clone in container" feature of the Remote - Containers will get around this. After the container is built you will need to update the submodules and follow the build isntructions like normal \ No newline at end of file +Currently WSL2 Has some real performance issues with IO on a windows host. Accessing files on the virtualized filesystem is much faster. Using VS Codes "clone in container" feature of the Remote - Containers will get around this. After the container is built you will need to update the submodules and follow the build instructions like normal \ No newline at end of file diff --git a/doc/buildWithVScode.md b/doc/buildWithVScode.md index 31174d1c..c1df17b7 100644 --- a/doc/buildWithVScode.md +++ b/doc/buildWithVScode.md @@ -1,6 +1,6 @@ # Build and Develop the project using VS Code -The .VSCode folder contains configuration files for developing InfiniTime with VS Code. Effort was made to have these rely on Environment variables instead of hardcoded paths. +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. ## Environment Setup @@ -22,7 +22,7 @@ We leverage a few VS Code extensions for ease of development. #### Optional Extensions -[Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) - ARM Cortex-M GDB Debugger support for VSCode +[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. From d2dc719b318a256d3d6f2fea3bdcf30c5eb40969 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Sun, 8 Aug 2021 22:51:31 +0000 Subject: [PATCH 10/17] Fix intellisense --- .vscode/c_cpp_properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index f5c74b3a..f8da48d5 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -12,7 +12,7 @@ "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "linux-gcc-arm", - "configurationProvider": "ms-vscode.cmake-tools", + "configurationProvider": "ms-vscode.cpp-tools", "compileCommands": "${workspaceFolder}/build/compile_commands.json" } ], From 44889adda074af2a7a5fe61b19667521755dd24d Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Mon, 9 Aug 2021 00:16:17 +0000 Subject: [PATCH 11/17] Setup plugins for Clang-tidy/format --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 4 +++- .vscode/settings.json | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4534c7e2..1dd68f24 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update -qq \ wget \ curl \ dos2unix \ - clang-format \ + clang-format-12 \ clang-tidy \ locales \ libncurses5 \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 223b651f..778fe9cb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -19,7 +19,9 @@ "extensions": [ "ms-vscode.cpptools", "ms-vscode.cmake-tools", - "marus25.cortex-debug" + "marus25.cortex-debug", + "notskm.clang-tidy", + "mjohns.clang-format" ], // Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/.vscode/settings.json b/.vscode/settings.json index 3b686626..8f0e63f4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,6 @@ "-DARM_NONE_EABI_TOOLCHAIN_PATH=${env:ARM_NONE_EABI_TOOLCHAIN_PATH}", "-DNRF5_SDK_PATH=${env:NRF5_SDK_PATH}", ], - "cmake.generator": "Unix Makefiles" + "cmake.generator": "Unix Makefiles", + "clang-tidy.buildPath": "build/compile_commands.json" } From f0e9d13329f5647a8e55b89d167f8306d58cb518 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 14 Aug 2021 21:58:38 +0300 Subject: [PATCH 12/17] Update contribute.md (#475) * Update contribute.md * Add newlines and remove spaces * Replace CONTRIBUTING.md with doc/contribute.md --- CONTRIBUTING.md | 34 +-------------------------- doc/contribute.md | 59 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 52 deletions(-) mode change 100644 => 120000 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index a6fa6828..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,33 +0,0 @@ -This contribution guide is in progress, improvements are welcome. - -### Code style - -Any C++ code PRs should aim to follow the style of existing code in the project. - -Using an autoformatter is heavily recommended, but make sure it's configured properly. - -There's currently preconfigured autoformatter rules for: - - * CLion (IntelliJ) in .idea/codeStyles/Project.xml - -You can use those to configure your own IDE if it's not already on the list. - -#### Linting errors and compiler warnings - -Try to avoid any currently enabled warnings and try to reduce the amount of linter errors. - -#### Spelling - -Make sure you spellcheck your code before commiting it. - -#### TODO, FIXME - -Check before commiting that you haven't forgotten anything, preferably don't leave these in your commits. - -#### Licence headers - -You should add your name to the comma-space separated list of contributors if there's a license header. - -### License - -By contributing you agree to licence your code under the repository's general license (which is currently GPL-v3+). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 120000 index 00000000..15e2c684 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +doc/contribute.md \ No newline at end of file diff --git a/doc/contribute.md b/doc/contribute.md index 9f4c2154..0c34e2a5 100644 --- a/doc/contribute.md +++ b/doc/contribute.md @@ -1,68 +1,89 @@ # How to contribute? + ## Report bugs -You use your Pinetime and find a bug in the firmware? [Create an issue on Github](https://github.com/JF002/InfiniTime/issues) explaining the bug, how to reproduce it, the version of the firmware you use... + +Have you found a bug in the firmware? [Create an issue on Github](https://github.com/JF002/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*. + ## 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! + +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 + - 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); - Clean your code and remove files that are not needed; - - Write documentation related to your new feature is applicable; - - Create the pull-request and write a great description about it : what does your PR do, why, how,... Add pictures and video if possible; + - 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 contribution is more than welcome! +Your contributions are more than welcome! -If you want to fix a bug, add a 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 per topic. +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. -I **strongly discourage to create a PR containing modifications that haven't been tested**. 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. -Do not forget to check the files you are going to commit and remove those who are not necessary (config files from your IDE, for example). Remove old comments, commented 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 is it 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. +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 merge in **develop** and will be released in the next release version of the firmware. +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** for the creator of this project ([JF002](https://github.com/JF002)) and for other contributors who take the time to review them. Every little thing you do to make their lives easier will **increase the chances your PR will be merge quickly**. -When reviewing PR, 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. +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**. -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, and we won't be able to merge the PR because of the changes that are not accepted. +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. -We do our best to keep the code as consistent as possible, and that means we pay attention to the **formatting** of the code. If the code formatting is not consistent with our code base, we'll ask you to review it, which will take more time. +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. -The last step of the review consists in **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. +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. -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, and it's good practice to try to reduce them as much as possible by following those simple rules. +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. + +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. -It's OK to include C code if this code comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK. +## 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 From e51c3eee4ed50ccec55c105fd93a46b7715601b3 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 9 Aug 2021 21:49:35 +0300 Subject: [PATCH 13/17] Try to fix bootloop --- src/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index ffbba5e7..a18c3942 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,7 @@ #include #include #include +#include // nimble #define min // workaround: nimble's min/max macros conflict with libstdc++ @@ -300,6 +301,14 @@ int main(void) { nrf_drv_clock_init(); + // Unblock i2c? + nrf_gpio_cfg_output(pinTwiScl); + for (uint8_t i = 0; i < 16; i++) { + nrf_gpio_pin_toggle(pinTwiScl); + nrf_delay_us(5); + } + nrf_gpio_cfg_default(pinTwiScl); + debounceTimer = xTimerCreate("debounceTimer", 200, pdFALSE, (void*) 0, DebounceTimerCallback); debounceChargeTimer = xTimerCreate("debounceTimerCharge", 200, pdFALSE, (void*) 0, DebounceTimerChargeCallback); From 10f610b2191ed0783a2f36a5e869019fc548aa24 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 9 Aug 2021 22:07:06 +0300 Subject: [PATCH 14/17] Better pin configuration --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a18c3942..39d8906c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -302,7 +302,12 @@ int main(void) { nrf_drv_clock_init(); // Unblock i2c? - nrf_gpio_cfg_output(pinTwiScl); + nrf_gpio_cfg(pinTwiScl, + NRF_GPIO_PIN_DIR_OUTPUT, + NRF_GPIO_PIN_INPUT_DISCONNECT, + NRF_GPIO_PIN_NOPULL, + NRF_GPIO_PIN_S0D1, + NRF_GPIO_PIN_NOSENSE); for (uint8_t i = 0; i < 16; i++) { nrf_gpio_pin_toggle(pinTwiScl); nrf_delay_us(5); From 7c28de0b6fa7fa33ff10d09847742a35de26cf2b Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 9 Aug 2021 22:11:35 +0300 Subject: [PATCH 15/17] Set pin before loop --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index 39d8906c..d301be67 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -308,6 +308,7 @@ int main(void) { NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0D1, NRF_GPIO_PIN_NOSENSE); + nrf_gpio_pin_set(pinTwiScl); for (uint8_t i = 0; i < 16; i++) { nrf_gpio_pin_toggle(pinTwiScl); nrf_delay_us(5); From 61927751612a9dc8e53fe7882c1e576a90843bc4 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 13 Aug 2021 22:03:27 +0300 Subject: [PATCH 16/17] Improve metronome --- src/displayapp/DisplayApp.cpp | 1 + src/displayapp/screens/Metronome.cpp | 119 ++++++++++----------------- src/displayapp/screens/Metronome.h | 48 +++++------ 3 files changed, 69 insertions(+), 99 deletions(-) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index d4a73f5e..49a56a07 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -414,6 +414,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) break; case Apps::Metronome: currentScreen = std::make_unique(this, motorController, *systemTask); + ReturnApp(Apps::Launcher, FullRefreshDirections::Down, TouchEvents::None); break; case Apps::Motion: currentScreen = std::make_unique(this, motionController); diff --git a/src/displayapp/screens/Metronome.cpp b/src/displayapp/screens/Metronome.cpp index 7bfbccb7..ce23cc3e 100644 --- a/src/displayapp/screens/Metronome.cpp +++ b/src/displayapp/screens/Metronome.cpp @@ -1,35 +1,15 @@ #include "Metronome.h" - -#include "Screen.h" #include "Symbols.h" -#include "lvgl/lvgl.h" -#include "FreeRTOSConfig.h" -#include "task.h" - -#include -#include using namespace Pinetime::Applications::Screens; namespace { - float calculateDelta(const TickType_t startTime, const TickType_t currentTime) { - TickType_t delta = 0; - // Take care of overflow - if (startTime > currentTime) { - delta = 0xffffffff - startTime; - delta += (currentTime + 1); - } else { - delta = currentTime - startTime; - } - return static_cast(delta) / static_cast(configTICK_RATE_HZ); - } - - static void eventHandler(lv_obj_t* obj, lv_event_t event) { - Metronome* screen = static_cast(obj->user_data); + void eventHandler(lv_obj_t* obj, lv_event_t event) { + auto* screen = static_cast(obj->user_data); screen->OnEvent(obj, event); } - lv_obj_t* createLabel(const char* name, lv_obj_t* reference, lv_align_t align, lv_font_t* font, uint8_t x = 0, uint8_t y = 0) { + lv_obj_t* createLabel(const char* name, lv_obj_t* reference, lv_align_t align, lv_font_t* font, uint8_t x, uint8_t y) { lv_obj_t* label = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font); lv_obj_set_style_local_text_color(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY); @@ -41,7 +21,7 @@ namespace { } Metronome::Metronome(DisplayApp* app, Controllers::MotorController& motorController, System::SystemTask& systemTask) - : Screen(app), running {true}, currentState {States::Stopped}, startTime {}, motorController {motorController}, systemTask {systemTask} { + : Screen(app), motorController {motorController}, systemTask {systemTask} { bpmArc = lv_arc_create(lv_scr_act(), nullptr); bpmArc->user_data = this; @@ -52,10 +32,10 @@ Metronome::Metronome(DisplayApp* app, Controllers::MotorController& motorControl lv_arc_set_value(bpmArc, bpm); lv_obj_set_size(bpmArc, 210, 210); lv_arc_set_adjustable(bpmArc, true); - lv_obj_align(bpmArc, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 7); + lv_obj_align(bpmArc, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 0); - bpmValue = createLabel(std::to_string(lv_arc_get_value(bpmArc)).c_str(), bpmArc, LV_ALIGN_IN_TOP_MID, &jetbrains_mono_76, 0, 55); - bpmLegend = createLabel("bpm", bpmValue, LV_ALIGN_OUT_BOTTOM_MID, &jetbrains_mono_bold_20, 0, 0); + bpmValue = createLabel("120", bpmArc, LV_ALIGN_IN_TOP_MID, &jetbrains_mono_76, 0, 55); + createLabel("bpm", bpmValue, LV_ALIGN_OUT_BOTTOM_MID, &jetbrains_mono_bold_20, 0, 0); bpmTap = lv_btn_create(lv_scr_act(), nullptr); bpmTap->user_data = this; @@ -69,20 +49,23 @@ Metronome::Metronome(DisplayApp* app, Controllers::MotorController& motorControl lv_obj_set_event_cb(bpbDropdown, eventHandler); lv_obj_set_style_local_pad_left(bpbDropdown, LV_DROPDOWN_PART_MAIN, LV_STATE_DEFAULT, 20); lv_obj_set_style_local_pad_left(bpbDropdown, LV_DROPDOWN_PART_LIST, LV_STATE_DEFAULT, 20); - lv_obj_align(bpbDropdown, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 15, -4); + lv_obj_set_size(bpbDropdown, 115, 50); + lv_obj_align(bpbDropdown, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); lv_dropdown_set_options(bpbDropdown, "1\n2\n3\n4\n5\n6\n7\n8\n9"); lv_dropdown_set_selected(bpbDropdown, bpb - 1); - bpbLegend = lv_label_create(bpbDropdown, nullptr); - lv_label_set_text(bpbLegend, "bpb"); - lv_obj_align(bpbLegend, bpbDropdown, LV_ALIGN_IN_RIGHT_MID, -15, 0); + lv_dropdown_set_show_selected(bpbDropdown, false); + lv_dropdown_set_text(bpbDropdown, ""); + + currentBpbText = lv_label_create(bpbDropdown, nullptr); + lv_label_set_text_fmt(currentBpbText, "%d bpb", bpb); + lv_obj_align(currentBpbText, bpbDropdown, LV_ALIGN_CENTER, 0, 0); playPause = lv_btn_create(lv_scr_act(), nullptr); playPause->user_data = this; lv_obj_set_event_cb(playPause, eventHandler); - lv_obj_align(playPause, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -15, -10); - lv_obj_set_height(playPause, 39); - playPauseLabel = lv_label_create(playPause, nullptr); - lv_label_set_text(playPauseLabel, Symbols::play); + lv_obj_set_size(playPause, 115, 50); + lv_obj_align(playPause, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0); + lv_obj_set_style_local_value_str(playPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Symbols::play); app->SetTouchMode(DisplayApp::TouchModes::Polling); } @@ -93,28 +76,17 @@ Metronome::~Metronome() { lv_obj_clean(lv_scr_act()); } -bool Metronome::OnTouchEvent(Pinetime::Applications::TouchEvents event) { - return true; -} - bool Metronome::Refresh() { - switch (currentState) { - case States::Stopped: { - break; - } - case States::Running: { - if (calculateDelta(startTime, xTaskGetTickCount()) >= (60.0 / bpm)) { - counter--; - startTime -= 60.0 / bpm; - startTime = xTaskGetTickCount(); - if (counter == 0) { - counter = bpb; - motorController.SetDuration(90); - } else { - motorController.SetDuration(30); - } + if (metronomeStarted) { + if (xTaskGetTickCount() - startTime > 60 * configTICK_RATE_HZ / bpm) { + startTime += 60 * configTICK_RATE_HZ / bpm; + counter--; + if (counter == 0) { + counter = bpb; + motorController.SetDuration(90); + } else { + motorController.SetDuration(30); } - break; } } return running; @@ -128,42 +100,39 @@ void Metronome::OnEvent(lv_obj_t* obj, lv_event_t event) { lv_label_set_text_fmt(bpmValue, "%03d", bpm); } else if (obj == bpbDropdown) { bpb = lv_dropdown_get_selected(obj) + 1; + lv_label_set_text_fmt(currentBpbText, "%d bpb", bpb); + lv_obj_realign(currentBpbText); } break; } case LV_EVENT_PRESSED: { if (obj == bpmTap) { - float timeDelta = calculateDelta(tappedTime, xTaskGetTickCount()); - if (tappedTime == 0 || timeDelta > 3) { - tappedTime = xTaskGetTickCount(); - } else { - bpm = ceil(60.0 / timeDelta); + TickType_t delta = xTaskGetTickCount() - tappedTime; + if (tappedTime != 0 && delta < configTICK_RATE_HZ * 3) { + bpm = configTICK_RATE_HZ * 60 / delta; lv_arc_set_value(bpmArc, bpm); lv_label_set_text_fmt(bpmValue, "%03d", bpm); - tappedTime = xTaskGetTickCount(); } + tappedTime = xTaskGetTickCount(); } break; } case LV_EVENT_CLICKED: { if (obj == playPause) { - currentState = (currentState == States::Stopped ? States::Running : States::Stopped); - switch (currentState) { - case States::Stopped: { - lv_label_set_text(playPauseLabel, Symbols::play); - systemTask.PushMessage(System::Messages::EnableSleeping); - break; - } - case States::Running: { - lv_label_set_text(playPauseLabel, Symbols::pause); - systemTask.PushMessage(System::Messages::DisableSleeping); - startTime = xTaskGetTickCount(); - counter = 1; - break; - } + metronomeStarted = !metronomeStarted; + if (metronomeStarted) { + lv_obj_set_style_local_value_str(playPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Symbols::pause); + systemTask.PushMessage(System::Messages::DisableSleeping); + startTime = xTaskGetTickCount(); + counter = 1; + } else { + lv_obj_set_style_local_value_str(playPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Symbols::play); + systemTask.PushMessage(System::Messages::EnableSleeping); } } break; } + default: + break; } } diff --git a/src/displayapp/screens/Metronome.h b/src/displayapp/screens/Metronome.h index 3a1f1084..a4baa096 100644 --- a/src/displayapp/screens/Metronome.h +++ b/src/displayapp/screens/Metronome.h @@ -3,32 +3,32 @@ #include "systemtask/SystemTask.h" #include "components/motor/MotorController.h" -#include +namespace Pinetime { + namespace Applications { + namespace Screens { -namespace Pinetime::Applications::Screens { + class Metronome : public Screen { + public: + Metronome(DisplayApp* app, Controllers::MotorController& motorController, System::SystemTask& systemTask); + ~Metronome() override; + bool Refresh() override; + void OnEvent(lv_obj_t* obj, lv_event_t event); - class Metronome : public Screen { - public: - Metronome(DisplayApp* app, Controllers::MotorController& motorController, System::SystemTask& systemTask); - ~Metronome() override; - bool Refresh() override; - bool OnTouchEvent(TouchEvents event) override; - void OnEvent(lv_obj_t* obj, lv_event_t event); - enum class States { Running, Stopped }; + private: + TickType_t startTime = 0; + TickType_t tappedTime = 0; + Controllers::MotorController& motorController; + System::SystemTask& systemTask; + int16_t bpm = 120; + uint8_t bpb = 4; + uint8_t counter = 1; - private: - bool running; - States currentState; - TickType_t startTime; - TickType_t tappedTime = 0; - Controllers::MotorController& motorController; - System::SystemTask& systemTask; - uint16_t bpm = 120; - uint8_t bpb = 4; - uint8_t counter = 1; + bool metronomeStarted = false; - lv_obj_t *bpmArc, *bpmTap, *bpmValue, *bpmLegend; - lv_obj_t *bpbDropdown, *bpbLegend; - lv_obj_t *playPause, *playPauseLabel; - }; + lv_obj_t *bpmArc, *bpmTap, *bpmValue; + lv_obj_t *bpbDropdown, *currentBpbText; + lv_obj_t *playPause; + }; + } + } } From dec4bab33496527e43850742a4b3dafd753eab83 Mon Sep 17 00:00:00 2001 From: Martin Hub Date: Sat, 14 Aug 2021 21:24:26 +0200 Subject: [PATCH 17/17] Add VSCode ST-link debug config (#567) --- .vscode/launch.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 7cf3acd1..3d9aa789 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -40,7 +40,25 @@ "break main", "continue" ] + }, + { + "cwd": "${workspaceRoot}", + // TODO: find better way to get latest build filename + "executable": "./build/src/pinetime-app-1.3.0.out", + "name": "Debug OpenOCD ST-LINK pinetime-app-1.3.0.out", + "request": "launch", + "type": "cortex-debug", + "showDevDebugOutput": false, + "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", + "svdFile": "${workspaceRoot}/nrf52.svd", + "configFiles": [ + "interface/stlink.cfg", + "target/nrf52.cfg" + ], } ] -} \ No newline at end of file +}