How to use the NRF52840 Dongle (PCA10059) as development board

Nordic nRF52840 Dongle (PCA10059)

This blog is to describe how to use the nRF52840 dongle (PCA10059) as the development board.

The nRF52840 Dongle is a small, low-cost USB dongle that supports Bluetooth 5, Bluetooth mesh, Thread, ZigBee, 802.15.4, ANT and 2.4 GHz proprietary protocols. The Dongle is the perfect target hardware for use with nRF Connect for Desktop as it is low-cost but still support all the short range wireless standards used with Nordic devices. The dongle has been designed to be used as a wireless HW device together with nRF Connect for Desktop. For other use cases please do note that there is no debug support on the Dongle, only support for programming the device and communicating through USB.

It is supported by most of the nRF Connect for Desktop apps and will automatically be programmed if needed. In addition custom applications can be compiled and downloaded to the Dongle. It has a user programmable RGB LED, a green LED, a user programmable button as well as 15 GPIO accessible from castellated solder points along the edge. Example applications are available in the nRF5 SDK under the board name PCA10059.

The nRF52840 Dongle is supported by nRF Connect for Desktop as well as programming through nRFUtil.

The box includes an nRF52840 Dongle.

https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle

The user guidline of NRF52840 dongle is located at http://infocenter.nordicsemi.com/pdf/nRF52840_Dongle_User_Guide_v1.1.pdf

Programming

The nRF52840 Dongle can be programmed through the built-in USB bootloader. Before you start, check Getting started. To program the Dongle, it must be in bootloader mode.

When you first get the Dongle, it may only be pre-programmed on the USB bootloader and application firmware without softdevice. If you run the BLE application, I recommend to program the hex file (ble_app_bllinky_pca10059_s140.hex) which includes the application together with softdevice at the first time.

The Dongle can be made to enter bootloader mode in one of the two ways:

  • Trigger the nRF52840 USB DFU endpoint. The firmware to support this is embedded in all nRF Connect for Desktop apps for the nRF52840 Dongle. If you add the DFU Trigger Library (USB) to your custom device firmware, you will be able to trigger the DFU from nRF Connect for Desktop without using any buttons. For documentation, see DFU Trigger Library (USB), which is part of the nRF5 SDK v15.3.0.
  • For Dongles with applications missing the USB DFU endpoint: Press the RESET button.
Pressing the RESET button

When the nRF52840 Dongle has entered the bootloader mode, LD2 pulses red. The Dongle is now ready for programming.

All the nRF Connect for Desktop apps require specific firmware to be present on the nRF52840 Dongle to function correctly. The apps will update the firmware if needed. If you want to upload a custom firmware to the Dongle, you can do this by using the dedicated Programmer programming app, or nrfutil.

Open the nRF Connect Desktop

Select the corresponding COM port device

Load the HEX file (default HEX inside the SDK 15.3)

ble_app_bllinky_pca10059_s140.hex (including the softdevice S140v6.1.1)

Click the Write ICON to do the USB DFU

Softdevice Version

The following table lists the FWIDs which are used to identify the SoftDevice versions both included in the package and installed on the target device to perform the required SoftDevice version check:

https://github.com/NordicSemiconductor/pc-nrfutil

SoftDeviceFWID (sd-req)
s112_nrf52_6.0.00xA7
s112_nrf52_6.1.00xB0
s112_nrf52_6.1.10xB8
s112_nrf52_7.0.00xC4
s113_nrf52_7.0.00xC3
s130_nrf51_1.0.00x67
s130_nrf51_2.0.00x80
s132_nrf52_2.0.00x81
s130_nrf51_2.0.10x87
s132_nrf52_2.0.10x88
s212_nrf52_2.0.10x8D
s332_nrf52_2.0.10x8E
s132_nrf52_3.0.00x8C
s132_nrf52_3.1.00x91
s132_nrf52_4.0.00x95
s132_nrf52_4.0.20x98
s132_nrf52_4.0.30x99
s132_nrf52_4.0.40x9E
s132_nrf52_4.0.50x9F
s212_nrf52_4.0.50x93
s332_nrf52_4.0.50x94
s132_nrf52_5.0.00x9D
s212_nrf52_5.0.00x9C
s332_nrf52_5.0.00x9B
s132_nrf52_5.1.00xA5
s132_nrf52_6.0.00xA8
s132_nrf52_6.1.00xAF
s132_nrf52_6.1.10xB7
s132_nrf52_7.0.00xC2
s140_nrf52_6.0.00xA9
s140_nrf52_6.1.00xAE
s140_nrf52_6.1.10xB6
s140_nrf52_7.0.00xC1
s212_nrf52_6.1.10xBC
s332_nrf52_6.1.10xBA
s340_nrf52_6.1.10xB9

