Re: build failed due to missing headers


Stephane D'Alu
 

On 10/4/19 8:35 PM, Bolivar, Marti wrote:
"Stephane D'Alu via Lists.Zephyrproject.Org"
<stephane.dalu=insa-lyon.fr@...> writes:

On 10/4/19 7:52 PM, Bolivar, Marti wrote:
"Stephane D'Alu via Lists.Zephyrproject.Org"
<stephane.dalu=insa-lyon.fr@...> writes:

On 10/4/19 5:38 PM, Stephane D'Alu wrote:
On 10/4/19 5:09 PM, Cufi, Carles wrote:


-----Original Message-----
From: users@... <users@...> On
Behalf Of Stephane D'Alu via Lists.Zephyrproject.Org
Sent: 04 October 2019 14:48
To: Cufi, Carles <Carles.Cufi@...>;
users@...
Cc: users@...
Subject: Re: [Zephyr-users] build failed due to missing headers

On 10/4/19 2:07 PM, Cufi, Carles wrote:


On 10/4/19 1:50 PM, Cufi, Carles wrote:
Hi there,

I'm doing (west version is 0.6.2):
     west build -b nrf52840_mdk samples/basic/blinky

and got:
...
...
../soc/arm/nordic_nrf/nrf52/soc.h:16:10: fatal error: nrfx.h: No
such file or directory
     #include <nrfx.h>
              ^~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Any idea, on what is wrong and how to fix it?
Works fine here, are you sure you ran "west update"?

[...]
Can you try removing the entire
/home/sdalu/Z/zephyrproject/zephyr/build folder and building again? It
might be an issue with stale build files.
Same thing:

$ rm -rf build
$ ~/.local/bin/west -vvv build -b nrf52840_mdk samples/basic/blinky ...
...
../soc/arm/nordic_nrf/nrf52/soc.h:16:10: fatal error: nrfx.h: No such
file or directory
   #include <nrfx.h>
            ^~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


I attached the full log
Right, but I noticed now that your .zephyrrc ontains:

my ~/.zephyrrc:
export ZEPHYR_TOOLCHAIN_VARIANT=cross-compile
export CROSS_COMPILE=/usr/local/gcc-arm-embedded/bin/arm-none-eabi-
export HOSTCC=cc
Could you try using ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb and
GNUARMEMB_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded/ instead?
See here:
https://docs.zephyrproject.org/latest/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded


I think that cross-compile is valid to use when your toolchain is
installed in a certain way (using your distro's package manager?)
whereas gnuarmemb is the right one to use when you download the GNU
Arm Embedded toolchain and place it somewhere in your disk.

~/.zypherrc is now:
export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
export GNUARMEMB_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded
export HOSTCC=cc


I removed the build directory, started a new session so that env is
correctly loaded with new values



Same error :(
Note also, that I'm on freebsd, that's shouldn't impact the way build is
working, but perhaps something is not done correctly in west ?
Can you check for a line like this in build/zephyr_modules.txt?

$ grep nordic build/zephyr_modules.txt
"nordic":"/home/mbolivar/zp/modules/hal/nordic"
don't have such file
That's your problem, then. If you're doing a pristine build and the build
system finds west on PATH, it ought to be generating this file.
Looking at your full log, I see:
-- Selected BOARD nrf52840_mdk
-- Loading
/home/sdalu/Z/zephyrproject/zephyr/boards/arm/nrf52840_mdk/nrf52840_mdk.dts
as base
On my system, I get:
-- Selected BOARD nrf52840_pca10056
-- Found west: /home/mbolivar/.virtualenvs/west-dev/bin/west (found suitable version "0.6.99", minimum required is "0.6.0")
-- Loading /home/mbolivar/zp/zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts as base
Note "Found west" appears in my output, but not yours.
Can you please make sure 'west' is on PATH and try again with a pristine
build directory?
You got it! That was related to west not being in the PATH.
It is now compiling fine, thanks


Perhaps it could be usefudl for other to add a note in the getting started guide, that west must be accessible using PATH


--
Stephane D'Alu -- Ingenieur Recherche
Laboratoire CITI / INSA-Lyon
Tel: +33 47243 8925

Join users@lists.zephyrproject.org to automatically receive all group messages.