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

Run nrfutil dfu on a Raspberry Pi

Dear Community,

I am working on the following application: using the RaspberryPi to flash over-the-air nRF52 nodes (Nordic's Secure DFU BLE bootloader)

For that I have connected a PCA10056 to a RPi3, and now I am trying to use nrfutil to flash the nodes over BLE.

Unfortunately, it seems to be that the pc-ble-driver is not precompiled and working for the RPi ARM architecture. So my following step would be to build that from source code.

I had a first try but I was not successful. I am not sure if all the dependencies/tools are ready for the RPi. In the following post I have read that someone already did that:

https://devzone.nordicsemi.com/f/nordic-q-a/25402/how-to-arm-cross-compile-pc-ble-driver

Could you please explain how can we make it working on the RPi or even better to provide a guide showing how we can work with all your tools for nRF52 from a RPi computer?

I think it could be really interesting for the makers community.

Thank you in advance,

Javier

  • Hi,

    Compiling for Raspberry Pi have been done for an old version, see this blog post. I have not tested this myself, and I'm not aware if this have been done on later versions, however I do not see why it should not work.

    Can you describe your process for compiling and what issues you are facing? Are you trying to build pc-ble-driver, or pc-ble-driver-py?

    Best regards,
    Jørgen

  • Hi Jørgen,

    Thank for your support.

    I am trying to build pc-ble-driver-py (v0.11.4) in the RPi, but I am facing the following issue:

    [ 74%] Built target pc_ble_driver_shared_sd_api_v2
    
    [ 75%] Linking C shared module outdir/_pc_ble_driver_sd_api_v2.so
    
    Error copying directory from "/home/pi/pc-ble-driver-py/pc-ble-driver/cmake/../hex/SD_API_V2" to "/home/pi/pc-ble-driver-py/python/pc_ble_driver_py/hex/SD_API_V2".
    
    CMakeFiles/_pc_ble_driver_sd_api_v2.dir/build.make:85: recipe for target 'outdir/_pc_ble_driver_sd_api_v2.so' failed
    
    make[2]: *** [outdir/_pc_ble_driver_sd_api_v2.so] Error 1
    
    make[2]: *** Deleting file 'outdir/_pc_ble_driver_sd_api_v2.so'
    
    CMakeFiles/Makefile2:73: recipe for target 'CMakeFiles/_pc_ble_driver_sd_api_v2.dir/all' failed
    
    make[1]: *** [CMakeFiles/_pc_ble_driver_sd_api_v2.dir/all] Error 2
    
    Makefile:83: recipe for target 'all' failed
    
    make: *** [all] Error 2

    As far as I can see, those folder are existing but in lower case.

    Do you have in mind to provide working versions of these useful nRF tools for the RPi?

    Best regards,

    Javier

  • The next problem that rises:

    Traceback (most recent call last):
      File "/usr/local/bin/nrfutil", line 11, in <module>
        load_entry_point('nrfutil==5.1.0', 'console_scripts', 'nrfutil')()
      File "/usr/local/lib/python2.7/dist-packages/Click-7.0-py2.7.egg/click/core.py", line 764, in __call__
        return self.main(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/Click-7.0-py2.7.egg/click/core.py", line 717, in main
        rv = self.invoke(ctx)
      File "/usr/local/lib/python2.7/dist-packages/Click-7.0-py2.7.egg/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/local/lib/python2.7/dist-packages/Click-7.0-py2.7.egg/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/local/lib/python2.7/dist-packages/Click-7.0-py2.7.egg/click/core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/local/lib/python2.7/dist-packages/Click-7.0-py2.7.egg/click/core.py", line 555, in invoke
        return callback(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/nrfutil-5.1.0-py2.7.egg/nordicsemi/__main__.py", line 1129, in ble
        flasher = Flasher(serial_port=port, snr = jlink_snr)
      File "/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py-0.11.4-py2.7.egg/pc_ble_driver_py/ble_driver.py", line 1063, in __init__
        raise NordicSemiException('nrfjprog not installed')
    pc_ble_driver_py.exceptions.NordicSemiException: nrfjprog not installed

    and the question: how could I use nrfutil in the RPi if there is no support of nrfjprog for that platform?

    Thank you again for your support.

    Javier

  • I'm not sure exactly what cause the cmake error, looks like it cannot find the path or something. Did you clone the pc-ble-driver repository into the pc-ble-driver-py directory, and checkout the required commit/version?

    You are correct that nrfutil is not supported on ARM platforms, however the nrfjprog dependency can be removed from the pc-ble-driver-py code if you make sure that the correct connectivity firmware is flashed to the chip before running the applications. It should only be used to check and flash the correct connectivity firmware.

  • Yes, I checked out pc-ble-driver-py @ v0.11.4 and found those issues building from source.

    Are there any plans in your team or in your roadmap to support these nordic tools on ARM platforms?

    In my opinion, it would be a really nice-to-have feature for the community of developers working with your great nRF5 chips.

Related