Examples for NRF52840 Dongle

The following apps are available for the pca10059 dongle in sdk 15.x :

  • examples/peripheral/cli,
  • examples/peripheral/blinky,
  • examples/dfu/open_bootloader,
  • examples/connectivity/ble_connectivity,
  • examples/ble_peripheral/ble_app_hrs,
  • examples/ble_peripheral/ble_app_blinky.

There is also more documentation available here on our Infocenter. 

Use the nRF52840 Dongle with nRF Connect Desktop

The nRF52840 dongle can be used to play as the Central / Peripheral on the NRF Connect Desktop (Bluetooth Low Energy).

It can scan for all the peripheral devices or creates as the advertiser. It means that nRF52840 dongle can do the exactly same feature as other nRF52 DK board.

How to run the Bluetooth Low Energy inside the nRF Connect Desktop with nRF52840 dongel

Step 1:

By pressing the button on the nRF52840 dongle to entry the DFU mode and then open the Bluetooth Low Energy inside the nRF Connect Desktop,

Step 2:

Select the target device at the left top corner of NRF Connect (Bluetooth Low Energy). And upgrade the latest bootloader (if have) and upgrade the firmware inside the nRF52840 dongle.

Step 3:

You would see the nRF52840 dongle (USB: Nordic Semiconductor nRF52 Connectivity) as below.

Command Line Interface with BLE on NRF52840 dongle plus debugging log through USB interface.

I did the example on the ble_app_blinky for the PCA10059 as below block diagram. I added the virtual two COM port through USB interface.

In order to get the log through USB, I add the compile option (NRF_LOG_BACKEND_USB_ENABLED) inside the sdk_config.h.

// <e> NRF_LOG_BACKEND_USB_ENABLED - nrf_log_backend_usb - Log USB backend
//==========================================================
#ifndef NRF_LOG_BACKEND_USB_ENABLED
#define NRF_LOG_BACKEND_USB_ENABLED 1
#endif
#if CLI_OVER_USB_CDC_ACM
NRF_CLI_CDC_ACM_DEF(m_cli_cdc_acm_transport);
NRF_CLI_DEF(m_cli_cdc_acm,
            "usb_cli:~$ ",
            &m_cli_cdc_acm_transport.transport,
            '\r',
            CLI_EXAMPLE_LOG_QUEUE_SIZE);
#endif //CLI_OVER_USB_CDC_ACM

static void cli_init(void)
{
        ret_code_t ret;

#if CLI_OVER_USB_CDC_ACM
        ret = nrf_cli_init(&m_cli_cdc_acm, NULL, true, true, NRF_LOG_SEVERITY_INFO);
        APP_ERROR_CHECK(ret);
#endif

By open two terminals, one is for the command line interface., the another is for the debug log (print out).

How to run this demo

You can program the demo hex ( https://github.com/jimmywong2003/nrf52840-dongle-example/blob/master/test_hex/combine.hex ) through the nRF Progrmmer.

All the source codes are placed at https://github.com/jimmywong2003/nrf52840-dongle-example/ .

3 thoughts on “How to use the NRF52840 Dongle (PCA10059) as development board

    1. You can use ble_app_beacon as baseline and port on the ble_app_blinky which I post on my github.
      The idea is to use the non-connectable advertising payload instead of undirected connectable.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.