How to use the trigger library to program the nRF52840 dongle

Sorry but I find the documentation useless. I don't even know where to start. It could be I have not found the correct documentation which is not surprising.

The best I have is this: https://devzone.nordicsemi.com/f/nordic-q-a/77254/nrf52840-dongle-pca10059-dfu-trigger-library/332347#332347

but I have no idea how this even started.

Right now the project works. I can use the reset button to flash the dongle and it works. Its a BTLE peripheral that a cycle power client connects to at which time the device starts a scanner and gets data from an unconnectable advertisement from a bike and notifies the data to the client. The USB is used only as a source of power. The project uses SoftDevice for BTLE and flash writes and not the SDK.

Now I want to add the overhead to be able program the dongle without touching the reset button. I don't know where to start. It's clear I have to add lots of h-files and c-files to the project. However, where do I find the steps that document how one adds this functionality to an existing project?

  • What methods do I need to call and when?
  • What configuration parameters do I need to set outside of sdk_config.h?
  • What configuration parameters do I need to set in sdk_config.h?
  • Where are these methods and h-files located so I can pull/configure my project?

One final question, how much overhead does this add? Will it greatly increase the size of my executable project?

When and if this ever gets completed, would that mean I can flash the dongle directly from Keil or Segger or do I still need nRF_Connect that I use now where I have to press the reset button?

  • (I still have not figured out how to make quotes like you have done.)

    So if I understand you correctly, even though my app is NOT YET INSTALLED on the dongle, by including the trigger library and all the usb and related stuff around it into my app I will be able to install this app onto the dongle without pressing the reset button - even though the nRF COnnect programmer does not see the dongle. I don't understand how that will work!

    That being said, it sounds like it would be easier to copy my app code into examples\connectivity\ble_connectivity\pca10059\ser_s140_usb_hci

    than trying to find and configure SES or Keil with the mssing project files and h files. I had gotten a couple of hours into that and new mssing references just kept coming and trying to find them inthe SDK was a tedious and time consuming task.

  • Hi,

    brianreinhold said:
    (I still have not figured out how to make quotes like you have done.)

    When you highlight text there is a "Quote" button you can press to quote:

    brianreinhold said:
    So if I understand you correctly, even though my app is NOT YET INSTALLED on the dongle, by including the trigger library and all the usb and related stuff around it into my app I will be able to install this app onto the dongle without pressing the reset button - even though the nRF COnnect programmer does not see the dongle. I don't understand how that will work!

    No. Clearly, any discussion about what you can do from your app only applies when it is actually programmed on the device. Note that the dongle ships with a version of the connectivity firmware installed which includes the DFU Trigger library. So with a new dongle, it will show up in nRF Connect programmer. If you hare programmed it with firmware without the DFU trigger library it will not, and in that case you need to recover by pressing the reset button. If you need the DFU trigger library functionality it is your responsibility to not flash firmware that does not have it.

  • Okay. So if I copied my application code into examples\connectivity\ble_connectivity\pca10059\ser_s140_usb_hci

    that should provide the necessary trigger support? I just got overwhelmed going the other way and never reached the end of adding more c files and include files never mind the sdk_config.h 90% of which I do not know what it does.

  • In that case you would have the required libraries, drivers and sdk_config.h configurations in place, yes. There will probably be other adaptations needed for your project though, but this may be the simplest approach.

  • Okay, now that I am going to try and make the merge between this 70K DFU and my 10K app, I have not been able to find any documentation about this example. So how does it work? There is BTLE stuff in the project. Does that mean the huge USB stuff is just to enter DFU mode and the actual download of the application is via Bluetooth?

    If there IS documentation for this example somewhere, it would be great if you could tell me where it is.

    Thanks

Related