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.

  • 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:
    github.com/.../readme-zephyr.md

    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?

    Thanks,

  • 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:

    https://github.com/nrfconnect/sdk-mcuboot/blob/main/docs/readme-zephyr.md#generating-a-new-keypair

    -Einar

  • 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

     https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.1/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html 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,

    Karen

  • 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?

    -Einar

  • Hi Einarh,

    I am trying to get the server side working on this page: https://github.com/simon-iversen/ncs_samples/tree/master/central_smp_client_dfu while the client side is fine, and showing that it's scanning after starting up. The server side is showing me this: 

    While building or flashing it, I have not received and error message so I assumed that everything was fine, but now it' telling me it failed reading image header.

    Thanks,

Related