How to create customized software to program boards via bluetooth on nRF Connect

Hi, I'd like to add that "BLE capabilities for nRF Connect" to my customized software in the dongle, is there an example code or template which I can add to my customized code such that it can do that? Because when I tried using the dfu sample codes that come with the SDK 17.1.0, I was stilled asked to program the device to something else.

  • Hello

    Can you please explain more clearly exactly what you want your program to do?

    I'd like to add that "BLE capabilities for nRF Connect" to my customized software in the dongle

    It's not really clear to me what you mean by this.

    Best regards,


  • Hi Einar,

    I've that quote from this post:  Example for Performing OTA DFU from NRF52840 Dongle to NRF52 peripheral ?

    What I'd like to do is to use the dongle to transfer data via Bluetooth from my peripheral device to the computer (meaning I have my customized software on the dongle) while also using it to upgrade my firmware on the peripheral device when it needs upgrading. Because currently if I need to use the dongle to upgrade the firmware on the peripheral device, I need to reprogram the dongle with a special firmware from Nordic, and then put my own firmware back in afterwards. I would like to use just one firmware to do both. If that's possible.


  • Is there any reason you're trying to install this manually?

    I would recommend installing NCS through the Toolchain Manager in nRF Connect for Desktop.


  • Hi Einar,

    I've been trying to repeat the example you have suggested. I got stuck in trying to build the server side: (4) "Build and program the sample \zephyr\samples\subsys\mgmt\mcumgr\smp_svr to nRF52840DK_server with the Kconfig fragment \smp_svr\overlay-bt.conf applied"

    According to the readme file, I'm supposed to sign the sample image as such:
    west sign -t imgtool -- --key bootloader/mcuboot/root-rsa-2048.pem

    But I don't have root-rsa-2048.pem, so I tried downloading the source files and compile it following the instructions here:

    But I failed at the ninja command, with the following error:

    In file included from ←[01m←[KC:/ncs/v2.1.1/zephyr/include/zephyr/sys/kobject.h:36←[m←[K,
    from ←[01m←[KC:/ncs/v2.1.1/zephyr/include/zephyr/kernel_includes.h:41←[m←[K,
    from ←[01m←[KC:/ncs/v2.1.1/zephyr/include/zephyr/kernel.h:17←[m←[K,
    from ←[01m←[KC:/ncs/v2.1.1/zephyr/arch/arm/core/offsets/offsets_aarch32.c:28←[m←[K,
    from ←[01m←[KC:/ncs/v2.1.1/zephyr/arch/arm/core/offsets/offsets.c:9←[m←[K:
    ←[01m←[KC:/sdk-mcuboot/boot/zephyr/build/zephyr/include/generated/kobj-types-enum.h:50:1:←[m←[K ←[01;31m←[Kerror: ←[m←[Kredeclaration of enumerator '←[01m←[KK_OBJ_DRIVER_FLASH←[m←[K'
    50 | ←[01;31m←[KK_OBJ_DRIVER_FLASH←[m←[K,
    | ←[01;31m←[K^~~~~~~~~~~~~~~~~~←[m←[K
    ←[01m←[KC:/sdk-mcuboot/boot/zephyr/build/zephyr/include/generated/kobj-types-enum.h:34:1:←[m←[K ←[01;36m←[Knote: ←[m←[Kprevious definition of '←[01m←[KK_OBJ_DRIVER_FLASH←[m←[K' was here
    34 | ←[01;36m←[KK_OBJ_DRIVER_FLASH←[m←[K,
    | ←[01;36m←[K^~~~~~~~~~~~~~~~~~←[m←[K
    ninja: build stopped: subcommand failed.

    I had a lot of duplicated definitions, but they are all defined in generated files, so I can't just remove them.
    Do you know how I can solve this issue?


  • Hi

    karenl said:
    so I tried downloading the source files and compile it

    This doesn't sound like a good idea, and I would expect errors like the ones you are getting.

    Instead I would recommend looking at how to generate keys in the documentation you linked:


  • Thanks Einarh,

    I tried it on both Windows and Linux machines. While mcumgr echo command (

    sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Zephyr' echo hello) from on Windows replied with a message saying Windows does not support mcumgr. (As expected) Linux couldn't get a response from the development board and said it could not get a response in 10s. I followed every step of the instructions on that page. Installed everything asked. Everything seemed fine up to that point. I tested with the Nrf connect phone app, and was not able to pick up the dev board from the scan. Can you think of any reason why that would be? Is there any test I can do to sort that out? Or could you share a binary/hex file that works so that I can at least check my set up?

    Thanks and Regards,


  • Hi

    It's hard to say without more information and context.

    What page are you following instructions on?

    What exactly are you trying to achieve at this point?

    What things did you test that worked correctly before you encountered this unexpected behavior?

    What NCS version are you using at this point?


Reply Children