nrf9160 build problem (fatal error: dt-bindings/i2c/i2c.h: No such file or directory)

UPDATES after original posting:

I now remember having the same problem described below, once before on my windows installation.
At that time I decided to switch and reinstall everything in a virtual Ubuntu dedicated only to this project,
meaning that I never solved the original problem !!

I have now found the problem and it it turns out that several folder in the zephyr/include was empty (including the dt-bindings/*.*).
After a git restore everything works fine !!

Now I'm sitting back wondering if some of the scripts causes this problem in rare situations !! ?? 



I'm  suddenly unable til build any of my nrf9160 project and I have no idea what is wrong !!

I switch and tried build a simple hello-world that used to work but gets the same build error as listed below.

And if i try to load/build the same from SES , it the same.

I have seen problems when using west 0.7.0 and have manually switch to use 0.6.3

$ cmake -B build -GNinja  -DBOARD=nrf9160_pca20035ns
$  west build -t menuconfig
$ west build -p auto -b nrf9160_pca20035ns
$ west build

$ west build
-- west build: build configuration:
source directory: /home/jesper/Desktop/Projects/nordic/ncs/nrf/samples/icarus/hello_world
build directory: /home/jesper/Desktop/Projects/nordic/ncs/nrf/samples/icarus/hello_world/build (created)
BOARD: nrf9160_pca20035ns (origin: configfile)
-- west build: generating a build system
-- Zephyr version: 2.1.99
-- Found PythonInterp: /usr/bin/python3.6 (found suitable version "3.6.9", minimum required is "3.6") 
-- Selected BOARD nrf9160_pca20035ns
-- Found west: /home/jesper/.local/bin/west (found suitable version "0.6.3", minimum required is "0.6.0")
-- Loading /home/jesper/Desktop/Projects/nordic/ncs/nrf/boards/arm/nrf9160_pca20035/nrf9160_pca20035ns.dts as base
In file included from /home/jesper/Desktop/Projects/nordic/ncs/zephyr/dts/arm/nordic/nrf9160ns_sica.dtsi:8,
from /home/jesper/Desktop/Projects/nordic/ncs/nrf/boards/arm/nrf9160_pca20035/nrf9160_pca20035ns.dts:8,
from <command-line>:
/home/jesper/Desktop/Projects/nordic/ncs/zephyr/dts/arm/nordic/nrf9160ns.dtsi:8:10: fatal error: dt-bindings/i2c/i2c.h: No such file or directory
8 | #include <dt-bindings/i2c/i2c.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMake Error at /home/jesper/Desktop/Projects/nordic/ncs/zephyr/cmake/dts.cmake:140 (message):
command failed with return code: 1
Call Stack (most recent call first):
/home/jesper/Desktop/Projects/nordic/ncs/zephyr/cmake/app/boilerplate.cmake:460 (include)
CMakeLists.txt:5 (include)

-- Configuring incomplete, errors occurred!
ERROR: command exited with status 1: /snap/bin/cmake -B/home/jesper/Desktop/Projects/nordic/ncs/nrf/samples/icarus/hello_world/build -S/home/jesper/Desktop/Projects/nordic/ncs/nrf/samples/icarus/hello_world -GNinja -DBOARD=nrf9160_pca20035ns

Building twice (without deleting build folder) gives this 

$ west build
-- west build: build configuration:
       source directory: /home/jesper/Desktop/Projects/icarus/hello_world
       build directory: /home/jesper/Desktop/Projects/nordic/ncs/nrf/samples/icarus/hello_world/build
       BOARD: nrf9160_pca20035ns (origin: CMakeCache.txt)
-- west build: building application
Error: could not find CMAKE_PROJECT_NAME in Cache


#include <zephyr.h>
#include <kernel_structs.h>
#include <sys/printk.h>
#include <stdio.h>

void main(void)
	printf("Hello World\n");


# General config


path = nrf
board = nrf9160_pca20035ns

No Data
  • Btw .. I'm using the following versions.

    $ dtc --version
    Version: DTC 1.4.7

    $ cmake --version
    cmake version 3.17.0

    CMake suite maintained and supported by Kitware (

    $ make --version
    GNU Make 4.1
    Built for x86_64-pc-linux-gnu
    Copyright (C) 1988-2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    $ arm-none-eabi-g++ --version
    arm-none-eabi-g++ (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
    Copyright (C) 2019 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO

    $ west --version
    West version: v0.6.3

No Data