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

How to adapt the BLE Secure DFU Bootloader to work with nRF52840 dongle?

Hi, you must be sick of me!

Now that (somehow) I've got the BLE Secure DFU Bootloader to work on my nRF52840 DK board. I'd now like to load it on a nRF52840 dongle pca10059. So I can then work on a buttonless DFU (oh if only this was available out of the box as it surely must be a common use case?)

So, what do I do? Please Slight smile

A question that really concerns me is how to program the dongle.

Programming the DK usually involves an erase option. I've read that doing this with the dongle puts the dongle in a low voltage state and any flashing must be complete before a reset.

How do I ensure that if my attempts don't work at flashing the bootloader that I don't brick the device?

If I do where are the instructions that I can use to recover the dongle using my dk board?

I'm thinking that I'll be okay if I just flash the softdevice and then just keep flashing the bootloader app until it works. Yes there may be some unused code left in the memory map (minimal surely), but hopefully for testing there'll be a "halt" instruction somewhere in the bootloader code  and I'll never reach any garbage? Then when it works I'll do a full erase and flash.

Gordon

  • Hi,

    You can use your nRF52840 DK as the external debugger, by using the debug out connector on the DK as explained here, so you do not need to buy an additional debugger. On the DK you can simply connect a 10-pin cable to P19. There are two connection points for the SWD interface on the backside of the dongle, P1 and J2, but you will unfortunately have to solder. For P1 you only need a standard 2x5-pin header with a 1.27mm pitch, which you can get rather cheap, while for J2 you can use a TC2050 cable from Tag-Connect. 

    You also have another option for connecting to the Dongle, which is to connect to SWDIO and SWDCLK directly. This still requires soldering, but you might find this to be easier than soldering the connectors on the backside, and the only things you need in addition to the external debugger (nRF52840 DK) are wires. You can do this by soldering wires directly to SWDIO and SWDCLK on the dongle. I have marked the plated half-holes where you will have to solder the wires on the picture below.

    You can then use P20 as debug out connector on the DK and connect the SWDIO and SWDCLK wires to their corresponding connectors on the DK.

    If you have not already, I recommend reading the section "Using an external debugger" in the guide I linked you earlier before you start programming the dongle using this, as this is where the warnings about the UICR and the voltage on the dongle is important.

    I know this requires more work than simply using the bootloader on the dongle, but I hope some of the alternatives will work for you so you will be able to program the example on your dongle!

    Best regards,

    Marte

Related