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

Nordic provide a BLE USB dongle for applications running on a PC?

Does Nordic provide a BLE functionality with a USB dongle that a PC application can use? I do NOT want to use the Windows 10 BLE as it is buggy and does not provide the low level control I need. I am writing an extensive health device BLE test suite for centrals and I do not want to download HEX files onto a chip for each test. What is needed is to call the BLE APIs from the PC application and get signaled of BLE events in the PC application. I am thinking Visual Studio 19 using C or C++. I am forced to select things in the product and I will pick something at random. I have no idea which one will do. Pretty stupid requirement on Nordic's part.

Parents
  • Hi,

    pc-ble-driver should meet your requirements. This is a C/C++ library for serializing our BLE softdevices. You can use it together with our nRF52840 Dongle (PCA10059).

    Best regards,
    Jørgen

  • There are a few tools and dependencies required in order to build the driver, but as long as you follow the instructions closely, you should be fine.

    The tools are required in order to support the many platforms and targets (OSes, ICs, softdevice versions, physical transports, etc.). You will need to run an application on the nRF chip in any scenario that you want to use it for BLE, the chip is blank when produced, and does not provide any mechanism for controlling BLE. The connectivity HEX file that is required by pc-ble-driver is not changed after the first build, you only need to rebuild it if you want to change softdevice version or run it on another board. In fact, you do not need to compile the connectivity hex yourself at all if you want to run it on any of our boards, you can use the precompiled version found in the downloadable releases.

    Exactly which tools are you concerned about?

  • I was looking at the numerous programs that need to be installed, choclately, cmake nrf***, among others. I think I can avoid choclately which I have no desire to have. I guess Visual Studio is not enough but I need gcc compilter as well. Not sure about that. I have been going through the sequence and trying to figure out what to do in a way that's easy to clean up.

  • If I install the precompiled HEX files, then I can use Visual Studio only to write applications, correct? I wont need to buy the IAR compiler or another special compiler to write ARM HEX files...or will there still be some HEX files I will need to build in addition to the precompiled HEX files?

  • Yes, there is no additional HEX files you need to build apart from the connectivity HEX file that you find in the release. However, you would still need to setup the other build tools, to compile the driver itself and generate the projects.

    If you are looking for a cleaner solution, you can also consider porting our serialization libraries to your desktop. This is the same solution as pc-ble-driver is using, but will require more effort on your end to make it work on your platform.

  • Okay, I thought the connectivity HEX file WAS the driver. The word 'driver' is confusing to me as it is used in so many contexts. Is the driver something that sits on the PC that has to be installed into the OS (like a USB driver one often gets with a USB product) or is it a library that my VS project will use. You mention 'generate the projects'. I assumed I would generate my projects in VS.

    I guess I do not understand the setup/config system yet (those are always the most difficult stages in any endeavor). Before I dig deeper I am waiting on another question. I was looking at the APIs and noted there was no GATT event signaled to a peripheral on a generic client read. There was an event on an 'authorized' read/write but it is not clear to me what that is. However, if the Nordic chips do NOT signal the peripheral application on a client read and allow the application to control what is then sent back to the client then we cannot use it. It's funny that the high level Android API allows this ... which is wonderful but it has far too little control over everything else BLE to be useful for our purposes.

  • The connectivity HEX file is the firmware that runs on the nRF chip and provides serialized control of the BLE softdevice. The pc-ble-driver implements the serialization libraries that run on the host side (PC), allowing you to call softdevice APIs from your C/C++ application. These function calls will be serialized and transported over the serial link by the pc-ble-driver.

    When I said "generate projects" I was referring to the projects for building the driver libraries and generation of the example projects. I assume you can also build the libraries only, and link these in your VS project yourself.

    [EDIT]: The zipped release on GitHub also includes the linkable library, meaning you should be able to link this into your VS project, given that you develop on one of the platforms that we provide releases for (win x86_32/64, linux x86_64, macos x86_64).

Reply
  • The connectivity HEX file is the firmware that runs on the nRF chip and provides serialized control of the BLE softdevice. The pc-ble-driver implements the serialization libraries that run on the host side (PC), allowing you to call softdevice APIs from your C/C++ application. These function calls will be serialized and transported over the serial link by the pc-ble-driver.

    When I said "generate projects" I was referring to the projects for building the driver libraries and generation of the example projects. I assume you can also build the libraries only, and link these in your VS project yourself.

    [EDIT]: The zipped release on GitHub also includes the linkable library, meaning you should be able to link this into your VS project, given that you develop on one of the platforms that we provide releases for (win x86_32/64, linux x86_64, macos x86_64).

