Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can I easily bootload an nRF52832 using a BeagleBone Green Wireless and its built in bluetooth?

We have a handful of products that utilize nRF52832 IC's for BLE communication.  The bootloader in these devices is based on the one in the SDK, I believe version 11.0.  In any case, the bootloader works with nRF Connect on my Android phone.

We are preparing to ship a BeagleBone Green Wireless (BBGW) based device alongside the BLE devices.  I'm investigating how I can bootload the Nordic parts via BLE.  I am aware of nrfutil and have been able to get it running on the BBGW, but it appears to require a BLE dongle to work.  We're not going to be able to add a dongle to every BBGW we ship, so that isn't an option.

Is there a solution to bootload an nRF52832 using the BBGW's on board Bluetooth IC?

  • Little more information...

    If I try to run `nrfutil dfu ble -pkg software.zip -ic NRF52` I get error messages:

    File "/usr/local/bin/nrfutil", line 11, in <module>
    load_entry_point('nrfutil==3.4.0', 'console_scripts', 'nrfutil')()
    File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
    File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/nrfutil-3.4.0-py2.7.egg/nordicsemi/__main__.py", line 776, in ble
    ble_driver_init(conn_ic_id)
    File "/usr/local/lib/python2.7/dist-packages/nrfutil-3.4.0-py2.7.egg/nordicsemi/__main__.py", line 65, in ble_driver_init
    from pc_ble_driver_py.ble_driver import BLEDriver, Flasher
    File "/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/ble_driver.py", line 105, in <module>
    raise RuntimeError("Could not load shared library {} : '{}'.".format(shlib_path, error))
    RuntimeError: Could not load shared library /usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/lib/linux/x86_32/libpc_ble_driver_shared_sd_api_v3.so : '/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/lib/linux/x86_32/libpc_ble_driver_shared_sd_api_v3.so: cannot open shared object file: No such file or directory'.

    libpc_ble_driver_shared_sd_api_v3.so exists in the specified directory.

    I've gone so far as to build boost and pc-ble-driver on my beaglebone, which takes a long time, but I'm now stuck at this point.

  • I think I may need to build pc-ble-driver-py to get further with this task, but I'm not able to build it.

    I started out using apt-get to install cmake and (if I remember correctly) boost.  I ran into problems using these that made me think that boost was too old of a version.  I then compiled boost 1.66 from source as well as cmake 3.11 rc1.  I deleted the pc-ble-driver-py directory, recloned the repository, and tried to compile again using the latest cmake and boost version.  The build fails with the following error:

    [ 14%] Building CXX object pc-ble-driver/CMakeFiles/pc_ble_driver_obj_sd_api_v3.dir/src/common/sd_rpc_impl.cpp.o
    In file included from /root/pc-ble-driver-py/pc-ble-driver/src/common/sd_rpc_impl.cpp:43:0:
    /root/pc-ble-driver-py/pc-ble-driver/include/common/internal/transport/uart_boost.h:100:18: error: ‘io_service’ in namespace ‘boost::asio’ does not name a type
    boost::asio::io_service ioService;
    ^
    /root/pc-ble-driver-py/pc-ble-driver/include/common/internal/transport/uart_boost.h:102:18: error: ‘io_service’ in namespace ‘boost::asio’ does not name a type
    boost::asio::io_service::work workNotifier;
    ^
    pc-ble-driver/CMakeFiles/pc_ble_driver_obj_sd_api_v3.dir/build.make:387: recipe for target 'pc-ble-driver/CMakeFiles/pc_ble_driver_obj_sd_api_v3.dir/src/common/sd_rpc_impl.cpp.o' failed
    make[2]: *** [pc-ble-driver/CMakeFiles/pc_ble_driver_obj_sd_api_v3.dir/src/common/sd_rpc_impl.cpp.o] Error 1
    CMakeFiles/Makefile2:311: recipe for target 'pc-ble-driver/CMakeFiles/pc_ble_driver_obj_sd_api_v3.dir/all' failed
    make[1]: *** [pc-ble-driver/CMakeFiles/pc_ble_driver_obj_sd_api_v3.dir/all] Error 2
    Makefile:83: recipe for target 'all' failed
    make: *** [all] Error 2

  • This was resolved by editing pc-ble-driver-py/pc-ble-driver/include/common/internal/transport/uart_boost.h to change "io_service" to "io_context" in two locations.  Once compiled, I copied the output files over to the python directory, but the application still appears to be searching for a usb connected device to perform the bootloading.

  • Hello,

    Unfortunately, we do not have any offical examples that demonstrates OTA DFU with other Bluetooth stacks such as Bluez, but I found this github project that you might want to check out (not tried it myself): https://github.com/foldedtoad/ota-dfu-python.

    Note that Nrfutil and nrf connect desktop use serialized softdevice API to control the softdevice on the connectivity board (serialization). This is why you need a nordic dongle when doing OTA DFU with nrfutil.     

Related