BLE OTA DFU using external flash

I'm using the NCS 2.5.2 sdk and nrf 5340 with 7002, and I want to do BLE OTA DFU using external flash.

I've found this guide Add DFU support to your application - Software - nRF Connect SDK guides - Nordic DevZone (nordicsemi.com), and successfully  done BLE OTA DFU using internal flash, just add the commands below,

#Enable MCUBOOT bootloader build in the application
CONFIG_BOOTLOADER_MCUBOOT=y
#Include MCUMGR and the dependencies in the build
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

but I don't know how to do with external flash, I've tried looking at main.c in mcuboot, and I didn't find where to modify the code.

  • Thanks for your help, I successfully build the sample!

    Ok, I will see the course to learn more.

  • Hi, when I added the below config(it generates a net core image of 5340), same errors occurred for build the project.
    How can I solve this?
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="test"
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    CONFIG_HW_ID_LIBRARY=y
    CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC=y
    Regards, 
    Allen
      140 | #define QSPI_NODE DT_INST_BUS(0)
          |                   ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1242:29: note: in expansion of macro 'QSPI_NODE'
     1242 |         IRQ_CONNECT(DT_IRQN(QSPI_NODE), DT_IRQ(QSPI_NODE, priority),
          |                             ^~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c: At top level:
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1262:29: error: 'INST_0_BYTES' undeclared here (not in a function); did you mean 'INST_0_QER'?
     1262 | #define LAYOUT_PAGES_COUNT (INST_0_BYTES / \
          |                             ^~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/toolchain/gcc.h:81:51: note: in definition of macro 'BUILD_ASSERT'
       81 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
          |                                                   ^~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1266:15: note: in expansion of macro 'LAYOUT_PAGES_COUNT'
     1266 |               LAYOUT_PAGES_COUNT)
          |               ^~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1265:14: error: expression in static assertion is not an integer
     1265 | BUILD_ASSERT((CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE *
          |              ^
    C:/ncs/v2.5.2/zephyr/include/zephyr/toolchain/gcc.h:81:51: note: in definition of macro 'BUILD_ASSERT'
       81 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
          |                                                   ^~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:40: error: expected ')' before 'DT_N_INST_0_nordic_qspi_nor_BUS_PATH'
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/toolchain/gcc.h:81:60: note: in definition of macro 'BUILD_ASSERT'
       81 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
          |                                                            ^~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:495:31: note: in expansion of macro 'DT_CAT'
      495 | #define DT_NODE_PATH(node_id) DT_CAT(node_id, _PATH)
          |                               ^~~~~~
    c:\ncs\v2.5.2\zephyr\soc\arm\nordic_nrf\common\soc_nrf_common.h:191:22: note: in expansion of macro 'DT_NODE_PATH'
      191 |                      DT_NODE_PATH(node_id) " defined without sleep state")
          |                      ^~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1492:1: note: in expansion of macro 'NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP'
     1492 | NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QSPI_NODE);
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3190:25: note: in expansion of macro 'DT_CAT'
     3190 | #define DT_BUS(node_id) DT_CAT(node_id, _BUS)
          |                         ^~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3836:27: note: in expansion of macro 'DT_BUS'
     3836 | #define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
          |                           ^~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:31: note: in expansion of macro 'UTIL_CAT'
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3248:27: note: in expansion of macro 'DT_INST'
     3248 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3836:34: note: in expansion of macro 'DT_DRV_INST'
     3836 | #define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
          |                                  ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:140:19: note: in expansion of macro 'DT_INST_BUS'
      140 | #define QSPI_NODE DT_INST_BUS(0)
          |                   ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1492:37: note: in expansion of macro 'QSPI_NODE'
     1492 | NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QSPI_NODE);
          |                                     ^~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/toolchain/gcc.h:81:50: note: to match this '('
       81 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
          |                                                  ^
    c:\ncs\v2.5.2\zephyr\soc\arm\nordic_nrf\common\soc_nrf_common.h:189:9: note: in expansion of macro 'BUILD_ASSERT'
      189 |         BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE) ||                          \
          |         ^~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1492:1: note: in expansion of macro 'NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP'
     1492 | NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QSPI_NODE);
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util.h:17:
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:241:51: error: expected ')' before '(' token
      241 |                      Z_PINCTRL_STATE_PINS_DEFINE, (;), node_id);               \
          |                                                   ^
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:418:69: note: in definition of macro 'LISTIFY'
      418 | #define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
          |                                                                     ^~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1494:1: note: in expansion of macro 'PINCTRL_DT_DEFINE'
     1494 | PINCTRL_DT_DEFINE(QSPI_NODE);
          | ^~~~~~~~~~~~~~~~~
    In file included from C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:34:
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:418:44: warning: implicit declaration of function 'Z_UTIL_LISTIFY_DT_N_INST_0_nordic_qspi_nor_BUS_PINCTRL_NUM' [-Wimplicit-function-declaration]
      418 | #define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
          |                                            ^~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in definition of macro 'UTIL_PRIMITIVE_CAT'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:418:35: note: in expansion of macro 'UTIL_CAT'
      418 | #define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
          |                                   ^~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:172:17: note: in expansion of macro 'LISTIFY'
      172 |                 LISTIFY(DT_NUM_PINCTRL_STATES(node_id),                        \
          |                 ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:242:9: note: in expansion of macro 'Z_PINCTRL_STATES_DEFINE'
      242 |         Z_PINCTRL_STATES_DEFINE(node_id)                                       \
          |         ^~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1494:1: note: in expansion of macro 'PINCTRL_DT_DEFINE'
     1494 | PINCTRL_DT_DEFINE(QSPI_NODE);
          | ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:173:30: error: 'Z_PINCTRL_STATE_INIT' undeclared here (not in a function)
      173 |                              Z_PINCTRL_STATE_INIT, (,), node_id)               \
          |                              ^~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:418:66: note: in definition of macro 'LISTIFY'
      418 | #define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
          |                                                                  ^
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:242:9: note: in expansion of macro 'Z_PINCTRL_STATES_DEFINE'
      242 |         Z_PINCTRL_STATES_DEFINE(node_id)                                       \
          |         ^~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1494:1: note: in expansion of macro 'PINCTRL_DT_DEFINE'
     1494 | PINCTRL_DT_DEFINE(QSPI_NODE);
          | ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:173:53: error: expected expression before ',' token
      173 |                              Z_PINCTRL_STATE_INIT, (,), node_id)               \
          |                                                     ^
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:418:69: note: in definition of macro 'LISTIFY'
      418 | #define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
          |                                                                     ^~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:242:9: note: in expansion of macro 'Z_PINCTRL_STATES_DEFINE'
      242 |         Z_PINCTRL_STATES_DEFINE(node_id)                                       \
          |         ^~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1494:1: note: in expansion of macro 'PINCTRL_DT_DEFINE'
     1494 | PINCTRL_DT_DEFINE(QSPI_NODE);
          | ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:173:53: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      173 |                              Z_PINCTRL_STATE_INIT, (,), node_id)               \
          |                                                     ^
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:418:69: note: in definition of macro 'LISTIFY'
      418 | #define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
          |                                                                     ^~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:242:9: note: in expansion of macro 'Z_PINCTRL_STATES_DEFINE'
      242 |         Z_PINCTRL_STATES_DEFINE(node_id)                                       \
          |         ^~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1494:1: note: in expansion of macro 'PINCTRL_DT_DEFINE'
     1494 | PINCTRL_DT_DEFINE(QSPI_NODE);
          | ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:40: error: 'DT_N_INST_0_nordic_qspi_nor_BUS' undeclared here (not in a function); did you mean 'DT_N_INST_0_nordic_mbox_nrf_ipc'?
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:418:74: note: in definition of macro 'LISTIFY'
      418 | #define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
          |                                                                          ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:242:9: note: in expansion of macro 'Z_PINCTRL_STATES_DEFINE'
      242 |         Z_PINCTRL_STATES_DEFINE(node_id)                                       \
          |         ^~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1494:1: note: in expansion of macro 'PINCTRL_DT_DEFINE'
     1494 | PINCTRL_DT_DEFINE(QSPI_NODE);
          | ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3190:25: note: in expansion of macro 'DT_CAT'
     3190 | #define DT_BUS(node_id) DT_CAT(node_id, _BUS)
          |                         ^~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3836:27: note: in expansion of macro 'DT_BUS'
     3836 | #define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
          |                           ^~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:31: note: in expansion of macro 'UTIL_CAT'
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3248:27: note: in expansion of macro 'DT_INST'
     3248 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3836:34: note: in expansion of macro 'DT_DRV_INST'
     3836 | #define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
          |                                  ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:140:19: note: in expansion of macro 'DT_INST_BUS'
      140 | #define QSPI_NODE DT_INST_BUS(0)
          |                   ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1494:19: note: in expansion of macro 'QSPI_NODE'
     1494 | PINCTRL_DT_DEFINE(QSPI_NODE);
          |                   ^~~~~~~~~
    In file included from C:/ncs/v2.5.2/zephyr/include/zephyr/toolchain/gcc.h:92:
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:101:17: error: '__pinctrl_dev_config__device_dts_ord_DT_N_INST_0_nordic_qspi_nor_BUS_ORD' undeclared here (not in a function); did you mean '__pinctrl_states__device_dts_ord_DT_N_INST_0_nordic_qspi_nor_BUS_ORD'?
      101 |         _CONCAT(__pinctrl_dev_config, DEVICE_DT_NAME_GET(node_id))
          |                 ^~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/toolchain/common.h:132:26: note: in definition of macro '_DO_CONCAT'
      132 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:101:9: note: in expansion of macro '_CONCAT'
      101 |         _CONCAT(__pinctrl_dev_config, DEVICE_DT_NAME_GET(node_id))
          |         ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:262:45: note: in expansion of macro 'Z_PINCTRL_DEV_CONFIG_NAME'
      262 | #define PINCTRL_DT_DEV_CONFIG_GET(node_id) &Z_PINCTRL_DEV_CONFIG_NAME(node_id)
          |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1499:17: note: in expansion of macro 'PINCTRL_DT_DEV_CONFIG_GET'
     1499 |         .pcfg = PINCTRL_DT_DEV_CONFIG_GET(QSPI_NODE),
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:40: error: 'DT_N_INST_0_nordic_qspi_nor_P_address_size_32' undeclared here (not in a function)
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/ncs/v2.5.2/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.2/zephyr/include/zephyr/devicetree.h:3450:34: note: in expansion of macro 'DT_PROP'
     3450 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:31: note: in expansion of macro 'UTIL_CAT'
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3248:27: note: in expansion of macro 'DT_INST'
     3248 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3450:42: note: in expansion of macro 'DT_DRV_INST'
     3450 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1511:29: note: in expansion of macro 'DT_INST_PROP'
     1511 |                 .addrmode = DT_INST_PROP(0, address_size_32)
          |                             ^~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:40: error: 'DT_N_INST_0_nordic_qspi_nor_P_sck_delay' undeclared here (not in a function)
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/ncs/v2.5.2/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.2/zephyr/include/zephyr/devicetree.h:3450:34: note: in expansion of macro 'DT_PROP'
     3450 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:31: note: in expansion of macro 'UTIL_CAT'
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3248:27: note: in expansion of macro 'DT_INST'
     3248 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3450:42: note: in expansion of macro 'DT_DRV_INST'
     3450 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1517:30: note: in expansion of macro 'DT_INST_PROP'
     1517 |                 .sck_delay = DT_INST_PROP(0, sck_delay),
          |                              ^~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:40: error: 'DT_N_INST_0_nordic_qspi_nor_P_jedec_id' undeclared here (not in a function); did you mean 'DT_N_INST_0_nordic_nrf_qdec'?
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/ncs/v2.5.2/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.2/zephyr/include/zephyr/devicetree.h:3450:34: note: in expansion of macro 'DT_PROP'
     3450 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                  ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:31: note: in expansion of macro 'UTIL_CAT'
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3248:27: note: in expansion of macro 'DT_INST'
     3248 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3450:42: note: in expansion of macro 'DT_DRV_INST'
     3450 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
          |                                          ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1522:15: note: in expansion of macro 'DT_INST_PROP'
     1522 |         .id = DT_INST_PROP(0, jedec_id),
          |               ^~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:40: error: 'DT_N_INST_0_nordic_qspi_nor_FULL_NAME' undeclared here (not in a function)
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                                        ^~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/device.h:892:25: note: in definition of macro 'Z_DEVICE_INIT'
      892 |                 .name = name_,                                                 \
          |                         ^~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/device.h:981:9: note: in expansion of macro 'Z_DEVICE_BASE_DEFINE'
      981 |         Z_DEVICE_BASE_DEFINE(node_id, dev_id, name, pm, data, config, level,   \
          |         ^~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/device.h:180:9: note: in expansion of macro 'Z_DEVICE_DEFINE'
      180 |         Z_DEVICE_DEFINE(node_id, Z_DEVICE_DT_DEV_ID(node_id),                  \
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:69:53: note: in expansion of macro '__DEBRACKET'
       69 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
          |                                                     ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       64 |         __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |         ^~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
       59 |         __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_macro.h:180:9: note: in expansion of macro 'Z_COND_CODE_1'
      180 |         Z_COND_CODE_1(_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:777:9: note: in expansion of macro 'COND_CODE_1'
      777 |         COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
          |         ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/device.h:146:9: note: in expansion of macro 'DT_PROP_OR'
      146 |         DT_PROP_OR(node_id, label, DT_NODE_FULL_NAME(node_id))
          |         ^~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:521:36: note: in expansion of macro 'DT_CAT'
      521 | #define DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME)
          |                                    ^~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/device.h:146:36: note: in expansion of macro 'DT_NODE_FULL_NAME'
      146 |         DT_PROP_OR(node_id, label, DT_NODE_FULL_NAME(node_id))
          |                                    ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/device.h:181:25: note: in expansion of macro 'DEVICE_DT_NAME'
      181 |                         DEVICE_DT_NAME(node_id), init_fn, pm, data, config,    \
          |                         ^~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/device.h:195:9: note: in expansion of macro 'DEVICE_DT_DEFINE'
      195 |         DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
          |         ^~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
      104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
          |                          ^~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:333:31: note: in expansion of macro 'UTIL_CAT'
      333 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
          |                               ^~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/devicetree.h:3248:27: note: in expansion of macro 'DT_INST'
     3248 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
          |                           ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/device.h:195:26: note: in expansion of macro 'DT_DRV_INST'
      195 |         DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
          |                          ^~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1527:1: note: in expansion of macro 'DEVICE_DT_INST_DEFINE'
     1527 | DEVICE_DT_INST_DEFINE(0, qspi_nor_init, PM_DEVICE_DT_INST_GET(0),
          | ^~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:110:17: warning: '__pinctrl_states__device_dts_ord_DT_N_INST_0_nordic_qspi_nor_BUS_ORD' defined but not used [-Wunused-const-variable=]
      110 |         _CONCAT(__pinctrl_states, DEVICE_DT_NAME_GET(node_id))
          |                 ^~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/toolchain/common.h:132:26: note: in definition of macro '_DO_CONCAT'
      132 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:110:9: note: in expansion of macro '_CONCAT'
      110 |         _CONCAT(__pinctrl_states, DEVICE_DT_NAME_GET(node_id))
          |         ^~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:171:9: note: in expansion of macro 'Z_PINCTRL_STATES_NAME'
      171 |         Z_PINCTRL_STATES_NAME(node_id)[] = {                                   \
          |         ^~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/include/zephyr/drivers/pinctrl.h:242:9: note: in expansion of macro 'Z_PINCTRL_STATES_DEFINE'
      242 |         Z_PINCTRL_STATES_DEFINE(node_id)                                       \
          |         ^~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/zephyr/drivers/flash/nrf_qspi_nor.c:1494:1: note: in expansion of macro 'PINCTRL_DT_DEFINE'
     1494 | PINCTRL_DT_DEFINE(QSPI_NODE);
  • allenyang said:
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="test"
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    CONFIG_HW_ID_LIBRARY=y
    CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC=y

    Let us simplify:

    Only CONFIG_BT=y should be enough to add a network core image automatically.
    Try to add only that, so we can make sure the other configs do not interfere.

  • Hi, I tried the way you said,

    when I only added  CONFIG_BT=y, it successfully build.

    but when adding CONFIG_BT_PERIPHERAL=y , the errors occur.

    so it seems doesn't affect by network core image?

  • This could maybe be related to configuration ordering
    Could you provide an overview over your project configuration and custom board configuration?
    (Folder structure and such)

Related