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

nrfutil fails dfu - "UUID not found"

Hi,

As a part of settings up an automatic BLE DFU testing environment, we're trying to update a single NRF52 board using a PC connected to a NRF51 dongle.

The dongle is programmed using the hex file: connectivity_2.0.1_115k2_with_s130_2.0.1 

TheNRF52 board is discoverable and connectable with nRF Connect on Android and on the PC. DFU works on Android with nrf Connect.

When we try to initiate DFU using nrfutil (3.5.0) with the command line: nrfutil.exe dfu ble -ic NRF51 -pkg "<some-long-package-path>" -p COM9 -n "<our device's name>" 

we get the message:

2018-04-09 19:33:53,576 Exception: UUID not found
2018-04-09 19:33:53,582 ('c:\\python27\\lib\\site-packages\\pc_ble_driver_py\\ble_driver.py', 1483, 'sync_ble_evt_handler', 'data = util.uint8_array_to_list(hvx_evt.data, hvx_evt.len))')
2018-04-09 19:33:53,584 ('c:\\python27\\lib\\site-packages\\wrapt\\wrappers.py', 562, '__call__', 'args, kwargs)')
2018-04-09 19:33:53,584 ('c:\\python27\\lib\\site-packages\\wrapt\\decorators.py', 440, '_synchronized', 'return wrapped(*args, **kwargs)')
2018-04-09 19:33:53,585 ('c:\\python27\\lib\\site-packages\\pc_ble_driver_py\\ble_adapter.py', 486, 'on_gattc_evt_hvx', "raise NordicSemiException('UUID not found')")

Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\nrfutil.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "c:\python27\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "c:\python27\lib\site-packages\click\core.py", line 1066, 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 _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\python27\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\python27\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "c:\python27\lib\site-packages\nordicsemi\__main__.py", line 834, in ble
dfu.dfu_send_images()
File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 129, in dfu_send_images
self._dfu_send_image(self.manifest.application)
File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 90, in _dfu_send_image
self.dfu_transport.open()
File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 453, in open
target_device_addr = self.target_device_addr)
File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 153, in connect
self.jump_from_buttonless_mode_to_bootloader(DFUAdapter.BLE_DFU_BUTTONLESS_BONDED_CHAR_UUID)
File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 196, in jump_from_buttonless_mode_to_bootloader
response = self.indication_q.get(timeout=DfuTransportBle.DEFAULT_TIMEOUT)
File "c:\python27\lib\Queue.py", line 176, in get
raise Empty
Queue.Empty

And of course the DFU fails. The strange thing is that it sometimes (rarely) works, so perhaps we're missing some parameters?

Would appreciate help,

Thanks

