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

nRF52840 Dongle programming for Windows

I need to write a Windows program that talks to the nRF52840 Dongle.  Is there a .dll or .lib or source code for communicating with the Dongle?  I have programmed the dongle with s140_nrf52_6.1.0_softdevice.hex.  I can not find any documentation of the actual interface that is seen on the PC.  Is it just operated via commands over the COM port?  Are these commands documented?  Where can I find this documentation?

I also need an application to use the nRF52840 Dongle in a pass-through UART mode.  Do I need to load a different hex file into it for that?  Where can I get that?  Is there documentation of the GATT service and characteristic UUIDs for this code?

Thanks!

  • Hi,

    1. Yes, that seems correct.

    2. No, you can use DFU with nrfutil to program the SoftDevice as well. You will soon be able to use the Programmer app for nRF Connect for Desktop as well, but the current pre-release does not work properly.

    3. ?

    4. You cannot use the pc-ble-driver master branch, as this does not have support for the nRF52840 dongle. the firmware uses the UART peripheral of the nR52832 DK, via the onboard SEGGER debugger which is not present on the nRF52840 dongle. There is absolutely no way this firmware can work on the nRF52840 dongle (the UART pins that are used are not connected to the PC in any way).

    5. You need to build the connectivity firmware with the patches from the pc-ble-driver branch that has support for it (see previous post). The pc-ble-driver documentation describes how to apply the patches.

    6. You should not use any of the S132.... SoftDevices or projects. You need the connectivity firmware for the nRF52840 dongle, which uses the S140 SoftDevice.

    7. No, you cannot expect anything to work as you are not using firmware on the nRF that use the USB in any way. It is effectively not connected to your computer.

    8. Yes.

    9. The size difference could be caused by you not having used the same toolchain as was used to make the precompiled .hex and/or using a different optimization level. (You would also see a difference in size if you enable/disable features such as logging)

  • As far as I can tell some of your answers do not seem right to me.

    The pc-ble-driver project is a program that can be compiled on Windows, not a firmware project.  As I mentioned, I need to write PC code to talk to the dongle.  I understand that the ble_app_uart project is firmware that runs on one of your parts, but not the dongle because the UART would need to be replaced with a USB interface.  I am not talking about that.  The pc-ble-driver branch does contain some hex files for various versions of SoftDevice and connectivity apps, but not something that runs on the Dongle without modification.  The nRF5_SDK_15.0.0_a53641a branch contains an example under connectivity\ble_connectivity\pca10059\ser_s140_usb_hci, which I would expect to be hex code I should be able to use to talk to the dongle.  The PC side of that communication should be some modification of the PC code in pc-ble-driver.  Is that not correct?

    Since I have ble_connectivity_s140_usb_hci_pca10059.hex which is pre-build firmware for connectivity to the dongle using USB, can I just load that into the dongle?  I should just need to update pc-ble-driver on the PC to match the version of SoftDevice used.  I don't know how hard that is.

    Is this clear?  I need to verify which hex file to load into the dongle and what changes I need to make to pc-ble-driver to use s140 instead of s132.

    I have tried to write ble_connectivity_s140_usb_hci_pca10059.hex to the dongle using nrfutil.  After it reports success, the dongle is still in boot loader mode on COM4, and the experimental programmer app reports that only the boot loader is loaded.  I have not found any way to program the combined file ble_connectivity_s140_usb_hci_pca10059.hex into the dongle or to change the SoftDevice loaded to s140_nrf52_6.1.0_softdevice.hex.  How do I do it?

  • Hi,

    I think we are talking about the same thing. I checked with one of the the pc-ble-driver developers and he recommended that you use the v2.3.2 tag of the pc-ble-driver. You should use this version on the PC, and the connectivity firmware connectivity_6.0_1m_with_s140_usb_6.0.hex from here (same tag). This is the same version (pc-ble-driver and connectivity firmware) that will be used for the next release of nRF Connect for desktop.

  • This is what I was looking for!  That code works with s132_nrf52_3.1.0_softdevice.hex, not connectivity_6.0_1m_with_s140_usb_6.0.hex, but s132 v3 seems to be what nRF Connect has loaded into my dongle, so that should work.  I'll let you know if I have any more problems.  Thank you so much.

    I hope in the future, you will update a branch of pc_ble_driver to support s140.

Related