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

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 !! ?? 

/Jesper

-------------------------------

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

main.c

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


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

prj.conf

# General config
CONFIG_ASSERT=y

.west/config

[manifest]
path = nrf
[build]
board = nrf9160_pca20035ns

Parents
  • Hi,

     

    Does it work if you try another board, for instance nrf9160_pca10090ns ?

    If it does; then try adding this line to the CMakeLists.txt file:

    https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/applications/asset_tracker/CMakeLists.txt#L11

     

    Just add it below "cmake_minimum_required" line.

     

    The reason why the thingy:91 board doesn't work with zephyr samples (ie: samples outside of the nrf repo), is that the board "nrf9160_pca20035" isn't in zephyr, but its in nrf. So you'll have to "override" the board lookup directories with the above line.

     

    Kind regards,

    Håkon

  • Deleting the build folder and build with the nrf9160_pca10090ns board, generates the same situation (failure).

    $ cmake -B build -GNinja  -DBOARD=nrf9160_pca10090ns
    -- 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_pca10090ns
    -- 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/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns.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/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns.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!
    $

    My existing CMakeList.txt is as below, so I'm already overriding the zephyr board lookup folder.

    cmake_minimum_required(VERSION 3.8.2)
    
    include($ENV{ZEPHYR_BASE}/../nrf/cmake/boilerplate.cmake)
    include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
    project(hello_world)
    
    # NORDIC SDK APP START
    target_sources(app PRIVATE src/main.c)
    # NORDIC SDK APP END
    

    And my env are:

    ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
    ZEPHYR_BASE=/home/jesper/Desktop/Projects/nordic/ncs/zephyr
    GNUARMEMB_TOOLCHAIN_PATH=~/opt/gcc-arm-none-eabi
    PATH=/home/jesper/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/jesper/opt/gcc-arm-none-eabi/bin/

    And Ubuntu kernel verison:

    Linux ubuntu 5.3.0-42-generic #34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  • Hi Jesper,

     

    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 !! ?? 

    /Jesper

     

    This is strange. I haven't seen this behavior before, but I'll keep an eye out for such behavior. When running a "west update" - this should give you an error when trying to check out zephyr, but if you're not changing the branch (effectively checking out the same hash), git does not do anything.

    Going into ncs/zephyr and writing "git status" shall give you a status of the tree itself, and list any changes. You can reset the repo (hard, use with caution if you have wanted changes!) :

    cd path/to/repo

    git reset --hard HEAD

     

    Kind regards,

    Håkon

Reply
  • Hi Jesper,

     

    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 !! ?? 

    /Jesper

     

    This is strange. I haven't seen this behavior before, but I'll keep an eye out for such behavior. When running a "west update" - this should give you an error when trying to check out zephyr, but if you're not changing the branch (effectively checking out the same hash), git does not do anything.

    Going into ncs/zephyr and writing "git status" shall give you a status of the tree itself, and list any changes. You can reset the repo (hard, use with caution if you have wanted changes!) :

    cd path/to/repo

    git reset --hard HEAD

     

    Kind regards,

    Håkon

Children
No Data
Related