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

Implementing buttonless_dfu to hrs_freertos

Hi,

I am developing the 'buttonless dfu' to the 'hrs freertos' using the SDK v15.3.0.

However, after I compiled the modified code and loaded to the target broad, I got the below error.

    <info> app: nrf_sdh_ble_enable() err:0 ram_start:0x20002258
    <error> app: Fatal error

Is there any example for this application?

Thanks

  • Hi Terry,

    Terry said:
    I also found that according to this. The '--bl-settings-version' for SDK 15.3.0 was required to be set to '2'. However, I only could set it to be '1' otherwise, I got error.

    Please provide the complete command you used and the error message. 

    What is the nrfutil version? 

    C:\WINDOWS\system32>nrfutil version
    nrfutil version 5.2.0

    -Amanda H.

  • Hi Amanda,

    The version of nrfutil is 3.3.2

    I am developing on Ubuntu 16.04.

    The command I used is as below

    nrfutil settings generate --family NRF52 --application application.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 bootloaderSettings.hex
     

    If I set the '--bl-settings-version' to '2', I got the below error,

    Traceback (most recent call last):
    File "/home/terrychan/.local/bin/nrfutil", line 11, in <module>
    sys.exit(cli())
    File "/home/terrychan/.local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
    File "/home/terrychan/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
    File "/home/terrychan/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/home/terrychan/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/home/terrychan/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "/home/terrychan/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
    File "/home/terrychan/.local/lib/python2.7/site-packages/nordicsemi/__main__.py", line 239, in generate
    sett.generate(arch=family, app_file=application, app_ver=application_version_internal, bl_ver=bootloader_version, bl_sett_ver=bl_settings_version)
    File "/home/terrychan/.local/lib/python2.7/site-packages/nordicsemi/dfu/bl_dfu_sett.py", line 125, in generate
    raise NordicSemiException("Unknown bootloader settings version")
    pc_ble_driver_py.exceptions.NordicSemiException: Unknown bootloader settings version

    Hi Amanda,

    I used another PC in which I install the nrfutil version 6.1.0.

    I used the below command to generate the bootloader setting

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

    And then, I used the below command to program the application + bootloader setting

    echo Merging: application.hex and bootloaderSettings.hex
    mergehex -m ./application.hex ./bootloaderSettings.hex -o mergedBootloadersettingsApplication.hex
    
    echo Flashing: mergedBootloadersettingsApplication.hex
    nrfjprog -f nrf52 --program mergedBootloadersettingsApplication.hex --sectorerase
    
    sleep 2
    
    nrfjprog -f nrf52 --reset
    
    rm -fv bootloaderSettings.hex
    rm -fv mergedBootloadersettingsApplication.hex

    However, the EV board could not be booted up

    Please note that I programmed the bootloader + SD with the below command

    echo Merging: bootloader.hex and s132_nrf52_6.1.1_softdevice.hex
    mergehex -m ./bootloader.hex ./s132_nrf52_6.1.1_softdevice.hex -o mergedBootloaderSoftdevice.hex
    
    echo Flashing: mergedBootloaderSoftdevice.hex
    nrfjprog -f nrf52 --program mergedBootloaderSoftdevice.hex --chiperase
    
    sleep 2
    
    nrfjprog -f nrf52 --reset
    
    rm -fv mergedBootloaderSoftdevice.hex
    

  • Hi Terry,

    Terry said:
    The version of nrfutil is 3.3.2

    I think this version is too old to support SDK 15.3 later. 

    Terry said:
    Please note that I programmed the bootloader + SD with the below command

    After you program the bootloader + SD, you should see the device advertises with the name as "DfuTarg". 

    Terry said:
    And then, I used the below command to program the application + bootloader setting

     What is the application you used? Is it your application or example application? If you use hrs_application_s132  + bootloader setting, you should see the device advertises with the name as "Nordic_HRM" after programing and reset. If you can work with the example application, you could see the step-5--debugging-application-fw-with-bootloader-in-place.

    -Amanda H.

  • Hi Amanda,

    I think this version is too old to support SDK 15.3 later. 

    As replied before, I have continued my testing on another PC and the version of the tool is 6.1.0.

    After you program the bootloader + SD, you should see the device advertises with the name as "DfuTarg".

    Yes, I can see that. Thus, I can program the application image through mobile APP.

    What is the application you used? Is it your application or example application?

    The application is the example "ble_app_buttonless_dfu".

  • Hi Terry,

    Terry said:
    Thus, I can program the application image through mobile APP.

    If you upload the application, you should prepare the package as:

    nrfutil pkg generate --application ble_app_buttonless_dfu_pca10040_s132.hex --application-version 1 --application-version-string "1.0.0" --hw-version 52 --sd-req 0xB7 --key-file private.pem FW.zip

    If you program the ble_app_buttonless_dfu with nrfjprog (with the programed bootloader + SD), you should prepare the application as:

    nrfutil settings generate --family NRF52 --application ble_app_buttonless_dfu_pca10040_s132.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 bootloaderSettings.hex
    
    mergehex -m ble_app_buttonless_dfu_pca10040_s132.hex bootloaderSettings.hex -o merged.hex
    
    nrfjprog --program merged.hex --sectorerase
    
    nrfjprog -r

    Or you can merge your mergedBootloadersettingsApplication.hex and mergedBootloaderSoftdevice.hex to one hex (bootloader+softdevice+setting+app) to program and reset.

    -Amanda H. 

Related