Merged.hex & merged_CPUNET.hex not created (running BLE Peripheral sample)

Hello, 
I'm trying to run the Ble Peripheral sample from "nrf\samples\bluetooth\peripheral_lbs"
i'm using nrf connect V1.8.0 and NRF5340dk
i followed the code in the github 
but i was not able to run it on the CPU_NET neither on the CPU_APP 
i have read that: in order for the Bluetooth LE sample to function properly on the nRF53 the hex file <build folder>\zephyr\merged.hex has to get programmed onto the application core and the hex file <build folder>hci_rpmsg\zephyr\merged_CPUNET.hex has to get programmed onto the network core.
However i tried to run this command "nrfjprog -f NRF53 --coprocessor CP_NETWORK --eraseall && nrfjprog -f NRF53 --coprocessor CP_NETWORK --program merged_CPUNET.hex" under the "nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr" 
but  i had an output saying that the operation is unvailable due to to readback protection on => so i tried runnning "nrfjprog -f NRF53 -- recover"  and it was successfull 

but even after running ths and returninng to build the merged file it always shows the same error

do you have any suggestions to be able to build the BLE Peripheral app ?
i even tried to run it by the west command i had an error 


if you have any ideas that can help or any suggestions please feel free 
i will be very gratefull 

Kindly, 

 

  • Hi,

    See Working with the nRF5340DK-> Readback protection.

    do you have any suggestions to be able to build the BLE Peripheral app ?

    Try to delete the build folder and build again. Does this work?

    Regards,
    Sigurd Hellesvik

  • Hello, 
    Thank you for your help 
    the recover operation went well and successfully 

    but the problem here is, i'm always unable to build the application nor to program the merged.hex or the merged_CPUNET.hex. and this is because the app isn't building 
    i have several errors that occured when i ran: west build

    -- west build: building application
    [5/251] Performing build step for 'hci_rpmsg_subimage'
    [164/201] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj
    C:\Users\rzaafouri\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.7.0-ncs1 -DKERNEL -DNRF5340_XXAA_NETWORK -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/drivers/mpsl/clock_control -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/include -Izephyr/include/generated -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/settings/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/lib/multithreading_lock/. -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/subsys/bluetooth/controller/. -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/drivers/flash -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/mdk -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/rzaafouri/ncs/v1.8.0/modules/crypto/tinycrypt/lib/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/mpsl/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/mpsl/include/protocol -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/softdevice_controller/include -isystem C:/Users/rzaafouri/ncs/v1.8.0/zephyr/lib/libc/minimal/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros C:/Users/rzaafouri/ncs/v1.8.0/nrf/samples/bluetooth/peripheral_lbs/build/hci_rpmsg/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33+nodsp -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -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 -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr/samples/bluetooth/hci_rpmsg=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -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 C:/Users/rzaafouri/ncs/v1.8.0/zephyr/samples/bluetooth/hci_rpmsg/src/main.c
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/samples/bluetooth/hci_rpmsg/src/main.c:18:10: fatal error: openamp/open_amp.h: No such file or directory
       18 | #include <openamp/open_amp.h>
          |          ^~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    [169/201] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/dis.c.obj
    FAILED: zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/dis.c.obj
    C:\Users\rzaafouri\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.7.0-ncs1 -DKERNEL -DNRF5340_XXAA_NETWORK -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/kernel/include -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/arch/arm/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/drivers/mpsl/clock_control -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/include -Izephyr/include/generated -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/settings/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/lib/multithreading_lock/. -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/subsys/bluetooth/controller/. -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/drivers/flash -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/mdk -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/rzaafouri/ncs/v1.8.0/modules/crypto/tinycrypt/lib/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/mpsl/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/mpsl/include/protocol -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/softdevice_controller/include -isystem C:/Users/rzaafouri/ncs/v1.8.0/zephyr/lib/libc/minimal/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros C:/Users/rzaafouri/ncs/v1.8.0/nrf/samples/bluetooth/peripheral_lbs/build/hci_rpmsg/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33+nodsp -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -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 -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr/samples/bluetooth/hci_rpmsg=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/dis.c.obj -MF zephyr\CMakeFiles\zephyr.dir\subsys\bluetooth\services\dis.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/dis.c.obj -c C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/dis.c
    In file included from C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/dis.c:26:
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:671:27: error: 'CONFIG_BT_MAX_PAIRED' undeclared here (not in a function); did you mean 'CONFIG_BT_MAX_CONN'?
      671 |  #define BT_GATT_CCC_MAX (CONFIG_BT_MAX_PAIRED + CONFIG_BT_MAX_CONN)
          |                           ^~~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:689:29: note: in expansion of macro 'BT_GATT_CCC_MAX'
      689 |  struct bt_gatt_ccc_cfg cfg[BT_GATT_CCC_MAX];
          |                             ^~~~~~~~~~~~~~~
    [170/201] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/bas.c.obj
    FAILED: zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/bas.c.obj
    C:\Users\rzaafouri\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.7.0-ncs1 -DKERNEL -DNRF5340_XXAA_NETWORK -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/kernel/include -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/arch/arm/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/drivers/mpsl/clock_control -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/include -Izephyr/include/generated -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/settings/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/lib/multithreading_lock/. -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/subsys/bluetooth/controller/. -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/drivers/flash -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/mdk -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/rzaafouri/ncs/v1.8.0/modules/crypto/tinycrypt/lib/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/mpsl/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/mpsl/include/protocol -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/softdevice_controller/include -isystem C:/Users/rzaafouri/ncs/v1.8.0/zephyr/lib/libc/minimal/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros C:/Users/rzaafouri/ncs/v1.8.0/nrf/samples/bluetooth/peripheral_lbs/build/hci_rpmsg/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33+nodsp -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -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 -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr/samples/bluetooth/hci_rpmsg=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/bas.c.obj -MF zephyr\CMakeFiles\zephyr.dir\subsys\bluetooth\services\bas.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/bas.c.obj -c C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/bas.c
    In file included from C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/bas.c:20:
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:671:27: error: 'CONFIG_BT_MAX_PAIRED' undeclared here (not in a function); did you mean 'CONFIG_BT_MAX_CONN'?
      671 |  #define BT_GATT_CCC_MAX (CONFIG_BT_MAX_PAIRED + CONFIG_BT_MAX_CONN)
          |                           ^~~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:689:29: note: in expansion of macro 'BT_GATT_CCC_MAX'
      689 |  struct bt_gatt_ccc_cfg cfg[BT_GATT_CCC_MAX];
          |                             ^~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:780:10: error: empty scalar initializer
      780 |   .cfg = {},                           \
          |          ^
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:521:47: note: in definition of macro 'BT_GATT_SERVICE_DEFINE'
      521 |  const struct bt_gatt_attr attr_##_name[] = { __VA_ARGS__ }; \
          |                                               ^~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:795:2: note: in expansion of macro 'BT_GATT_ATTRIBUTE'
      795 |  BT_GATT_ATTRIBUTE(BT_UUID_GATT_CCC, _perm,   \
          |  ^~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:808:2: note: in expansion of macro 'BT_GATT_CCC_MANAGED'
      808 |  BT_GATT_CCC_MANAGED(((struct _bt_gatt_ccc[])   \
          |  ^~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:809:4: note: in expansion of macro 'BT_GATT_CCC_INITIALIZER'
      809 |   {BT_GATT_CCC_INITIALIZER(_changed, NULL, NULL)}), _perm)
          |    ^~~~~~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/bas.c:56:2: note: in expansion of macro 'BT_GATT_CCC'
       56 |  BT_GATT_CCC(blvl_ccc_cfg_changed,
          |  ^~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:780:10: note: (near initialization for '(anonymous)[0].cfg')
      780 |   .cfg = {},                           \
          |          ^
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:521:47: note: in definition of macro 'BT_GATT_SERVICE_DEFINE'
      521 |  const struct bt_gatt_attr attr_##_name[] = { __VA_ARGS__ }; \
          |                                               ^~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:795:2: note: in expansion of macro 'BT_GATT_ATTRIBUTE'
      795 |  BT_GATT_ATTRIBUTE(BT_UUID_GATT_CCC, _perm,   \
          |  ^~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:808:2: note: in expansion of macro 'BT_GATT_CCC_MANAGED'
      808 |  BT_GATT_CCC_MANAGED(((struct _bt_gatt_ccc[])   \
          |  ^~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:809:4: note: in expansion of macro 'BT_GATT_CCC_INITIALIZER'
      809 |   {BT_GATT_CCC_INITIALIZER(_changed, NULL, NULL)}), _perm)
          |    ^~~~~~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/bas.c:56:2: note: in expansion of macro 'BT_GATT_CCC'
       56 |  BT_GATT_CCC(blvl_ccc_cfg_changed,
          |  ^~~~~~~~~~~
    [171/201] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/hrs.c.obj
    FAILED: zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/hrs.c.obj
    C:\Users\rzaafouri\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.7.0-ncs1 -DKERNEL -DNRF5340_XXAA_NETWORK -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/kernel/include -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/arch/arm/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/drivers/mpsl/clock_control -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/include -Izephyr/include/generated -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/settings/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/lib/multithreading_lock/. -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/subsys/bluetooth/controller/. -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/drivers/flash -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/mdk -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/rzaafouri/ncs/v1.8.0/modules/crypto/tinycrypt/lib/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/mpsl/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/mpsl/include/protocol -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/softdevice_controller/include -isystem C:/Users/rzaafouri/ncs/v1.8.0/zephyr/lib/libc/minimal/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros C:/Users/rzaafouri/ncs/v1.8.0/nrf/samples/bluetooth/peripheral_lbs/build/hci_rpmsg/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33+nodsp -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -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 -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr/samples/bluetooth/hci_rpmsg=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/hrs.c.obj -MF zephyr\CMakeFiles\zephyr.dir\subsys\bluetooth\services\hrs.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/hrs.c.obj -c C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/hrs.c
    In file included from C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/hrs.c:22:
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:671:27: error: 'CONFIG_BT_MAX_PAIRED' undeclared here (not in a function); did you mean 'CONFIG_BT_MAX_CONN'?
      671 |  #define BT_GATT_CCC_MAX (CONFIG_BT_MAX_PAIRED + CONFIG_BT_MAX_CONN)
          |                           ^~~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:689:29: note: in expansion of macro 'BT_GATT_CCC_MAX'
      689 |  struct bt_gatt_ccc_cfg cfg[BT_GATT_CCC_MAX];
          |                             ^~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:780:10: error: empty scalar initializer
      780 |   .cfg = {},                           \
          |          ^
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:521:47: note: in definition of macro 'BT_GATT_SERVICE_DEFINE'
      521 |  const struct bt_gatt_attr attr_##_name[] = { __VA_ARGS__ }; \
          |                                               ^~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:795:2: note: in expansion of macro 'BT_GATT_ATTRIBUTE'
      795 |  BT_GATT_ATTRIBUTE(BT_UUID_GATT_CCC, _perm,   \
          |  ^~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:808:2: note: in expansion of macro 'BT_GATT_CCC_MANAGED'
      808 |  BT_GATT_CCC_MANAGED(((struct _bt_gatt_ccc[])   \
          |  ^~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:809:4: note: in expansion of macro 'BT_GATT_CCC_INITIALIZER'
      809 |   {BT_GATT_CCC_INITIALIZER(_changed, NULL, NULL)}), _perm)
          |    ^~~~~~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/hrs.c:76:2: note: in expansion of macro 'BT_GATT_CCC'
       76 |  BT_GATT_CCC(hrmc_ccc_cfg_changed,
          |  ^~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:780:10: note: (near initialization for '(anonymous)[0].cfg')
      780 |   .cfg = {},                           \
          |          ^
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:521:47: note: in definition of macro 'BT_GATT_SERVICE_DEFINE'
      521 |  const struct bt_gatt_attr attr_##_name[] = { __VA_ARGS__ }; \
          |                                               ^~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:795:2: note: in expansion of macro 'BT_GATT_ATTRIBUTE'
      795 |  BT_GATT_ATTRIBUTE(BT_UUID_GATT_CCC, _perm,   \
          |  ^~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:808:2: note: in expansion of macro 'BT_GATT_CCC_MANAGED'
      808 |  BT_GATT_CCC_MANAGED(((struct _bt_gatt_ccc[])   \
          |  ^~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/bluetooth/gatt.h:809:4: note: in expansion of macro 'BT_GATT_CCC_INITIALIZER'
      809 |   {BT_GATT_CCC_INITIALIZER(_changed, NULL, NULL)}), _perm)
          |    ^~~~~~~~~~~~~~~~~~~~~~~
    C:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth/services/hrs.c:76:2: note: in expansion of macro 'BT_GATT_CCC'
       76 |  BT_GATT_CCC(hrmc_ccc_cfg_changed,
          |  ^~~~~~~~~~~
    [177/201] Building C object zephyr/kernel/CMakeFiles/kernel.dir/queue.c.obj
    ninja: build stopped: subcommand failed.
    [220/251] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj
    C:\Users\rzaafouri\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.7.0-ncs1 -DKERNEL -DNRF5340_XXAA_APPLICATION -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I../. -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/include -Izephyr/include/generated -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/bluetooth -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/subsys/settings/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrf/include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/hal/nordic/nrfx/mdk -IC:/Users/rzaafouri/ncs/v1.8.0/zephyr/modules/hal_nordic/nrfx/. -Imodules/libmetal/libmetal/lib/include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/lib/open-amp/open-amp/lib/include -IC:/Users/rzaafouri/ncs/v1.8.0/modules/crypto/tinycrypt/lib/include -IC:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/softdevice_controller/include -isystem C:/Users/rzaafouri/ncs/v1.8.0/zephyr/lib/libc/minimal/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/rzaafouri/ncs/v1.8.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem C:/Users/rzaafouri/ncs/v1.8.0/nrfxlib/crypto/nrf_cc312_platform/include -Os -imacros C:/Users/rzaafouri/ncs/v1.8.0/nrf/samples/bluetooth/peripheral_lbs/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/Users/rzaafouri/ncs/v1.8.0/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -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 -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/nrf/samples/bluetooth/peripheral_lbs=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/rzaafouri/ncs/v1.8.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -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:11:10: fatal error: zephyr/sys/printk.h: No such file or directory
       11 | #include <zephyr/sys/printk.h>
          |          ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    [231/251] Building C object zephyr/kernel/CMakeFiles/kernel.dir/work.c.obj
    FAILED: modules/nrf/samples/hci_rpmsg_subimage-prefix/src/hci_rpmsg_subimage-stamp/hci_rpmsg_subimage-build hci_rpmsg/zephyr/zephyr.hex hci_rpmsg/zephyr/zephyr.elf hci_rpmsg/zephyr/merged_CPUNET.hex
    cmd.exe /C "cd /D C:\Users\rzaafouri\ncs\v1.8.0\nrf\samples\bluetooth\peripheral_lbs\build\hci_rpmsg && C:\Users\rzaafouri\ncs\v1.8.0\toolchain\opt\bin\cmake.exe --build . --"
    [233/251] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\Users\rzaafouri\ncs\v1.8.0\toolchain\opt\bin\cmake.EXE' --build 'C:\Users\rzaafouri\ncs\v1.8.0\nrf\samples\bluetooth\peripheral_lbs\build'

    can you help solve them please 
    Note that i didn't change nothing from the sample of Peripheral_lbs that's whyi don't understand whyit doesn't build 
    is there something wrong with my config files ? or should i try to run it on the nrf5340dk_nrf5340_cpunet ?
    can you help me find out what's causing the build fail please 

    Kindly thankful,

  • Hi,

    To test, can you try to build the zephyr hello world sample?
    (v1.8.0/zephyr/samples/hello_world)

    Regards,
    Sigurd Hellesvik

  • Hello, 
    My Hello_world sample works very well 
    but i'm still getting the same error on the peripheral_lbs project 

  • Hello, 
    infact i'm trying to work according to this link
    but the thing is, in the nrfjrog commands . they are recommanding to run a command to program the merged_CPUNET.hex. what i don't understand is : howcan we program the merged file when it is not created yet. normally this file is created when the build is executed but in the tutorial the build command come in the section after.
    can you relate ? 

Related