Children
  • This is starting to sound much easier. Since I am running on a 64 bit Windows machine, the driver libraries are already available and I do not have to build them. The connectivity HEX file is also available, so I don't have to build that either. All I need (that I do not have) is a tool to install the connectivity HEX file through the JSEGGER interface. Once that is done, I could, in theory, start a new VC studio project and create a BLE peripheral or central using the SoftDevice APIs. Love the sound of that.

  • Note that if you want to use the nRF52840 Dongle that I linked above, this does not contain a Segger debugger to program the device. Instead, the device comes loaded with our serial bootloader, allowing you to program the connectivity hex through the USB port of the dongle. Please see this tutorial for more details.

  • I have the dongles and have got the segger installed and the dongle recognized. nRF connect tool is installed. Looked at  this tutorial but do not see how to install the pre-compiled HEX files I downloaded. All I get is the option to install a cental/client app on the dongle.

    Is it SoftDevice I am trying to install? One of these files 

    connectivity_4.1.1_usb_with_s140_6.1.1.hex

    perhaps? (There are 4 hex files each in four directories. They are the only HEX files I could find. How do I get the nRF Connect tool to install these HEX files onto the dongle (assuming they are what I want). Of the selection is large; there are 12 to choose from.

  • "connectivity_4.1.1_usb_with_s140_6.1.1.hex" should be the correct hex file. You can also choose one for an older softdevice API (v3, v5), but these will not provide all the available features that the latest softdevice does.

    I'm not sure what you mean by "cental/client app". You installed nRF Connect for Desktop, installed and launched the "Programmer app" inside nRF Connect, pressed the side-button on the Dongle (the LED should be pulsating in red color), selected the dongle from the drop-down list in the upper left corner? When you have done this, you should be able to browse to the hex-file location by pressing "Add HEX file", and then click "Write" to write the application to the dongle.

  • My dongle has no side button but it does have a white button next to the MCU on the opposite side of the MCU of the flashing red LED. I assume that's the button you mean.

    No I did not do those steps. I did not find those in a way I understood them to apply to my use case (I was scared of doing damage.). BUt I just did it and it worked. The LED flashed in funny ways as the write was being done and a green LED flashed in a different location (I am assuming it means success) and now the dongle is back to flashing red. I am saving this set of steps. If this actually allows me to code and run C-based BLE apps on my PC, this was incredibly easy!

    By the way, nfrConnect got installed in my AppData/Local/ Programs directory. I'm not sure how. Can I just move that entire nrfconnect directory somewhere else or must I uninstall and reinstall and keep close track of where I can make the move to install it in a location of my choice.

    I just found out that the reset button is the little tiny thing next to SW1 (the white button). I pushed the white button and not the reset button, Yet it seemed to work. Don't know if it is all messed up or what. Perhaps I should re-do?

    These are the steps I finally took (except I did not press the reset button - I pressed SW1)

    Configure the nRF52840 dongle to access its BLE functionality from a PC application

    • Download the driver from here: github.com/.../v4.1.1 Its just a zip file. Just unzip it. No installation needed.
    • Download the nRF Connect for Desktop application here: www.nordicsemi.com/.../nRF-Connect-for-desktop This will download a setup executable nrfconnectsetup320ia32.exe. Even though it says '32' its for both 32 and 64 bit machines.
    •  Run the nrfconnectsetup320ia32 setup program.
    •  Download Segger Jlink software here: www.segger.com/.../. It will look like this: JLink_Windows_V652a.exe. Run the installer.
    • Plug in the dongle - a red LED should flash.
    • Open nRF Connect for Desktop. You will see 'APPS' and 'SETTINGS' in the title bar. Be sure 'APPS' is selected
    • Scroll down to 'Programmer'. In my case it was second in the list of choices so I didn't have to scroll.
    • Click the 'Install' button (it will then be 'Open' when re-visited). A new window will popup.
    • On the dongle press the reset button to put it into programmable mode (DFU mode) - I think DFU means Device Firmware Update but I am not sure. Note that the reset button is the tiny button on the side of the 'reset' unit next to the big white SW1 button. You can see the reset unit pictured here: infocenter.nordicsemi.com/index.jsp - Note the button is very tiny and not so obvious!
    • In the nRF Connect Desktop program's new popup window select the device from the drop down window in the title bar.
    • Click on 'Add Hex file' in the selections on the right hand side.
    • Navigate to the appopriate HEX file where the driver was unzipped and select it. In my case located here: nrf-ble-driver-4.1.1-win_x86_64\share\nrf-ble-driver\hex\sd_api_v6\connectivity_4.1.1_usb_with_s140_6.1.1.hex
    • Now select the 'Write' option from the list on the right hand side. The LEDs should flash and eventually the green LED will flash. At the bottom of the Desktop app will be a display of the progress. When all done the last row should say 'DFU for SoftDevice completed successfully!'
Related