This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BLE DFU update

Dear Forum,

I have the following issue (my System: Ubuntu 20.04):

I created the secure bootloader with Softdevice S140 (v.7.2.0) for 52833 chipset, I use a 52833 Development Kit (DK) and a 52833 evaluation board (EB).

Keys were applied:

nrfutil keys generate private.pem

nrfutil keys display --key pk --format code private.pem --out_file dfu_public_key.c

Copied dfu_public_key.c to secure_bootloader, then build.

As first step, I connect the DK board via USB and it's Debug out to the Evaluation board (which is powered via USB, too). I can then upload firmware and S140 either via SES or (using mergehex) via nrfjprog to the evaluation board.

I then can use the nrfutil tool (version version 6.1.3) to generate the app.zip:

nrfutil pkg generate --hw-version 52 --sd-req 0x100 --application-version 4 --application ./ble_app_pca10056e_s140.hex --key-file private.pem app_dfu_package.zip

Prove that all steps worked:

If I copy the app_dfu_package.zip to my smartphone, open nrfToolbox/DFU, I can select device: DfuTarg

Then I select file app_dfu_package.zip

I choose then scope "Application only" and everything works, the app gets installed on the EB.

Now I want to use nrfutil instead of the smartphone for the last step (OTA update via BLE), of course I check that the bootloader is active on EB as before smartphone DFU.

So I unplug the debug bridge between DK and EB, clear the DK (to be sure, I used the nrfProgrammer "Erase all" from nRF Connect for Desktop).

I then issue:

nrfutil dfu ble -f -ic NRF52 -pkg ./app_dfu_package.zip -p /dev/ttyACM1 -n "DfuTarg"

This responds the following error:

Flashing connectivity firmware...
Connectivity firmware flashed.

Traceback (most recent call last):
  File "/usr/local/bin/nrfutil", line 33, in <module>
    sys.exit(load_entry_point('nrfutil==6.1.3', 'console_scripts', 'nrfutil')())
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/nrfutil-6.1.3-py3.8.egg/nordicsemi/__main__.py", line 1205, in ble
    dfu.dfu_send_images()
  File "/usr/local/lib/python3.8/dist-packages/nrfutil-6.1.3-py3.8.egg/nordicsemi/dfu/dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
  File "/usr/local/lib/python3.8/dist-packages/nrfutil-6.1.3-py3.8.egg/nordicsemi/dfu/dfu.py", line 95, in _dfu_send_image
    self.dfu_transport.send_init_packet(data)
  File "/usr/local/lib/python3.8/dist-packages/nrfutil-6.1.3-py3.8.egg/nordicsemi/dfu/dfu_transport_ble.py", line 525, in send_init_packet
    self.__stream_data(data=init_packet)
  File "/usr/local/lib/python3.8/dist-packages/nrfutil-6.1.3-py3.8.egg/nordicsemi/dfu/dfu_transport_ble.py", line 643, in __stream_data
    self.dfu_adapter.write_data_point(list(to_transmit))
  File "/usr/local/lib/python3.8/dist-packages/nrfutil-6.1.3-py3.8.egg/nordicsemi/dfu/dfu_transport_ble.py", line 351, in write_data_point
    self.adapter.write_cmd(self.conn_handle, DFUAdapter.DP_UUID, data)
  File "/usr/local/lib/python3.8/dist-packages/pc_ble_driver_py-0.16.2-py3.8-linux-x86_64.egg/pc_ble_driver_py/ble_adapter.py", line 567, in write_cmd
    raise e
  File "/usr/local/lib/python3.8/dist-packages/pc_ble_driver_py-0.16.2-py3.8-linux-x86_64.egg/pc_ble_driver_py/ble_adapter.py", line 553, in write_cmd
    response = self.driver.ble_gattc_write(conn_handle, write_params)
  File "/usr/local/lib/python3.8/dist-packages/pc_ble_driver_py-0.16.2-py3.8-linux-x86_64.egg/pc_ble_driver_py/ble_driver.py", line 106, in wrapper
    raise NordicSemiException(
pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: NRF_ERROR_SD_RPC_NO_RESPONSE

If I check with nrfProgrammer "Read", it reports for the connectivity software installed on the DK:

SoftDevice detected, id 0xA5 (S132 v5.1.0)

I suspect, that there might be an issue with the used connectivity firmware with softdevice 5.1.0 and the bootloader/softdevice version 7.2.0, but found no way how to update the connectivity firmware.

Maybe there is some other reason, I'd be glad for any hint at that point.

Additional info: I use python 3.8.10

Best regards,

Richard

  • Hi, 

    For Error code: NRF_ERROR_SD_RPC_NO_RESPONSE, Have a look at this post

    SoftDevice detected, id 0xA5 (S132 v5.1.0)

    You cannot just only update the app which requires Softdevice S140 (v.7.2.0). It should update SD+BL+AD to run the new app with the new SD. Please be aware that

    While updating with the new SD, the command requires two different SD IDs. The first update requires --sd-req to be set to the ID of the old SD. The APP update requires the ID of the new SD. The new ID must be set using --sd-id parameter. This parameter was added in nRF Util v3.1.0 and is required since v3.2.0 in case the package should contain SD (+ BL) + APP. Also, the new ID is copied to --sd-req list so that in case of a link loss during the APP update the DFU process can be restarted. In this case, the new SD would overwrite itself, so --sd-req must contain the ID of the new SD. See DFU package combinations

    Regards,
    Amanda

  • Hello Amanda,

    Thank you for the reply. I never experienced problems using the JLink before, but will try the command:

    MSDDisable 

    Now for the following I'm confused by your instructions/explanations:

    Just to be sure, that we have same understanding of what I do:

    Upload Secure Bootloader & SD S140 (7.2.0) (merged by mergehex) to EB:

    Works: [Linux PC/nrfjprog] --[USB]-->DK --[DebugCable]-->EB

    Upload Signed App.zip (compiled for S140 7.2.0) to EB:

    A) Works: [Smartphone/nrfToolbox-DFU]   >>>>  [BLE]  >>>> EB

    B) Works not: [Linux PC/nrfUtil] --[USB]-->DK   >>>>  [BLE]  >>>> EB

    Important: After executing B, the *DK* contains S132 v5.1.0, the EB somehow crashes.

    As the update of App.zip (containing app.hex and none of SD or BL) is possible with [Smartphone/nrfToolbox-DFU], i cannot see, why it shouldn't work with nrfUtil.

    >>It should update SD+BL+AD to run the new app with the new SD

    Why? The EB already contains SD 7.2.0 +BL, I only want to DFU-BLE  update the app.

    Best regards,

    Richard

  • Hi, 

    RichardHdrd said:
    Important: After executing B, the *DK* contains S132 v5.1.0, the EB somehow crashes.

    Are you using the same EB in A and B flows? Try to erase the kit before programming the Secure Bootloader & SD S140 (7.2.0) (merged by mergehex) to EB. 

    RichardHdrd said:
    >>It should update SD+BL+AD to run the new app with the new SD

    If the updated app uses the same SD version on the device, you don't need to update the SD. 

    -Amanda

  • Hi Amanda,

    I could try the

    MSDDisable 

    It solved the issue.

    Thank you!

Related