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

nrfutil "image not found error"

Hi there,
I'm using nrfutil (nrfutil version 6.0.1) to dfu via ble (dongle),

Mac (10.15.2), windows (10), linux (raspbian) have been tried out to update the firmware
none has successfully updated the firmware

the command line used to update firmware is </nrfutil dfu ble -pkg <FilePath> -ic NRF52 -n "<DeviceName>" -f>

for windows extra </-p COM1> was added which was the dongle com port,

for raspbian, it was a deadend since the beginning of installation as the latest version available for module (pc-ble-driver-py) was 0.11.4, while requirements was 0.14.1, so I assumed to have it working first on the other 2 platforms,


so, I got for Mac the following error:

Traceback (most recent call last):
  File "/usr/local/bin/nrfutil", line 8, in <module>
    sys.exit(cli())
  File "/Users/ramyezzat/Library/Python/3.7/lib/python/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/ramyezzat/Library/Python/3.7/lib/python/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/ramyezzat/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/ramyezzat/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/ramyezzat/Library/Python/3.7/lib/python/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/ramyezzat/Library/Python/3.7/lib/python/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/__main__.py", line 1099, in ble
    ble_driver_init(conn_ic_id)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/__main__.py", line 68, in ble_driver_init
    from pc_ble_driver_py.ble_driver    import BLEDriver, Flasher
  File "/usr/local/lib/python3.7/site-packages/pc_ble_driver_py/ble_driver.py", line 77, in <module>
    import pc_ble_driver_py.lib.nrf_ble_driver_sd_api_v5 as driver
  File "/usr/local/lib/python3.7/site-packages/pc_ble_driver_py/lib/nrf_ble_driver_sd_api_v5.py", line 13, in <module>
    from . import _nrf_ble_driver_sd_api_v5
ImportError: dlopen(/usr/local/lib/python3.7/site-packages/pc_ble_driver_py/lib/_nrf_ble_driver_sd_api_v5.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.7/Python
  Referenced from: /usr/local/lib/python3.7/site-packages/pc_ble_driver_py/lib/_nrf_ble_driver_sd_api_v5.so
  Reason: image not found

and for windows I got the following error:

Traceback (most recent call last):
  File "c:\users\developer\python3\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 2731, in __init__
    snr = [d.serial_number for d in serial_ports if d.port == serial_port][0]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\developer\PYTHON3\Scripts\nrfutil-script.py", line 11, in <module>
    load_entry_point('nrfutil==6.0.1', 'console_scripts', 'nrfutil')()
  File "c:\users\developer\python3\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\developer\python3\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\users\developer\python3\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\developer\python3\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\developer\python3\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\developer\python3\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\users\developer\python3\lib\site-packages\nrfutil-6.0.1-py3.8.egg\nordicsemi\__main__.py", line 1120, in ble
    flasher = Flasher(serial_port=port, snr = jlink_snr)
  File "c:\users\developer\python3\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 2733, in __init__
    raise NordicSemiException("Board not found: {}".format(serial_port or snr))
pc_ble_driver_py.exceptions.NordicSemiException: Board not found: COM1


eventually I'd like to wrap the code into another python module,

any idea what could possibly be wrong or missing?

Parents
  • Hi,

    There seem to be several different issues here. It might be better to split them up, but I will mention a few relevant points.

    Regarding Mac:

    • Did you install with pip? If not, can you try that?
    • Also, nrfutil 6 has a lot of changes and is base on Python 3, whereas older versions use python 2. It could be worth it downgrading to nrfutil 5 to see if that works better (I expect so). 

    Regarding Windows ("Board not found: COM1"):

    • Please note that the dongle will only show up as a Serial device with a COM port when in bootloader mode or if the application implements USB CDC. You should click the sideways reset-button in order to put the dongle in DFU mode (the LED will pulse read to indicate DFU mode).
    • Note that the COM port number may be different in DFU mode compared to in the application, so you should double-check that you are using the correct COM port number (windows will increment the number for each "new" device).
  • thanks for replying,

    for clarity, according to Mac, I have installed from source, and I'm using python3 as you can see from exceptions, libraries paths are python3.7, basically I have followed the latest (current) nrf info centre installation guide, after you mentioned that installation with pip might help I have uninstalled the module and installed with pip, and yet the same exception has been thrown (Reason: image not found), for that I will try couple to make sure that the right python is being called, maybe also create and run virtual environment.

    for windows I have nrfutil also installed from source, also I'm not using nrf dongle, but ble ASUS USB-BT400 dongle, the same dongle has been used before to communicate with Nordic_UART example using the following repo.
    https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/scripts/shell/ble_console/BlueZ_communication.py

    now, after reviewing Performing a DFU from nrfutil (at nrf info centre), the very first paragraph states that a DK has to be used over ble as connectivity device, so, is it essential to use NRF dongle (or a DK) for nrfutil?

    also, is it necessary to state which device to use in Mac? (-p /dev/<device_name>) or does it scan for the ble connected devices?

    about linux(the OS that this project meant to be using, also I've tried building the library on ubuntu 18.04 the pc_ble_driver_py version didn't meet the latest required version) I found out that the latest version of pc_ble_driver_py module built for linux is 1.11.2 I will try to build this version .whl

Reply
  • thanks for replying,

    for clarity, according to Mac, I have installed from source, and I'm using python3 as you can see from exceptions, libraries paths are python3.7, basically I have followed the latest (current) nrf info centre installation guide, after you mentioned that installation with pip might help I have uninstalled the module and installed with pip, and yet the same exception has been thrown (Reason: image not found), for that I will try couple to make sure that the right python is being called, maybe also create and run virtual environment.

    for windows I have nrfutil also installed from source, also I'm not using nrf dongle, but ble ASUS USB-BT400 dongle, the same dongle has been used before to communicate with Nordic_UART example using the following repo.
    https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/scripts/shell/ble_console/BlueZ_communication.py

    now, after reviewing Performing a DFU from nrfutil (at nrf info centre), the very first paragraph states that a DK has to be used over ble as connectivity device, so, is it essential to use NRF dongle (or a DK) for nrfutil?

    also, is it necessary to state which device to use in Mac? (-p /dev/<device_name>) or does it scan for the ble connected devices?

    about linux(the OS that this project meant to be using, also I've tried building the library on ubuntu 18.04 the pc_ble_driver_py version didn't meet the latest required version) I found out that the latest version of pc_ble_driver_py module built for linux is 1.11.2 I will try to build this version .whl

Children
No Data
Related