Adding nRF library (app_timer.c) to already existing project. (undefined reference error)

Hi,

I had an idea for a hobby project and that's how i got into the whole MCU world. Please keep in mind, that i am fairly new.

I bought an evaluation/development board for a UWB sensor (https://www.qorvo.com/products/p/DWM1001-DEV#overview), that has a nRF52832 at it's core.
I am using Segger Embedded Studio 4.12 (SES), with which I got the examples to work on the board (with some minor difficulties).
(Examples if relevant: https://github.com/Decawave/dwm1001-examples/tree/master/examples, ss_twr_init is the one I am having trouble with)

Now I want to change some minor stuff in the example. I want to print out a timestamp. In arduino IDE there is the millis() function, so I googled if there is some sort of easy equivalent, but it seems not. I got to this post:  Milliseconds since startup?  and read and googled a bit more and ended up on this guide: nRF5 SDK Application Timer Tutorial . 
In the section "Add required files and includes" there isn't much explanation on how to add the app_timer.c to the project. In SES I just right clicked on the nRF_libraries folder in the ss_twr_init example project and clicked "add existing file", and chose the app_timer.c from the nRF SDK 17.1 zip-file I downloaded. Sadly I am still getting the same errors from before I added the app_timer.c to the project, namely "undefined reference to 'app_timer_init'" and "app_timer_cnt_get".

Was this whole "copy from nRF SDK, paste into project"-procedure the right way? Is the error unrelated to the existence of the app_timer.c file in the project?

Thank you!

  • Hi 

    If you are starting out with the DWM1001 today I would recommend changing over to the Zephyr based nRF Connect SDK software framework. 

    Like mentioned here Qorvo is working to integrate the module in Zephyr, and the nRF Connect SDK is replacing the nRF5 SDK for Nordic software development. 

    I expect the issue you have in the nRF5 SDK project is that you are missing the defines required in sdk_config.h to properly enable the app_timer library (adding new modules to an example is one of the many things improved in the newer Zephyr based SDK...). 

    The easiest way to fix this issue is to open sdk_config.h in an example that already uses the app_timer module (all Bluetooth examples should include this) and copy the section related to the app_timer into your own sdk_config.h file. It should look something like this:

    // <e> APP_TIMER_ENABLED - app_timer - Application timer functionality
    //==========================================================
    #ifndef APP_TIMER_ENABLED
    #define APP_TIMER_ENABLED 1
    #endif
    // <o> APP_TIMER_CONFIG_RTC_FREQUENCY  - Configure RTC prescaler.
     
    // <0=> 32768 Hz 
    // <1=> 16384 Hz 
    // <3=> 8192 Hz 
    // <7=> 4096 Hz 
    // <15=> 2048 Hz 
    // <31=> 1024 Hz 
    
    #ifndef APP_TIMER_CONFIG_RTC_FREQUENCY
    #define APP_TIMER_CONFIG_RTC_FREQUENCY 1
    #endif
    
    // <o> APP_TIMER_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    
    // <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef APP_TIMER_CONFIG_IRQ_PRIORITY
    #define APP_TIMER_CONFIG_IRQ_PRIORITY 6
    #endif
    
    // <o> APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue. 
    // <i> Size of the queue depends on how many timers are used
    // <i> in the system, how often timers are started and overall
    // <i> system latency. If queue size is too small app_timer calls
    // <i> will fail.
    
    #ifndef APP_TIMER_CONFIG_OP_QUEUE_SIZE
    #define APP_TIMER_CONFIG_OP_QUEUE_SIZE 10
    #endif
    
    // <q> APP_TIMER_CONFIG_USE_SCHEDULER  - Enable scheduling app_timer events to app_scheduler
     
    
    #ifndef APP_TIMER_CONFIG_USE_SCHEDULER
    #define APP_TIMER_CONFIG_USE_SCHEDULER 0
    #endif
    
    // <q> APP_TIMER_KEEPS_RTC_ACTIVE  - Enable RTC always on
     
    
    // <i> If option is enabled RTC is kept running even if there is no active timers.
    // <i> This option can be used when app_timer is used for timestamping.
    
    #ifndef APP_TIMER_KEEPS_RTC_ACTIVE
    #define APP_TIMER_KEEPS_RTC_ACTIVE 0
    #endif
    
    // <o> APP_TIMER_SAFE_WINDOW_MS - Maximum possible latency (in milliseconds) of handling app_timer event. 
    // <i> Maximum possible timeout that can be set is reduced by safe window.
    // <i> Example: RTC frequency 16384 Hz, maximum possible timeout 1024 seconds - APP_TIMER_SAFE_WINDOW_MS.
    // <i> Since RTC is not stopped when processor is halted in debugging session, this value
    // <i> must cover it if debugging is needed. It is possible to halt processor for APP_TIMER_SAFE_WINDOW_MS
    // <i> without corrupting app_timer behavior.
    
    #ifndef APP_TIMER_SAFE_WINDOW_MS
    #define APP_TIMER_SAFE_WINDOW_MS 300000
    #endif
    
    // <h> App Timer Legacy configuration - Legacy configuration.
    
    //==========================================================
    // <q> APP_TIMER_WITH_PROFILER  - Enable app_timer profiling
     
    
    #ifndef APP_TIMER_WITH_PROFILER
    #define APP_TIMER_WITH_PROFILER 0
    #endif
    
    // <q> APP_TIMER_CONFIG_SWI_NUMBER  - Configure SWI instance used.
     
    
    #ifndef APP_TIMER_CONFIG_SWI_NUMBER
    #define APP_TIMER_CONFIG_SWI_NUMBER 0
    #endif
    
    // </h> 
    //==========================================================

    Best regards
    Torbjørn

  • Thanks for the quick reply!
    Setting APP_TIMER_ENABLED 1 in the sdk_config.h indeed did some good. Now the problem seems to be that some functions defined in the app_timer.c (e.g. app_timer_init) are already defined in the app_timer_freertos.c, so i am getting a "multiple definition of '...'" error.

    I skimmed through the qorvo forum post you linked and read a bit about zephyr since I don't really have an idea what it is and what it replaces. On their website it says something along the lines of RTOS ecosystem. Reading through the main.c file of the ss_twr_init example it seems right now it is using FreeRTOS for task and timer scheduling and what not. Will all this be replaced with zephyr? So will my new problem of multiple definitions for timer initialisation also be solved by switching over to nRF Connect SDK?

    I will go through the readme of the repo you linked and get back if I get it to work or run into some major issues.

    Best regards
    Timo

  • Hi Timo

    tiko said:
    Now the problem seems to be that some functions defined in the app_timer.c (e.g. app_timer_init) are already defined in the app_timer_freertos.c, so i am getting a "multiple definition of '...'" error.

    You will need to keep only one of the source files, either app_timer.c or app_timer_freertos.c depending on whether or not you are going to use FreeRTOS. 

    tiko said:
    Reading through the main.c file of the ss_twr_init example it seems right now it is using FreeRTOS for task and timer scheduling and what not. Will all this be replaced with zephyr? So will my new problem of multiple definitions for timer initialisation also be solved by switching over to nRF Connect SDK?

    Zephyr is a complete RTOS and would replace the FreeRTOS calls, yes. 

    The app_timer module is not used in the nRF Connect SDK so this issue would go away for sure, but other issues might show up instead Wink

    It can be a bit challenging to port an entire project written for a different SDK and RTOS to a different one, since you need to modify a lot of the existing code. 

    Maybe you can also reach out to Decawave and see if they have some input on this?

    If you do decide to go with the new SDK I would strongly recommend starting with the Nordic Devacademy in order to get up to speed on the details. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

    I tried to go both ways a bit and played around with excluding app_timer.c or app_timer_freertos.c from build, commenting out the duplicate function in one of the two or adding the missing functions from app_timer.c in app_timer_freertos.c (e.g. app_timer_cnt_get). This worked in the sense of the build compiling and I was able to flash it on the MCU, but then either the MCU just didn't work at all (LEDs not blinking the way they should be, no output in serial, ...) or the timer functionality just didn't work and the counter of the ticks elapsed since startup was stuck at 0. I tried around with the solutions in this  APP_TIMER_KEEPS_RTC_ACTIVE SDK15.0 rtc does not start unless at least 1(one) timer is active post, but it didn't work for me.
    My guess is the whole example code is just too much coupled to freeRTOS for the app_timer functionality to work, but it's just an uninformed guess.

    I then gave the repo with zephyr based examples a shot and installed the latest version of nRF Connect SDK vor Visual Studio.
    I had to do some fixing, specifically:

    - comment out LOG_PRINTK_MAX_STRING_LENGTH, LOG_DETECT_MISSED_STRDUP, LOG_STRDUP_MAX_STRING, LOG_STRDUP_BUF_COUNT in the prj.conf file.
    - change #include <zephyr.h> to #include <zephyr/kernel.h> for the whole repo
    - add zephyr/ in before header file includes of sys/printk.h, logging/log.h, device.h, drivers/gpio.h, drivers/spi.h for the whole repo

    This fixed a lot of build errors, but in the end I am still having build errors where I am not sure how to fix them (see below). The repo is not purely nRF Connect SDK based, but zephyr based and uses zephyr 2.7. From the error message during the build process I take that the zephyr version in my nRF Connect SDK is 3.4.99.
    Is there a possibilty to downgrade the zephyr version that the nRF Connect SDK uses?

    I will also make a post on the qorvo forum about this and see if anyone there has example code for the newest nRF Connect SDK. If it doesn't get an official answer by qorvo/decawave I might try my luck with the support. I will link the post here when I created it.

    Best regards,
    Timo



    The build error I get (I can not insert it as code for some reason):

    Executing task: nRF Connect: Build [pristine]: ex_05a_ds_twr_init/build (active)

    Building ex_05a_ds_twr_init
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build c:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init --pristine --board nrf52840dk_nrf52840 --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="c:/users/timok/desktop/projekte/dwm1001" -DCONF_FILE:STRING="c:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/prj.conf""

    -- west build: generating a build system
    CMake Warning at C:/ncs/v2.5.0/zephyr/cmake/app/boilerplate.cmake:20 (message):
    Loading of Zephyr boilerplate.cmake directly is deprecated, please use
    'find_package(Zephyr)'
    Call Stack (most recent call first):
    CMakeLists.txt:7 (include)


    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init
    -- CMake version: 3.20.5
    -- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf52840dk_nrf52840
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build/zephyr/dts.cmake
    Parsing C:/ncs/v2.5.0/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.5.0/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration 'c:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/prj.conf'
    Configuration saved to 'C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build/zephyr/.config'
    Kconfig header saved to 'C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build
    -- west build: building application
    [1/159] Generating ../../zephyr/include/generated/ncs_version.h
    [2/159] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr), build: v3.4.99-ncs1
    [3/159] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
    [4/159] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
    [5/159] Generating include/generated/driver-validation.h
    [6/159] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
    [7/159] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    [8/159] Generating include/generated/offsets.h
    [9/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
    [10/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
    [11/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
    [12/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
    [13/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
    [14/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
    [15/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
    [16/159] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
    [17/159] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
    [18/159] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
    [19/159] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
    [20/159] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
    [21/159] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
    [22/159] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
    [23/159] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
    [24/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/__aeabi_read_tp.S.obj
    [25/159] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
    [26/159] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/__/common/tls.c.obj
    [27/159] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
    [28/159] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
    [29/159] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
    [30/159] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
    [31/159] Building C object CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/decadriver/deca_params_init.c.obj
    [32/159] Building C object zephyr/soc/soc/arm/common/cortex_m/CMakeFiles/soc__arm__common__cortex_m.dir/arm_mpu_regions.c.obj
    [33/159] Building C object CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/deca_range_tables.c.obj
    [34/159] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_core_mpu.c.obj
    [35/159] Building C object zephyr/lib/libc/common/CMakeFiles/lib__libc__common.dir/source/stdlib/abort.c.obj
    [36/159] Generating linker_zephyr_pre0.cmd
    [37/159] Building C object CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/main.c.obj
    [38/159] Building C object CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/deca_mutex.c.obj
    [39/159] Linking C static library zephyr\arch\common\libisr_tables.a
    [40/159] Linking C static library zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
    [41/159] Building C object zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj
    [42/159] Building C object CMakeFiles/app.dir/ex_05a_main.c.obj
    [43/159] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_mpu.c.obj
    [44/159] Linking C static library zephyr\soc\soc\arm\common\cortex_m\libsoc__arm__common__cortex_m.a
    [45/159] Building C object zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/libc-hooks.c.obj
    [46/159] Building C object zephyr/lib/libc/common/CMakeFiles/lib__libc__common.dir/source/stdlib/malloc.c.obj
    [47/159] Building C object zephyr/soc/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/soc.c.obj
    [48/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
    [49/159] Linking C static library zephyr\arch\common\libarch__common.a
    [50/159] Building C object CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/deca_sleep.c.obj
    [51/159] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
    [52/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
    [53/159] Linking C static library zephyr\arch\arch\arm\core\aarch32\mpu\libarch__arm__core__aarch32__mpu.a
    [54/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
    [55/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
    [56/159] Building C object CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/decadriver/deca_device.c.obj
    [57/159] Linking C static library zephyr\soc\soc\arm\nordic_nrf\nrf52\libsoc__arm__nordic_nrf__nrf52.a
    [58/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
    [59/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
    [60/159] Linking C static library zephyr\lib\libc\common\liblib__libc__common.a
    [61/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
    [62/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
    [63/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
    [64/159] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
    [65/159] Linking C static library zephyr\lib\libc\picolibc\liblib__libc__picolibc.a
    [66/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
    [67/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
    [68/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
    [69/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
    [70/159] Building C object CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/port.c.obj
    FAILED: CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/port.c.obj
    C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DEX_05A_DEF -DKERNEL -DNRF52840_XXAA -DPICOLIBC_INTEGER_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I../../../decadriver -I../../../platform -I../../../compiler -IC:/ncs/v2.5.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.5.0/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.5.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.5.0/nrf/include -IC:/ncs/v2.5.0/nrf/tests/include -IC:/ncs/v2.5.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.5.0/zephyr/modules/cmsis/. -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.5.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.5.0/modules/debug/segger/SEGGER -IC:/ncs/v2.5.0/modules/debug/segger/Config -isystem C:/ncs/v2.5.0/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Og -imacros C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.5.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.5.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.5.0=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/port.c.obj -MF CMakeFiles\app.dir\C_\Users\timok\Desktop\Projekte\dwm1001\platform\port.c.obj.d -o CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/port.c.obj -c C:/Users/timok/Desktop/Projekte/dwm1001/platform/port.c
    C:/Users/timok/Desktop/Projekte/dwm1001/platform/port.c: In function 'port_set_deca_isr':
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:327:13: warning: Macro is deprecated
    327 | printk("%s: Binding to %s and pin %d\n", __func__, GPIO_NAME, GPIO_PIN);
    | ^~~~~~~~~~~~~~~~~~~~~
    In file included from C:\ncs\v2.5.0\zephyr\include\zephyr\arch\arm\aarch32\arch.h:20,
    from C:\ncs\v2.5.0\zephyr\include\zephyr\arch\cpu.h:19,
    from C:\ncs\v2.5.0\zephyr\include\zephyr\kernel_includes.h:33,
    from C:\ncs\v2.5.0\zephyr\include\zephyr\kernel.h:17,
    from C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:22:
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:36: error: 'DT_N_NODELABEL_dwmirq_P_gpios_IDX_0_PH_P_label' undeclared (first use in this function)
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4231:29: note: in definition of macro 'DT_CAT3'
    4231 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:789:27: note: in expansion of macro 'DT_PROP'
    789 | #define DT_LABEL(node_id) DT_PROP(node_id, label) __DEPRECATED_MACRO
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:310:22: note: in expansion of macro 'DT_LABEL'
    310 | #define GPIO_NAME DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0))
    | ^~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:1591:9: note: in expansion of macro 'DT_CAT6'
    1591 | DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:310:31: note: in expansion of macro 'DT_PHANDLE_BY_IDX'
    310 | #define GPIO_NAME DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0))
    | ^~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:310:49: note: in expansion of macro 'DT_NODELABEL'
    310 | #define GPIO_NAME DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0))
    | ^~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:327:56: note: in expansion of macro 'GPIO_NAME'
    327 | printk("%s: Binding to %s and pin %d\n", __func__, GPIO_NAME, GPIO_PIN);
    | ^~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:36: note: each undeclared identifier is reported only once for each function it appears in
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4231:29: note: in definition of macro 'DT_CAT3'
    4231 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:789:27: note: in expansion of macro 'DT_PROP'
    789 | #define DT_LABEL(node_id) DT_PROP(node_id, label) __DEPRECATED_MACRO
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:310:22: note: in expansion of macro 'DT_LABEL'
    310 | #define GPIO_NAME DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0))
    | ^~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:1591:9: note: in expansion of macro 'DT_CAT6'
    1591 | DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:310:31: note: in expansion of macro 'DT_PHANDLE_BY_IDX'
    310 | #define GPIO_NAME DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0))
    | ^~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:310:49: note: in expansion of macro 'DT_NODELABEL'
    310 | #define GPIO_NAME DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0))
    | ^~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:327:56: note: in expansion of macro 'GPIO_NAME'
    327 | printk("%s: Binding to %s and pin %d\n", __func__, GPIO_NAME, GPIO_PIN);
    | ^~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:36: error: 'DT_N_NODELABEL_dwmirq_P_gpios_IDX_0_VAL_pin' undeclared (first use in this function); did you mean 'DT_N_S_leds_S_led_3_P_gpios_IDX_0_VAL_pin'?
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4240:9: note: in definition of macro 'DT_CAT7'
    4240 | a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
    | ^~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:311:22: note: in expansion of macro 'DT_PHA_BY_IDX'
    311 | #define GPIO_PIN DT_PHA_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0, pin)
    | ^~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:311:36: note: in expansion of macro 'DT_NODELABEL'
    311 | #define GPIO_PIN DT_PHA_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0, pin)
    | ^~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:327:67: note: in expansion of macro 'GPIO_PIN'
    327 | printk("%s: Binding to %s and pin %d\n", __func__, GPIO_NAME, GPIO_PIN);
    | ^~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:328:13: warning: Macro is deprecated
    328 | gpio_dev = device_get_binding(GPIO_NAME);
    | ^~~~~~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:36: error: 'DT_N_NODELABEL_dwmirq_P_gpios_IDX_0_VAL_flags' undeclared (first use in this function); did you mean 'DT_N_S_leds_S_led_1_P_gpios_IDX_0_VAL_flags'?
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4240:9: note: in definition of macro 'DT_CAT7'
    4240 | a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
    | ^~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:312:22: note: in expansion of macro 'DT_PHA_BY_IDX'
    312 | #define GPIO_FLAGS DT_PHA_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0, flags)
    | ^~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:312:36: note: in expansion of macro 'DT_NODELABEL'
    312 | #define GPIO_FLAGS DT_PHA_BY_IDX(DT_NODELABEL(dwmirq), gpios, 0, flags)
    | ^~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\port.c:335:58: note: in expansion of macro 'GPIO_FLAGS'
    335 | gpio_pin_configure(gpio_dev, GPIO_PIN, (GPIO_INPUT | GPIO_FLAGS));
    | ^~~~~~~~~~
    [71/159] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
    [72/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/assert.c.obj
    [73/159] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
    [74/159] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
    [75/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
    [76/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
    [77/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
    [78/159] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_cache.c.obj
    [79/159] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/mpsc_pbuf.c.obj
    [80/159] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
    [81/159] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_mgmt.c.obj
    [82/159] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_output.c.obj
    [83/159] Building C object CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/deca_spi.c.obj
    FAILED: CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/deca_spi.c.obj
    C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DEX_05A_DEF -DKERNEL -DNRF52840_XXAA -DPICOLIBC_INTEGER_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I../../../decadriver -I../../../platform -I../../../compiler -IC:/ncs/v2.5.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.5.0/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.5.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.5.0/nrf/include -IC:/ncs/v2.5.0/nrf/tests/include -IC:/ncs/v2.5.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.5.0/zephyr/modules/cmsis/. -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.5.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.5.0/modules/debug/segger/SEGGER -IC:/ncs/v2.5.0/modules/debug/segger/Config -isystem C:/ncs/v2.5.0/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Og -imacros C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.5.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/Users/timok/Desktop/Projekte/dwm1001/examples/ex_05a_ds_twr_init=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.5.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.5.0=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/deca_spi.c.obj -MF CMakeFiles\app.dir\C_\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c.obj.d -o CMakeFiles/app.dir/C_/Users/timok/Desktop/Projekte/dwm1001/platform/deca_spi.c.obj -c C:/Users/timok/Desktop/Projekte/dwm1001/platform/deca_spi.c
    C:/Users/timok/Desktop/Projekte/dwm1001/platform/deca_spi.c: In function 'openspi':
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:64:12: error: 'struct spi_cs_control' has no member named 'gpio_dev'
    64 | cs_ctrl.gpio_dev = device_get_binding(DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(spi1), cs_gpios, 0)));
    | ^
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:64:13: warning: Macro is deprecated
    64 | cs_ctrl.gpio_dev = device_get_binding(DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(spi1), cs_gpios, 0)));
    | ^~~~~~~~~~~~~~~~~~~~~
    In file included from C:\ncs\v2.5.0\zephyr\include\zephyr\arch\arm\aarch32\arch.h:20,
    from C:\ncs\v2.5.0\zephyr\include\zephyr\arch\cpu.h:19,
    from C:\ncs\v2.5.0\zephyr\include\zephyr\kernel_includes.h:33,
    from C:\ncs\v2.5.0\zephyr\include\zephyr\kernel.h:17,
    from C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:21:
    c:\Users\timok\Desktop\Projekte\dwm1001\examples\ex_05a_ds_twr_init\build\zephyr\include\generated\devicetree_generated.h:10061:36: error: 'DT_N_S_soc_S_spi_40004000_P_cs_gpios_IDX_0_PH_P_label' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_spi_4002f000_P_cs_gpios_IDX_0_VAL_flags'?
    10061 | #define DT_N_NODELABEL_spi1 DT_N_S_soc_S_spi_40004000
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4231:29: note: in definition of macro 'DT_CAT3'
    4231 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:789:27: note: in expansion of macro 'DT_PROP'
    789 | #define DT_LABEL(node_id) DT_PROP(node_id, label) __DEPRECATED_MACRO
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:64:43: note: in expansion of macro 'DT_LABEL'
    64 | cs_ctrl.gpio_dev = device_get_binding(DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(spi1), cs_gpios, 0)));
    | ^~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:1591:9: note: in expansion of macro 'DT_CAT6'
    1591 | DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:64:52: note: in expansion of macro 'DT_PHANDLE_BY_IDX'
    64 | cs_ctrl.gpio_dev = device_get_binding(DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(spi1), cs_gpios, 0)));
    | ^~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4229:24: note: in expansion of macro 'DT_N_NODELABEL_spi1'
    4229 | #define DT_CAT(a1, a2) a1 ## a2
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:64:70: note: in expansion of macro 'DT_NODELABEL'
    64 | cs_ctrl.gpio_dev = device_get_binding(DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(spi1), cs_gpios, 0)));
    | ^~~~~~~~~~~~
    c:\Users\timok\Desktop\Projekte\dwm1001\examples\ex_05a_ds_twr_init\build\zephyr\include\generated\devicetree_generated.h:10061:36: note: each undeclared identifier is reported only once for each function it appears in
    10061 | #define DT_N_NODELABEL_spi1 DT_N_S_soc_S_spi_40004000
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4231:29: note: in definition of macro 'DT_CAT3'
    4231 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:789:27: note: in expansion of macro 'DT_PROP'
    789 | #define DT_LABEL(node_id) DT_PROP(node_id, label) __DEPRECATED_MACRO
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:64:43: note: in expansion of macro 'DT_LABEL'
    64 | cs_ctrl.gpio_dev = device_get_binding(DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(spi1), cs_gpios, 0)));
    | ^~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:1591:9: note: in expansion of macro 'DT_CAT6'
    1591 | DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:64:52: note: in expansion of macro 'DT_PHANDLE_BY_IDX'
    64 | cs_ctrl.gpio_dev = device_get_binding(DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(spi1), cs_gpios, 0)));
    | ^~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4229:24: note: in expansion of macro 'DT_N_NODELABEL_spi1'
    4229 | #define DT_CAT(a1, a2) a1 ## a2
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:64:70: note: in expansion of macro 'DT_NODELABEL'
    64 | cs_ctrl.gpio_dev = device_get_binding(DT_LABEL(DT_PHANDLE_BY_IDX(DT_NODELABEL(spi1), cs_gpios, 0)));
    | ^~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:65:17: error: 'struct spi_cs_control' has no member named 'gpio_dev'
    65 | if (!cs_ctrl.gpio_dev) {
    | ^
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:69:12: error: 'struct spi_cs_control' has no member named 'gpio_pin'
    69 | cs_ctrl.gpio_pin = DT_PHA(DT_NODELABEL(spi1), cs_gpios, pin);
    | ^
    c:\Users\timok\Desktop\Projekte\dwm1001\examples\ex_05a_ds_twr_init\build\zephyr\include\generated\devicetree_generated.h:10061:36: error: 'DT_N_S_soc_S_spi_40004000_P_cs_gpios_IDX_0_VAL_pin' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_spi_4002f000_P_cs_gpios_IDX_0_VAL_pin'?
    10061 | #define DT_N_NODELABEL_spi1 DT_N_S_soc_S_spi_40004000
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4240:9: note: in definition of macro 'DT_CAT7'
    4240 | a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:1405:36: note: in expansion of macro 'DT_PHA_BY_IDX'
    1405 | #define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
    | ^~~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:69:24: note: in expansion of macro 'DT_PHA'
    69 | cs_ctrl.gpio_pin = DT_PHA(DT_NODELABEL(spi1), cs_gpios, pin);
    | ^~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4229:24: note: in expansion of macro 'DT_N_NODELABEL_spi1'
    4229 | #define DT_CAT(a1, a2) a1 ## a2
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:69:31: note: in expansion of macro 'DT_NODELABEL'
    69 | cs_ctrl.gpio_pin = DT_PHA(DT_NODELABEL(spi1), cs_gpios, pin);
    | ^~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:71:12: error: 'struct spi_cs_control' has no member named 'gpio_dt_flags'
    71 | cs_ctrl.gpio_dt_flags = DT_PHA(DT_NODELABEL(spi1), cs_gpios, flags);
    | ^
    c:\Users\timok\Desktop\Projekte\dwm1001\examples\ex_05a_ds_twr_init\build\zephyr\include\generated\devicetree_generated.h:10061:36: error: 'DT_N_S_soc_S_spi_40004000_P_cs_gpios_IDX_0_VAL_flags' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_spi_4002f000_P_cs_gpios_IDX_0_VAL_flags'?
    10061 | #define DT_N_NODELABEL_spi1 DT_N_S_soc_S_spi_40004000
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4240:9: note: in definition of macro 'DT_CAT7'
    4240 | a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:1405:36: note: in expansion of macro 'DT_PHA_BY_IDX'
    1405 | #define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
    | ^~~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:71:30: note: in expansion of macro 'DT_PHA'
    71 | cs_ctrl.gpio_dt_flags = DT_PHA(DT_NODELABEL(spi1), cs_gpios, flags);
    | ^~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4229:24: note: in expansion of macro 'DT_N_NODELABEL_spi1'
    4229 | #define DT_CAT(a1, a2) a1 ## a2
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:71:37: note: in expansion of macro 'DT_NODELABEL'
    71 | cs_ctrl.gpio_dt_flags = DT_PHA(DT_NODELABEL(spi1), cs_gpios, flags);
    | ^~~~~~~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:73:26: error: incompatible types when assigning to type 'struct spi_cs_control' from type 'struct spi_cs_control *'
    73 | spi_cfgs[i].cs = &cs_ctrl;
    | ^
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:78:13: warning: Macro is deprecated
    78 | spi = device_get_binding(DT_LABEL(DT_NODELABEL(spi1)));
    | ^~~~~~~~~~~~~~~~~~~~~
    c:\Users\timok\Desktop\Projekte\dwm1001\examples\ex_05a_ds_twr_init\build\zephyr\include\generated\devicetree_generated.h:10061:36: error: 'DT_N_S_soc_S_spi_40004000_P_label' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_spi_40004000_P_reg'?
    10061 | #define DT_N_NODELABEL_spi1 DT_N_S_soc_S_spi_40004000
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4231:29: note: in definition of macro 'DT_CAT3'
    4231 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:789:27: note: in expansion of macro 'DT_PROP'
    789 | #define DT_LABEL(node_id) DT_PROP(node_id, label) __DEPRECATED_MACRO
    | ^~~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:78:30: note: in expansion of macro 'DT_LABEL'
    78 | spi = device_get_binding(DT_LABEL(DT_NODELABEL(spi1)));
    | ^~~~~~~~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:4229:24: note: in expansion of macro 'DT_N_NODELABEL_spi1'
    4229 | #define DT_CAT(a1, a2) a1 ## a2
    | ^~
    C:\ncs\v2.5.0\zephyr\include\zephyr\devicetree.h:197:29: note: in expansion of macro 'DT_CAT'
    197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
    | ^~~~~~
    C:\Users\timok\Desktop\Projekte\dwm1001\platform\deca_spi.c:78:39: note: in expansion of macro 'DT_NODELABEL'
    78 | spi = device_get_binding(DT_LABEL(DT_NODELABEL(spi1)));
    | ^~~~~~~~~~~~
    [84/159] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_core.c.obj
    [85/159] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/backends/log_backend_rtt.c.obj
    [86/159] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_msg.c.obj
    [87/159] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/backends/log_backend_uart.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\Users\timok\Desktop\Projekte\dwm1001\examples\ex_05a_ds_twr_init\build'

    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.



  • I think I narrowed it a bit down. I think it had to to with me using the nrf52dk_nrf52832.dts file in the build process. When switching to the custom dts file in the repo the error basically comes down to:

    devicetree error: 'pinctrl-0' is marked as required in 'properties:' in C:/ncs/v2.5.0/zephyr/dts/bindings\serial\nordic,nrf-uart.yaml, but does not appear in <Node /soc/uart@40002000 in 'C:/ncs/v2.5.0/zephyr/misc/empty_file.c'>

    I will probably have to read up a bit in the Nordic Devacademy you linked how this devicetree thing works.

Related