Parents
  • You mention that the nrf52 device is "discoverable and connectable" on nrf connect for pc. Does that mean you have been able to do a DFU from nrf connect for pc? I followed this blog post & managed to do a dfu of the ble_blinky app (using the s132 softdevice). I used sdk 15 with the newest s132 softdevice. I did the dfu process using a nrf51 dongle as the connectivity bridge between the pc and the 52 DK. All I did was flash the newest firmware to the dongle when nrf connect asked to update the firmware (see link).

    I also tried running the dfu via the nrfutil command you provided & I also received some weird errors. I used the command: nrfutil dfu ble -ic NRF51 -pkg "dfu_firmware.zip", which I believe is essentially the same as you are doing. You could try running my command to see if that makes a difference, but I doubt it will. Here is the error log I receive:

      [------------------------------------]    0%
    Traceback (most recent call last):
      File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
        "__main__", fname, loader, pkg_name)
      File "c:\python27\lib\runpy.py", line 72, in _run_code
        exec code in run_globals
      File "C:\Python27\Scripts\nrfutil.exe\__main__.py", line 9, in <module>
      File "c:\python27\lib\site-packages\click\core.py", line 722, in __call__
        return self.main(*args, **kwargs)
      File "c:\python27\lib\site-packages\click\core.py", line 697, in main
        rv = self.invoke(ctx)
      File "c:\python27\lib\site-packages\click\core.py", line 1066, 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 _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python27\lib\site-packages\click\core.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python27\lib\site-packages\click\core.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "c:\python27\lib\site-packages\nordicsemi\__main__.py", line 812, in ble
        dfu.dfu_send_images()
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 122, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 83, in _dfu_send_image
        self.dfu_transport.open()
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 450, in open
        self.dfu_adapter.open()
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 106, in open
        self.adapter.driver.open()
      File "c:\python27\lib\site-packages\wrapt\wrappers.py", line 562, in __call__
        args, kwargs)
      File "c:\python27\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 126, in wrapper
        raise NordicSemiException('Failed to {}. Error code: {}'.format(wrapped.__name__, err_code))
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: 13

    Do you need to run the dfu via nrfutil or are you fine using nrf connect instead?

  • We're using SDK 14.0 and SD v5.0.

    Using the PC's nrf Connect Low Energy Bluetooth 2.3.0 application, we managed to initiate successful DFU a couple of times, but now it produces the error:

    When writing 'ENTER_BOOTLOADER' command to Buttonless Characteristic of DFU Target: Operation code 1 (ENTER_BOOTLOADER) failed on DFU Target. Result code 4 (OPERATION_FAILED)

    Can you try a few consequent updates to see if you get the same issue?

    With nrfutil we sometimes get the Error code: 13 , then we reset the NRF51 dongle and either get the UUID error, or a rare successful update.

    We want an automated process after every successful code build, so if we can get the nrf Connect to always work reliably, we'd still need some command line API. Is there a command line tool?

  • Since you want an automated process, you'll most likely have to use a command line tool like nrfutil to do the DFU. nRF Connect for PC does not have a command line API as far as I am aware of.

    I figured out the issue with some external help! The documentation at this link is slightly wrong. Turns out the connectivity firmware we both have been running was the wrong version. Instead of flashing the connectivity firmware to the nrf51 dongle before you start the DFU process, just follow this process:

    set up your nrf52 dk for the DFU, should be in bootloader mode (i.e. LEDs 1 & 3 should be on I believe, follow this link)

    erase the nrf51 dongle using nrfjprog --eraseall

    run this command to start the dfu & flash the connectivity FW: nrfutil dfu ble -ic NRF51 -pkg app_dfu.zip -f

    where app_dfu.zip is the name you gave the zip file to update. The -f command will flash the correct connectivity FW to the dongle.

  • This question has been assigned to another group. An application engineer from that group will take a look at your question as soon as possible.

  • Thanks for clarifying about the documentation. 

    I didn't specify earlier, but we're not using the nRF52 DK, we're using nRF52832, so it's a buttonless DFU.

    Your suggestion did help, but partially. Indeed erasing the nRF51 and using the nrfutil command (with the -n and -p parameters in addition to the -f flag) updates the firmware correctly and consistently.

    The is still a problem with successive updates. After a successful DFU, if we restart the nrf52 unit (without erasing its contents) and try another DFU with nrfutil it fails with the UUID error. It doesn't happen when using the mobile nRF connect. 

    Is this some sort of a cache issue the nrfutil can't handle?

    Thanks for the help!

Reply
  • Thanks for clarifying about the documentation. 

    I didn't specify earlier, but we're not using the nRF52 DK, we're using nRF52832, so it's a buttonless DFU.

    Your suggestion did help, but partially. Indeed erasing the nRF51 and using the nrfutil command (with the -n and -p parameters in addition to the -f flag) updates the firmware correctly and consistently.

    The is still a problem with successive updates. After a successful DFU, if we restart the nrf52 unit (without erasing its contents) and try another DFU with nrfutil it fails with the UUID error. It doesn't happen when using the mobile nRF connect. 

    Is this some sort of a cache issue the nrfutil can't handle?

    Thanks for the help!

Children
  • Do you get the same exact log error as in your first comment (i.e. ('c:\\python27\\lib\\site-packages\\pc_ble_driver_py\\ble_adapter.py', 486, 'on_gattc_evt_hvx', "raise NordicSemiException('UUID not found')"))? If it is different, could you add a comment with the updated log when it fails the second time round.

    I have tested with the regular bootloader_secure_ble using the v5 softdevice & updating the ble_peripheral/blinky application. The nrfutil dfu works multiple times with that. I have to reset the nrf52 dk while holding in button 4 to enter bootloader mode, so that could maybe influence the process slightly. Have you tested with the regular buttonless dfu application in the ble_peripheral folder to see if you can do the dfu multiple times? That should work.

  • Yes, it's the same error. 

    Right now we bypass the issue by reprogramming the device to the same version we just updated to, before another update.

    Since reprogramming works and resetting doesn't, we might have an issue on our side. We'll look into it.

    In the meanwhile, we'll close this ticket.

    Thanks for the help

  • Hi,

    In a private conversation we found nrfutil to raise an exception on service changed indication if it had not yet done database discovery.

    Thanks to your reporting the nrfutil team is now aware of the issue, and they hope to have a fix for this for the next nrfutil release.

    For now, three possible workarounds are 1) to send service changed indications from the DFU target after a delay or not at all, or 2) to use a different tool than nrfutil, or 3) to try to patch the offending line in ble_adapter.py (e.g. not raise the exception).

    Finally I would like to thank you for reporting this issue and providing logs and further information in the private thread. It is highly appreciated, and allowed us to understand the problem and pinpoint the issue.

    Regards,
    Terje

Related