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

DFU CHARACTERISTICS NOT FOUND issue with sdk 14.0.1

Hello,

I am trying to merge the code of ble_app_buttonless_dfu with the code of ble_app_uart, because I starts all implementation with the code of ble_app_uart at first,

I describe all procedure related with DFU test, I already succeeded DFU test with the hex file of ble_app_buttonless_dfu and then I am trying to do DFU test with merged code,

when trying to download new application package with dfu app of nrf tool(android phone), DFU CHARACTERISTICS NOT FOUND is happened,...why?

please help to let me know what the problem is,

thankful for your support in advance, thanks...

1) Installing nrfutil, 

	* Python 2.7 (2.7.6 or later, but not Python 3)
	* pip (see Installing Python Modules)

    Need to follow the procedure by referring http://nomis.tistory.com/115
    after that, try to type "pip install nrfutil"

2) Installing micro-ecc,
    Can find the micro-ecc in SDK_folder as follows, 

    ex) C:\working_dir\new_ble\nRF5_SDK_14.1.0_1dda907\external\micro-ecc

    Need to download uECC library in SDK-Folder/external/micro-ecc/micro-ecc from github.com/.../micro-ecc 
    please user the following command in external/micro-ecc in cmd shell,

    git clone github.com/.../micro-ecc.git

3) Installing GNU Make environment,

following http://ts.devbj.com/277 

After 1/2/3 steps, can build bootload (C:\working_dir\new_ble\nRF5_SDK_14.1.0_1dda907\examples\dfu\bootloader_secure_ble)
following the procedure by referring the steps as follows,


	1. Build micro-ecc, 

        in C:\working_dir\new_ble\nRF5_SDK_14.1.0_1dda907\external\micro-ecc\nrf52_armgcc\armgcc
        type 'build'
        can get micro_ecc_lib_nrf52.a


	1. Build bootloader (bootloader_secure_ble),


#ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS
#define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0
#endif

        2-1) Need to create private key for public key,

        make folder, 
        type 'mkdir private_key'
        enter the folder,
        type 'nrfutil keys generate private.key'
        after getting private.key, need to make public.key
        type ' keys display --key pk --format code private.key --out_file public_key.c'

      - Need to keep the private.key


        2-2) build bootloader code with public_key

        Change the public key in dfu_public_key.c of C:\working_dir\new_ble\nRF5_SDK_14.1.0_1dda907\examples\dfu\dfu_req_handling
        build the micro-ecc

        in my case, hope to use nrf52_armgcc, 
        so in C:\working_dir\new_ble\nRF5_SDK_14.1.0_1dda907\external\micro-ecc\nrf52_armgcc\armgcc, 
        type 'make'
        can check micro_ecc_lib_nrf52.a
        this library will be used in build-procedure of secure bootloader,
    
        after that, in C:\working_dir\new_ble\nRF5_SDK_14.1.0_1dda907\examples\dfu\bootloader_secure_ble\pca10040\armgcc
        type 'make'
        can check nrf52832_xxaa_s132.hex


	1. Original Image Creation


        Firstly Need to make original total-image in order to download image through DFU function,

        Need to make settings.hex file (including init packet), 

        so please gather all images related with softdevice, bootloader(bootloader_secure_ble) and application(ble_app_buttonless_dfu) in one folder,

        after that, type the following command, 


        3-1)  Create and view the settings.hex file.  nrf52832_xxaa.hex ==> application hex file / nrf52832_xxaa_s132.hex ==> secure bootloader hex file,

        nrfutil settings generate --family NRF52 --application nrf52832_xxaa.hex --application-version 3 --bootloader-version 2 --bl-settings-version 1 settings.hex

        nrfutil settings display settings.hex

        3-2) Combine the softdevice with the bootloader

        mergehex --merge s132_nrf52_5.0.0_softdevice.hex nrf52832_xxaa_s132.hex --output SD_BL.hex

      3-3) Add the application to it

        mergehex --merge SD_BL.hex nrf52832_xxaa.hex --output SD_BL_APP.hex

       3-4) Add the settings file to the Softdevice/bootloader/application hex

        mergehex --merge SD_BL_APP.hex settings.hex --output SD_EL_APP_valid.hex

      3-5) Flash it on the board after that, we can try to download app package by app in the phone,

        nrfjprog --chiperase --program SD_EL_APP_valid.hex -f NRF52 -r

        Other examples of flashing :

            nrfjprog --family nRF52 --program softdevice_bootloader_secure_ble_debug_without_bonds_s132.hex 
            nrfjprog --family nRF52 --program ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex


	1. Create a firmware package(application or bootloader or bootloader+softdevice),


        Type the following command, need to update the version than original-version, ex) will download original image with 3 version as to application so need 
        to  upgrade the version to 4 version as follows with the same private key as original image, 

nrfutil pkg generate --hw-version 52 --sd-req 0x9D --application-version 4 --application ./_build/nrf52832_xxaa.hex --key-file private.key app_dfu_package.zip

ref) 
nrfutil pkg generate --help ==> In oder to check the number of softdevice version for --sd-req  need to use 0x9D by |s132_nrf52_5.0.0|0x9D|

and I merged the code like below,

in the main routine of my code,

#ifdef DFU_BUTTONLESS_ENABLE//love_0122
    ble_dfu_buttonless_init_t dfus_init =
    {
        .evt_handler = ble_dfu_evt_handler
    };

    // Initialize the async SVCI interface to bootloader.
    err_code = ble_dfu_buttonless_async_svci_init();
    APP_ERROR_CHECK(err_code);


    err_code = ble_dfu_buttonless_init(&dfus_init);
    APP_ERROR_CHECK(err_code);
#endif 

thanks.

  • currently I can build after merging the code of buttonless app... when I check the status of DFU service in app, "this service is empty" sentence is showed,....why ?

    in the setting of sdk_config header file,

    #ifndef BLE_DFU_ENABLED #define BLE_DFU_ENABLED 1 #endif

    // NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS - Buttonless DFU supports bonds.

    #ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS #define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0 #endif

    thanks.

  • Hi Edmond,

    Please don't try to test everything at once.

    Please confirm if you setup passes the following test:

    1. Test bootloader, DFU upload a normal application, such as ble_app_hrs . Test only the bootloader, don't do merge application or flash bootloader setting.
    2. Test the buttonless DFU application + bootloader. Make sure you can do DFU from the application so that the application automatic switch to bootloader and then do DFU.
    3. Use BLE master tool, such as the NRFConnect tool to open your combined buttonless DFU and your application ( ble_app_uart), make sure you see the 2 services. Make sure you have increased NRF_SDH_BLE_VS_UUID_COUNT to match with number of 128 bit base UUID you define (in your case it should be 2 ? )

    After that you can start testing with the buttonless feature, try to write to the DFU control point to switch the application to the bootloader. Please follow the documentation.

  • Hello, Hung,

    firstly thankful for detailed guide, and I would like share more status with you, Could you please kindly refer it and guide me more ?

    firstly I already succeeded the test of dfu with buttonless app & secure boot in sdk 14.0.1 and then I tried to merge the code with my code, after that the compile is already ok, only when trying to do dfu in app with pak file(app), I can see "the service of dfu is empty" and the message : "dfu characteristic is empty"...

    so I wonder why this kind of issue is happened with merged source ....? Could you please kindly review what I should merge or set in skd_config.h ? thankful for your kindness in advance,

    thanks.

  • Hello, Hung,

    good news, I solved issue now, the problem is NRF_SDH_BLE_VS_UUID_COUNT , after increasing the number, the issue is not happened, anyway, I am very thankful for your kind guide, have good day

    thanks.

Related