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

ADXL362 with nRF9160 DK

I am trying to communicate between an ADXL362 accelerometer and a nRF9160 DK. I see on this link https://docs.zephyrproject.org/latest/samples/sensor/adxl362/README.html that zephyr has a sample library for the ADXL362. I followed the instructions provided in the link.

cmake -GNinja -DBOARD=nrf9160_pca10090ns ..

D:\Zephyr\zephyrproject\zephyr\samples\sensor\adxl362\build>cmake -GNinja -DBOARD=nrf9160_pca10090ns ..
Zephyr version: 1.14.99
-- Selected BOARD nrf9160_pca10090ns
-- Found west: C:/Python37/Scripts/west.exe (found suitable version "0.5.7", minimum required is "0.5.6")
-- Loading D:/Zephyr/zephyrproject/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns.dts as base
-- Overlaying D:/Zephyr/zephyrproject/zephyr/dts/common/common.dts
Parsing Kconfig tree in D:/Zephyr/zephyrproject/zephyr/Kconfig
Loaded configuration 'D:/Zephyr/zephyrproject/zephyr/samples/sensor/adxl362/build/zephyr/.config'
No change to 'D:/Zephyr/zephyrproject/zephyr/samples/sensor/adxl362/build/zephyr/.config'
-- Cache files will be written to: C:\Users\zzasa\AppData\Local/.cache/zephyr
Including module: esp-idf in path: D:\Zephyr\zephyrproject\modules\hal\esp-idf\zephyr
Including module: fatfs in path: D:\Zephyr\zephyrproject\modules\fs\fatfs
Including module: qmsi in path: D:\Zephyr\zephyrproject\modules\hal\qmsi
Including module: cypress in path: D:\Zephyr\zephyrproject\modules\hal\cypress
Including module: silabs in path: D:\Zephyr\zephyrproject\modules\hal\silabs
Including module: libmetal in path: D:\Zephyr\zephyrproject\modules\hal\libmetal
Including module: mbedtls in path: D:\Zephyr\zephyrproject\modules\crypto\mbedtls
Including module: mcumgr in path: D:\Zephyr\zephyrproject\modules\lib\mcumgr
Including module: nffs in path: D:\Zephyr\zephyrproject\modules\fs\nffs
Including module: open-amp in path: D:\Zephyr\zephyrproject\modules\lib\open-amp
Including module: segger in path: D:\Zephyr\zephyrproject\modules\debug\segger
Including module: tinycbor in path: D:\Zephyr\zephyrproject\modules\lib\tinycbor
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Zephyr/zephyrproject/zephyr/samples/sensor/adxl362/build

ninja

D:\Zephyr\zephyrproject\zephyr\samples\sensor\adxl362\build>ninja
[7/102] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj
C:\gnuarmemb\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=zephyr-v1.14.0-1530-g3e56c2cf1611 -DKERNEL -DNRF9160_XXAA -DNRF_TRUSTZONE_NONSECURE -D_FORTIFY_SOURCE=2 -D__ZEPHYR__=1 -ID:/Zephyr/zephyrproject/zephyr/kernel/include -ID:/Zephyr/zephyrproject/zephyr/arch/arm/include -ID:/Zephyr/zephyrproject/zephyr/include -ID:/Zephyr/zephyrproject/zephyr/include/drivers -Izephyr/include/generated -ID:/Zephyr/zephyrproject/zephyr/soc/arm/nordic_nrf/nrf91 -ID:/Zephyr/zephyrproject/zephyr/soc/arm/nordic_nrf/include -ID:/Zephyr/zephyrproject/zephyr/lib/libc/minimal/include -ID:/Zephyr/zephyrproject/zephyr/ext/hal/cmsis/Include -ID:/Zephyr/zephyrproject/zephyr/ext/hal/nordic/nrfx -ID:/Zephyr/zephyrproject/zephyr/ext/hal/nordic/nrfx/drivers/include -ID:/Zephyr/zephyrproject/zephyr/ext/hal/nordic/nrfx/hal -ID:/Zephyr/zephyrproject/zephyr/ext/hal/nordic/nrfx/mdk -ID:/Zephyr/zephyrproject/zephyr/ext/hal/nordic/. -isystem c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/7.3.1/include -isystem c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/7.3.1/include-fixed -Os -nostdinc -imacros D:/Zephyr/zephyrproject/zephyr/samples/sensor/adxl362/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mthumb -mcpu=cortex-m33 -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -ffunction-sections -fdata-sections -mabi=aapcs -march=armv8-m.main+dsp -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj   -c ../src/main.c
../src/main.c: In function 'main':
../src/main.c:36:42: error: 'DT_INST_0_ADI_ADXL362_LABEL' undeclared (first use in this function); did you mean 'DT_INST_0_SOC_NV_FLASH_LABEL'?
  struct device *dev = device_get_binding(DT_INST_0_ADI_ADXL362_LABEL);
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                          DT_INST_0_SOC_NV_FLASH_LABEL
../src/main.c:36:42: note: each undeclared identifier is reported only once for each function it appears in
[16/102] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj
ninja: build stopped: subcommand failed.

How do I declare the DT_INST_0_SOC_NV_FLASH_LABEL for the nRF9160DK? 

Parents Reply Children
Related