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

NCS - flood of redefinition warnings for "DT_N_INST_0_nordic_nrf5340_cpuapp_qkaa"

Hi guys,
I'm struggling on multiple fronts to make the system building up again after NCS upgrade to 1.5.0.
This is the last uncanny warning I get at build time.
Please give a hand

Including boilerplate (Zephyr base): /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/cmake/app/boilerplate.cmake
qi2m_nrf5340_cpuapp.dts.pre.tmp:61.42-73.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
qi2m_nrf5340_cpuapp.dts.pre.tmp:348.19-354.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
qi2m_nrf5340_cpuapp.dts.pre.tmp:588.31-589.5: Warning (unique_unit_address_if_enabled): /reserved-memory/image@20000000: duplicate unit-address (also used in node /reserved-memory/image_s@20000000)
  also defined at qi2m_nrf5340_cpuapp.dts.pre.tmp:608.14-610.3
CMake Warning at /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/CMakeLists.txt:414 (message):
  One or more dts_fixup.h files detected:

  -
  /home/gabriele/qi2m-dev/board-definition/boards/arm/qi2m_nrf5340/dts_fixup.h


  Use of these files is deprecated; use the devicetree.h API instead.


CMake Deprecation Warning at /home/gabriele/qi2m-dev/nrf53sdk/ncs/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake suite maintained and supported by Kitware (kitware.com/cmake).
-- Application: /home/gabriele/qi2m-dev/apps/fot
-- Zephyr version: 2.4.99 (/home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr)
-- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.5") found components: Interpreter 
-- Found west (found suitable version "0.9.99", minimum required is "0.7.1")
-- Board: qi2m_nrf5340_cpuapp
-- Cache files will be written to: /home/gabriele/.cache/zephyr
-- Found dtc: /home/gabriele/qi2m-dev/nrf53sdk/zephyr/sdk/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/home/gabriele/qi2m-dev/nrf53sdk/sdk/gnu-arm-emb-toolchain)
-- Found BOARD.dts: /home/gabriele/qi2m-dev/board-definition/boards/arm/qi2m_nrf5340/qi2m_nrf5340_cpuapp.dts
-- Found devicetree overlay: src/qi2m.overlay
-- Generated zephyr.dts: /home/gabriele/qi2m-dev/apps/fot/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/gabriele/qi2m-dev/apps/fot/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/gabriele/qi2m-dev/apps/fot/build/zephyr/include/generated/device_extern.h
Parsing /home/gabriele/qi2m-dev/apps/fot/Kconfig
Loaded configuration '/home/gabriele/qi2m-dev/board-definition/boards/arm/qi2m_nrf5340/qi2m_nrf5340_cpuapp_defconfig'
Merged configuration '/home/gabriele/qi2m-dev/apps/fot/prj.conf'
Configuration saved to '/home/gabriele/qi2m-dev/apps/fot/build/zephyr/.config'
Kconfig header saved to '/home/gabriele/qi2m-dev/apps/fot/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /home/gabriele/qi2m-dev/nrf53sdk/sdk/gnu-arm-emb-toolchain/bin/arm-none-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gabriele/qi2m-dev/apps/fot/build
ninja: Entering directory `build'
[1/202] Preparing syscall dependency handling

[2/202] Generating misc/generated/syscalls_subdirs.trigger
[3/202] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[4/202] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[5/202] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h
[6/202] Generating include/generated/driver-validation.h
[7/202] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
In file included from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/devicetree.h:19,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/arch/arm/aarch32/arch.h:20,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/arch/cpu.h:19,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/kernel_includes.h:33,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/kernel.h:17,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/arch/arm/core/offsets/offsets_aarch32.c:28,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/arch/arm/core/offsets/offsets.c:12:
zephyr/include/generated/devicetree_unfixed.h:644: warning: "DT_N_INST_0_nordic_nrf5340_cpuapp_qkaa" redefined
  644 | #define DT_N_INST_0_nordic_nrf5340_cpuapp_qkaa DT_N_S_soc
      | 
In file included from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/devicetree.h:19,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/arch/arm/aarch32/arch.h:20,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/arch/cpu.h:19,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/kernel_includes.h:33,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/include/kernel.h:17,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/arch/arm/core/offsets/offsets_aarch32.c:28,
                 from /home/gabriele/qi2m-dev/nrf53sdk/ncs/zephyr/arch/arm/core/offsets/offsets.c:12:
zephyr/include/generated/devicetree_unfixed.h:123: note: this is the location of the previous definition
  123 | #define DT_N_INST_0_nordic_nrf5340_cpuapp_qkaa DT_N
      | 
....................................................................................................
                            WARNING ABOVE REPEATED HUNDREDS OF TIMES
....................................................................................................

[196/202] Linking C static library zephyr/kernel/libkernel.a
[197/202] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       75992 B         1 MB      7.25%
            SRAM:       16912 B       448 KB      3.69%
        IDT_LIST:          88 B         2 KB      4.30%
[198/202] Generating linker_pass_final.cmd
[199/202] Generating isr_tables.c
[200/202] Building C object zephyr/CMakeFiles/zephyr_final.dir/misc/empty_file.c.obj
[201/202] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj
[202/202] Linking C executable zephyr/zephyr.elf

  • Hello Gabriele,

    My first guess is that you have to adapt some of the API in your code to be compatible with the Zephyr Devicetree used in NCS v1.5.0.

    Could you share the content of dts_fixup.h? Thanks!

    Regards,

    Markus

  • Hi Markus,

    A) dts_fixup.h was empty. We deleted it. Multiple definition warnings still popping out. Build completes anyway but, once flashed, mcuboot crashes this way

    *** Booting Zephyr OS build v2.4.99-ncs1 ***<CR><LF>
    E: ***** BUS FAULT *****<CR><LF>
    E: Precise data bus error<CR><LF>
    E: BFAR Address: 0x50019600<CR><LF>
    E: r0/a1: 0x000085f4 r1/a2: 0x00000000 r2/a3: 0x50019000<CR><LF>
    E: r3/a4: 0x6e524635 r12/ip: 0x00000020 r14/lr: 0x00004665<CR><LF>
    E: xpsr: 0x69000000<CR><LF>
    E: Faulting instruction address (r15/pc): 0x0000049c<CR><LF>
    E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0<CR><LF>
    E: Current thread: (nil) (unknown)<CR><LF>
    E: Resetting system<CR>

    B) If I build mcuboot alone, compiler does complain for missing pm_config.h

    ...
    In file included from ../main.c:59:
    /home/gabriele/qi2m-dev/nrf53sdk/ncs/nrf/include/dfu/pcd.h:35:10: fatal error: pm_config.h: No such file or directory
       35 | #include <pm_config.h>
          |          ^~~~~~~~~~~~~
    compilation terminated.
    

  • Hello Gabriele,

    According to the build log, there are obviously some things that need to be fixed. What happens if you build your application without MCUboot to start with? Are there any different warnings and does the program still crash?

    Regards,

    Markus

  • Hello Markus,
    I apologize for the late reply.
    Eventually I solved the puzzle by putting all the tiles in one by one.
    Major mistakes involved CMakeList.txt statements (see below), especially for letting cmake to know were to find the binding file for the out-of-tree DAC driver.
    Thank you
    Gabriele

    cmake_minimum_required(VERSION 3.13.1)
    
    # setting the out-of-tree custom board definition ..
    set(BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR}/../board-definition)
    set(BOARD qi2m_nrf5340_cpuapp)
    
    # setting the out-of-tree driver sources and dts binding ..
    list(APPEND ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/../drivers)
    list(APPEND SYSCALL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../drivers/zephyr)
    list(APPEND DTS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../board-definition)
    
    find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
    
    project(myapp)
    target_sources(app PRIVATE src/main.c)
    
    zephyr_library_include_directories(.)

  • Hello Gabriele,

    Thanks for the feedback! I’m glad to hear that you could solve the problem.

    Cheers!

    Markus

Related