This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Zephyr nrf sdk automated build server with docker image

Hello,

I am trying to setup a windows docker image to use on a build server for zephyr nrfsdk projects, but i am haveing difficulty getting things configured correctly.

For setting up the sdk, I am using this powershell script (which seems to be working correctly):

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[string]$ncs_path = "C:/ncs"
function Install-Nrf-Sdk {
param (
[string]$version
)
[string]$sdk_path = "$ncs_path/$version"
[string]$venv_path = "$sdk_path/python-env"
python -m pip install virtualenv
python -m venv "$venv_path"
. "$venv_path/Scripts/activate.ps1"
python -m pip install west
west init -m https://github.com/nrfconnect/sdk-nrf --mr $version "$sdk_path"
$Env:ZEPHYR_BASE = "$sdk_path"
west update
pip3 install -r "$sdk_path/zephyr/scripts/requirements.txt"
pip3 install -r "$sdk_path/nrf/scripts/requirements.txt"
pip3 install -r "$sdk_path/bootloader/mcuboot/scripts/requirements.txt"
deactivate
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 For the project build step, the projects use custom boards and have `set(BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/)` in the `CMakeList.txt` and the working directory is set to the project directory. Then this powershell script is run:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[string]$ncs_path = "C:/ncs"
[string]$version = "$(SDK_VERSION)"
[string]$sdk_path = "$ncs_path/$version"
[string]$venv_path = "$sdk_path/python-env"
. "$venv_path/Scripts/activate.ps1"
$Env:ZEPHYR_BASE="$sdk_path\zephyr"
. "$Env:ZEPHYR_BASE\zephyr-env.cmd"
west zephyr-export
$Env:ZEPHYR_TOOLCHAIN_VARIANT="gnuarmemb"
$Env:GNUARMEMB_TOOLCHAIN_PATH="C:/Tools/arm-eabi"
cmake . -G "Ninja" -DCMAKE_BUILD_TYPE=RELEASE -DBOARD="$(BOARD_TYPE)" -DCONF_FILE="Release.conf" -B ./build
ninja -C ./build
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But the build is failing 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Zephyr (C:/ncs/v1.6.1/zephyr/share/zephyr-package/cmake)
has been added to the user package registry in:
HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\Zephyr
ZephyrUnittest (C:/ncs/v1.6.1/zephyr/share/zephyrunittest-package/cmake)
has been added to the user package registry in:
HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\ZephyrUnittest
Including boilerplate (Zephyr base (cached)): C:/ncs/v1.6.1/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/azp/agent/_work/1/s/Embedded.Firmware.TagBeacon.RTOS
-- Zephyr version: 2.6.0-rc1 (C:/ncs/v1.6.1/zephyr), build: v2.6.0-rc1-ncs1
-- Found west (found suitable version "0.11.0", minimum required is "0.7.1")
-- Board: core_plt003
-- Cache files will be written to: C:/ncs/v1.6.1/zephyr/.cache
CMake Error at C:/ncs/v1.6.1/zephyr/cmake/generic_toolchain.cmake:36 (include):
include could not find load file:
C:\Tools\arm-eabi/cmake/toolchain/gnuarmemb/generic.cmake
Call Stack (most recent call first):
C:/ncs/v1.6.1/zephyr/cmake/app/boilerplate.cmake:553 (include)
C:/ncs/v1.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is there any documentation on how to correctly setup a build server?