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

How can I get connectivity version and SD API using pc-ble-driver

When I send my app to people, it uses a specific version of pc-ble-driver. I would like to make sure dongle used was programmed with the hex file package with this specific pc-ble-driver.

I see "nRF Connect" is able to do so, as it reports wfetr opening the dongle:

14:25:09.017 Validating connectivity firmware for device with serial number DDBBED9DE4DF...
14:25:09.024 Connectivity firmware is valid.
14:25:09.024 Connectivity firmware version: ble-connectivity 0.1.0+Aug-14-2018-15-12-51. SoftDevice API version: 3. Baud rate: 1000000.

Is it possible to know how to retrieve this connectivity version info from the dongle? I found in pc-ble-driver API a sde_ble_version_get function, but this only give very few information (the only relevant one is revision_number, I understand 135 means SD API v2 and 145 SD API v3 but I'm not even sure).

  • Hi,

    There are two things that you can look for. The first one is the Firmware ID (FWID) of the SoftDevice used. For newer SoftDevices it is described in the SoftDevice release notes. For older SoftDevices you can have a look in the thread How do I access softdevice version string. The FWID is stored at a given address in SoftDevice flash, but please do note that the particular address has changed in the past.

    nRF Connect does not read this information through the pc-ble-driver API. Rather, it reads out a specific portion of the connectivity device flash. For pc-ble-driver, we use a patched version of the connectivity example from the nRF5 SDK. This patch adds a data structure (version_info_t) which is used for placing version information for the particular build at a predefined flash location. This structure also has a version field, and the version used for the latest release of pc-ble-driver is version 2.

    The flash location for the version information is 0x20000 for some versions of the connectivity firmware, but may also be found at 0x50000 for some versions. (I do not have full overview of where the information has been put in every version of the connectivity firmware, and so other locations may apply as well.) Note that this is not documented, so you will have to check where the data structure is placed for the version of the connectivity firmware that you use. There is a magic number of 0x46D8A517 for the first word of the structure, which should make it easier to spot e.g. in a hex dump.

    The easiest way to find the struct definition is to search for "version_info_t" in the .patch files in the hex/ folder of a pc-ble-driver release. After the struct definition you will find the flash address used and what values are filled for that particular release. The value used for the "struct_version" field will tell you what version of the structure you are looking at.

    The nRF52840 Dongle does not have an on-board programmer, and so they use a different technique for that one. I can try to figure out what is done there as well, if needed.

    Regards,
    Terje

  • Hi,

    For USB devices we have the DFU Trigger Library (USB) on the connectivity device, which provides an API for reading out information about the firmware.

    Regards,
    Terje

  • Thank you for your reply.

    So my understading is that there is no easy way to do this ;-)

    Could that be an enhancement request for pc-ble-driver?

    Kind regards,

    Jean Porcherot

  • Hi,

    Would better documentation of the existing solution count as such an enhancement?

    If not, what do you have in mind? Suggestions are welcome.

    Regards,
    Terje

  • As pc-ble-driver has the port open, can't it provide a simple function in its API that would read out the specific portion of the connectivity device flash and return it?

    Regards,

    Jean

Related