nrfutil dfu ble not working - Failed to ble_enable. Error code: NRF_ERROR_SD_RPC_SEND

Hi,

Could you please help me solve the following issue?

Context:

I need to write a script to upgrade via BLE a fleet of nRF51822 devices running SDK12.3 bootloader. I decided to use nrfutil and an nRF52 dongle (PCA10059) for this purpose.

Issue:

Running nrfutil dfu ble fails due to a pc_ble_driver_py error : "Failed to ble_enable. Error code: NRF_ERROR_SD_RPC_SEND"

C:\Users\Geoffrey>nrfutil -V
nrfutil 7.4.1 (99b5854 2023-02-08)
commit-hash: 99b5854354f13b3c1b25d2a4609c9422f46013c8
commit-date: 2023-02-08
host: x86_64-pc-windows-msvc
build-timestamp: 2023-02-08T15:27:52.848202100+00:00
classification: nrf-external
C:\Users\Geoffrey>nrfutil dfu ble -pkg "custom_app.zip" -ic NRF51 -n CUSTOM_NAME
Please select connectivity serial port:
0 : COM5 - EF70BCAF4128
Enter your choice: : 0
[------------------------------------] 0%
Traceback (most recent call last):
File "nordicsemi\__main__.py", line 1555, in <module>
File "click\core.py", line 1137, in __call__
File "click\core.py", line 1062, in main
File "click\core.py", line 1668, in invoke
File "click\core.py", line 1668, in invoke
File "click\core.py", line 1404, in invoke
File "click\core.py", line 763, in invoke
File "nordicsemi\__main__.py", line 1215, in ble
File "nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
File "nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
File "nordicsemi\dfu\dfu_transport_ble.py", line 474, in open
File "nordicsemi\dfu\dfu_transport_ble.py", line 108, in open
File "pc_ble_driver_py\ble_driver.py", line 106, in wrapper
pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_enable. Error code: NRF_ERROR_SD_RPC_SEND
[7920] Failed to execute script '__main__' due to unhandled exception!

I have installed connectivity firmware using the following command, and this firmware works fine with the Bluetooth Low Energy v4.0.4 app from the nRF Connect for Desktop suite. Note that DFU using this app works.

C:\Users\Geoffrey>nrfutil dfu ble -pkg "custom_app.zip" -ic NRF51 -f
No target selected. Default device name: DfuTarg is used.
Please select connectivity serial port:
0 : COM5 - EF70BCAF4128
Enter your choice: : 0
Flashing connectivity firmware...
Connectivity firmware flashed.
[------------------------------------] 0%
Traceback (most recent call last):
File "nordicsemi\__main__.py", line 1555, in <module>
File "click\core.py", line 1137, in __call__
File "click\core.py", line 1062, in main
File "click\core.py", line 1668, in invoke
File "click\core.py", line 1668, in invoke
File "click\core.py", line 1404, in invoke
File "click\core.py", line 763, in invoke
File "nordicsemi\__main__.py", line 1215, in ble
File "nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
File "nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
File "nordicsemi\dfu\dfu_transport_ble.py", line 474, in open
File "nordicsemi\dfu\dfu_transport_ble.py", line 108, in open
File "pc_ble_driver_py\ble_driver.py", line 106, in wrapper
pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_enable. Error code: NRF_ERROR_SD_RPC_SEND
[14544] Failed to execute script '__main__' due to unhandled exception!
  • Hello,

    Please try to use "-ic NRF52", since you are using an nRF52840 dongle as the connectivity board. When you are using "-ic NRF51" it believes that it is an nRF51 that is connected to your computer, and hence it will be flashed with the nRF51 FW, which will not run as you would expect on the nRF52. 

    It doesn't matter that the devices you are updating are nRF51 devices. The -ic is the connectivity device connected to your computer, which in your case is the nRF52840. 

    This is also why it is working in the nRF Connect for Desktop -> Bluetooth Low Energy, because this will program the dongle with the correct FW. 

    Please note that the COM port number may change after you flash the device, so you may need to make your call two times, using:

    nrfutil dfu ble -pkg "custom_app.zip" -p COMXX -ic NRF51 -f

    Where COMXX needs to be replaced with the COM port that the dongle is attached to. Remove the "-f" after having called this once, and look for the updated COM port on your computer (you can check in nRF Connect for Desktop -> Programmer, for example.

    Let me know if that doesn't work.

    Best regards,

    Edvin

  • Changing -ic NRF51 to -ic NRF52 worked. Thank you.

Related