Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ src/arm-none-eabi
node_modules
package.json
package-lock.json

# Toolchain and External dependencies
sdk-toolchain/

# Developer files
CMakeUserPresets.json
compile_commands.json
23 changes: 23 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": 6,
"configurePresets": [
{
"binaryDir": "build/${presetName}",
"name": "Release",
"displayName": "Release build",
"cacheVariables": {
"ARM_NONE_EABI_TOOLCHAIN_PATH": "${fileDir}/sdk-toolchain/gcc-arm-none-eabi-10.3-2021.10",
"NRF5_SDK_PATH": "${fileDir}/sdk-toolchain/nRF5_SDK_15.3.0_59ac345",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_DFU": "1",
"BUILD_RESOURCES": "1"
}
}
],
"buildPresets": [
{
"name": "Release",
"configurePreset": "Release"
}
]
}
40 changes: 37 additions & 3 deletions doc/buildAndProgram.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ To build this project, you'll need:
python -m venv .venv
source .venv/bin/activate
python -m pip install wheel
python -m pip install -r tools/mcuboot/requirements.txt
python -m pip install -r tools/mcuboot/requirements.txt adafruit-nrfutil
```
- A reasonably recent version of CMake (I use 3.16.5)
- A reasonably recent version of CMake (minimum 3.10)
- 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)
Expand All @@ -24,7 +24,7 @@ To build this project, you'll need:

### Clone the repo

```
```sh
git clone https://github.com/InfiniTimeOrg/InfiniTime.git
cd InfiniTime
git submodule update --init
Expand All @@ -34,6 +34,40 @@ cd build

### Project generation using CMake

#### CMakePresets

Note that this requires CMake 3.19 or later to be installed.
This project provides a `CMakePresets.json` file, enabling easy and fast development with modern editors such as VSCode, neovim or CLion.
The `CMakePresets.json` file looks for the arm-gcc toolchain and NRF52 SDK in the `sdk-toolchain` directory.
So to download and extract these in the correct directory, do the following:

```sh
mkdir -p sdk-toolchain

# Get the nRF5 SDK
wget https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/sdks/nrf5/binaries/nrf5sdk153059ac345.zip
mv nrf5sdk153059ac345.zip sdk-toolchain/
cd sdk-toolchain
unzip nrf5sdk153059ac345.zip
cd -

# Get the arm cross compiler (There's probably a more linux-y way of doing this though...)
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
mv gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 sdk-toolchain/
cd sdk-toolchain
tar xjf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
cd -
```

To use the presets, simply call `cmake` like so (make sure you have activated the python virtual environment as described [above](##dependencies)):

```sh
cmake --preset Release
cmake --build build/Release
```

#### CMake Variables

CMake configures the project according to variables you specify the command line. The variables are:

Variable | Description | Example|
Expand Down