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

Transfert the firmware update from the PC with the library pc-nrf-dfu-js.

Hi,

Here is my setup, NRF52832 PCA10040 s132, sdk 13.0.0.

I work on Windows 10 with a server (The aim is to do it from a Raspberry later) which one is connected to my sensors with BLE.

I am trying to transfert the firmware update from the PC with the library pc-nrf-dfu-js. This library is announced like the following devices are supported:

  • USB SDFU:
    • PCA10056 nRF52840 Development Kit
    • PCA10059 nRF52840 Dongl

BUT this library contains the DfuTransportNoble class which allows the device firmware update with BLE. 

I modified the library a bit (I put the PRN set to 0 and change the value of MTU from 23 to 20) in order to match with the sdk 13.0.0 DFU bootloader

My sensors work with buttonless DFU service. 

My sensor is currently in bootloader mode and I can connect to it (DfuTarg) and start the updating. The library is able to send the init packet, the sensor validates it, then the library try to send the firmware packet but the transfert of data packet stop after some couple of 20 bytes packets... and seems to disconnect in these conditions : 

I can see in the terminal of Visual Stutio Code of the compiled libraries nrf-dfu-cjs.js that the whole function process so it sent all the 4096 bytes of firmware packets and ask for checksum to sensor.

I can see on the terminal of J-link RTT viewer that the sensor after sending answer to CreatingObject, receives only a couple of 20bytes firmware packets and then nothing else, it stopped.

I got on the terminal VSC from the library side these errors : 

2019-05-10T12:32:07.531Z [error] uncaughtException: LIBUSB_ERROR_IO
Error: LIBUSB_ERROR_IO
at startTransfer (E:\workspace\xxx\hub\xxx_hub\node_modules\usb\usb.js:352:6)
at Transfer.transferDone (E:\workspace\xxx\hub\xxx_hub\node_modules\usb\usb.js:340:4)

2019-05-10T12:32:07.534Z [error] uncaughtException: LIBUSB_TRANSFER_STALL
Error: LIBUSB_TRANSFER_STALL
2019-05-10T12:32:07.537Z [error] uncaughtException: LIBUSB_TRANSFER_ERROR
Error: LIBUSB_TRANSFER_ERROR
2019-05-10T12:32:07.540Z [error] uncaughtException: LIBUSB_TRANSFER_ERROR
Error: LIBUSB_TRANSFER_ERROR
2019-05-10T12:32:07.543Z [error] uncaughtException: LIBUSB_TRANSFER_ERROR
Error: LIBUSB_TRANSFER_ERROR
2019-05-10T12:32:07.545Z [error] uncaughtException: LIBUSB_TRANSFER_ERROR
Error: LIBUSB_TRANSFER_ERROR

I don't find the reason of these errors. 

NB : I tried to do the update with debug mode with breakpoint placed when sending 20 bytes packets and the sensor can receive around 1200-1300 bytes then stop...

Do you have any idea of the cause of this problem ? I will post another comment with a new test right after.

Thank you in advance !! 

Alan

Parents Reply Children
  • Hi Terje, thank you for answer. 

    I'm going to try with pc-nrfutil, because it would be a big job to integrate the pc-ble-driver-js in our workspace. 

    I'm working with SDK13, it should be ok. 

    Still I don't understand why it's said that pc-nrf-dfu-js is not made with BLE in mind whereas it contains the class DfuTransportNoble for BLE and I can still transfer init packets and some firmware packets... Where is the limit of use ? Does the implementation of BLE is not functionnal in this library ? 

    About pc-nrfutil, I can't install it on RPI (OS 32bits), is it compatible with 32 bits ?  I got this 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'.

    Thank you,

    Regards.

    Alan

  • Hi Terje, 

    I have also tried to use pc-nrfutil on windows. 

    I want to precise my aim : I want to update the firmware present on PC to a remote sensor over the air in BLE. 

    Nrfutil prompt a message that "No Segger USB CDC ports found, please connect your board.". Why is it asking for Segger USB while I want to use BLE connectivity to transfert the firmware ? 

    Thank you,

    Best regards,

    Alan

  • As I understood, with nrfutil in order to do a DFU over BLE we need a NRF5 development kit board connected to the PC, which one will transfert the package to another NRF52382.... 

  • Hi,

    Yes, that is correct. All of our PC tools uses an nRF device for BLE connectivity. If you need to do DFU using the native BLE drivers on the PC then I am afraid you will have to write the DFU implementation yourself.

    In addition to the PC tools we provide DFU applications for iOS and Android.

    Regards,
    Terje

Related