No serialization firmware - nrfutil by pyinstaller

wtbn gravatar image

asked 2017-02-16 12:23:44 +0100

updated 2017-02-17 14:56:50 +0100

What I am trying to achieve is single-file executable for nrfutil tool, for performing DFU. I downloaded sources and built it using pyinstaller. I can succesfully create DFU package.

Problem comes, when I want to perform dfu with -f parameter (programming ic with serialization firmware). It seems, there is no serialization hex file anywhere.

C:\jobs\btle_git\nRF_tools\mergehex\Bootloader v4 - S132>nrfutil dfu ble -ic NRF52 -pkg Astute_v4_tx.zip -f
No target selected. Default device name: DfuTarg is used.
Please select connectivity serial port:
        0 : COM48 - 682039986
Enter your choice: : 0
Flashing connectivity firmware...
Traceback (most recent call last):
  File "nordicsemi\__main__.py", line 675, in <module>
  File "click\core.py", line 722, in __call__
  File "click\core.py", line 697, in main
  File "click\core.py", line 1066, in invoke
  File "click\core.py", line 1066, in invoke
  File "click\core.py", line 895, in invoke
  File "click\core.py", line 535, in invoke
  File "nordicsemi\__main__.py", line 645, in ble
  File "pc_ble_driver_py\ble_driver.py", line 840, in fw_flash
  File "pc_ble_driver_py\ble_driver.py", line 865, in program
  File "wrapt\wrappers.py", line 561, in __call__
  File "wrapt\decorators.py", line 440, in _synchronized
  File "pc_ble_driver_py\ble_driver.py", line 872, in call_cmd
  File "LIB\subprocess.py", line 573, in check_output
subprocess.CalledProcessError: Command '['nrfjprog', '--snr', '682039986', '--program', 'C:\\Users\\WOJCIE~1\\AppData\\L
ocal\\Temp\\_MEI80~1\\pc_ble_driver_py\\hex\\sd_api_v3\\connectivity_1.0.1_115k2_with_s132_3.0.hex', '--family', u'NRF52
']' returned non-zero exit status 51
Failed to execute script __main__

I checked "C:\Users\WOJCIE~1\AppData\Local\Temp\_MEI80~1" and there is no pc_ble_driver_py folder inside. Should I build it somehow different? Or just flash the serialization earlier. Without -f it works just fine for me.

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
joh2 gravatar image

answered 2017-02-17 15:25:36 +0100


It seems that the hex directory in pc-ble-driver-py, which contains the connectivity firmwares, is not included in the binary generated by PyInstaller.

The fix is to include the hex folder, as shown here. This fix has already been merged into the master branch of pc-nrfutil.

Thanks for reporting this!

Best regards,


edit flag offensive delete publish link more


Thank You very much for quick fix!

Wojtek ( 2017-02-17 15:36:19 +0100 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower


Asked: 2017-02-16 12:23:44 +0100

Seen: 80 times

Last updated: feb. 17