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

"IOError: [Errno 2] No such file or directory" error appears when attempting to conduct DFU

I am trying to conduct a device firmware update using nrfutil's dfu ble functionality. Here is the command:

echo 0 | nrfutil -v dfu ble -ic NRF52 -pkg .\update.zip -a [address]

However, running the above command results in the following output:

Traceback (most recent call last):
  File "C:\Python27\Scripts\nrfutil-script.py", line 11, in <module>
    load_entry_point('nrfutil==5.2.0', 'console_scripts', 'nrfutil')()
  File "c:\python27\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\python27\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\python27\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python27\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python27\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python27\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\python27\lib\site-packages\nordicsemi\__main__.py", line 1145, in ble
    dfu = Dfu(zip_file_path = package, dfu_transport = ble_backend, connect_delay = connect_delay)
  File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 71, in __init__
    self.manifest           = Package.unpack_package(zip_file_path, self.unpacked_zip_path)
  File "c:\python27\lib\site-packages\nordicsemi\dfu\package.py", line 641, in unpack_package
    with open(os.path.join(target_dir, Package.MANIFEST_FILENAME), 'r') as f:
IOError: [Errno 2] No such file or directory: 'c:\\users\\user\\appdata\\local\\temp\\nrf_dfu_wcjdzn\\unpacked_zip\\manifest.json'

I notice that the "nrf_dfu_"portion of the error line changes with every attempt.

I have two questions:

1) Why is this error occurring?

2) How can I go about solving this issue?

Here is some more information on my setup:

Devices: nRF52 DK (Central) and nrf52 BLE device (peripheral)

OS: Windows 10

nrfutil Version: version 5.2.0

Firmware Info: Contains .bin, .dat, and manifest.json files. Firmware was not packaged by me personally. It was packaged and given to me.

Parents
  • Hi Tjhasan, 

    So when you do DFU update, the nrfutil will unzip the .zip file to the temp folder that you can see in the log. And for some reason it couldn't access the files after it unzipped there. 
    Could you check if you see anything inside the temp folder ? 

    Do you have any security configuration that block the access to the user appdata folder ? 
    You may want to try to test using the sample .zip file provided inside \examples\dfu\secure_dfu_test_images\ble 

    Please try update nrfutil, the current version is v6.1.0 and it runs on Python 3.7 

  • I apologize for the late response. I figured out the issue:

    When the file was packaged for me, it was done by sending the file itself to a zip file instead of the 3 files themselves. So the directory looked like this:

    ./FW.zip/FW/.bin, .dat, .json

    When it should have looked like this:

    ./FW.zip/.bin, .dat, .json

    Creating the zip file and importing the files manually fixed the issue!

Reply Children
No Data
Related