Added cmake variants
This commit is contained in:
@@ -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
|
||||
|
60
.devcontainer/README.md
Normal file
60
.devcontainer/README.md
Normal file
@@ -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 <yourinterface> -f <nrf52.cfg target file>`
|
||||
|
||||
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
|
0
.devcontainer/build.sh
Executable file → Normal file
0
.devcontainer/build.sh
Executable file → Normal file
0
.devcontainer/create_build_openocd.sh
Executable file → Normal file
0
.devcontainer/create_build_openocd.sh
Executable file → Normal file
@@ -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.
|
||||
|
@@ -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}
|
||||
|
Reference in New Issue
Block a user