Getting Started with nRF52840-MDK

Getting Started with nRF52840-MDK

Congratulations on getting the nRF52840-MDK!

In this post, we'll show you how to connect and power up your nRF52840-MDK, and what to expect when you do so. This will take about 20 minutes.

Table of Contents

What's Included

Once you receive your nRF52840-MDK development kit, you will find the following parts:

  • The nRF52840-MDK Board
  • The USB 3.1 Type-C to USB 2.0 Type-A Male Cable
kit contains

Connecting the board

Connect the board by performing the following steps:

  1. Connect the nRF52840-MDK to one of your PC's USB host ports. This provides power to the board. Observe that two GREEN LEDs are on. One indicates that USB power is good, and another indicates that the application is advertising.
  2. Open a file explorer. Confirm that the board has appeared as a removable drive named DAPLINK. This allows you to program the nRF52840 chip. You'll do this under "how to program your nRF52840-MDK" below.
connecting to pc

Using terminal applications

Terminal applications (such as PuTTY or screen) run on your host PC. They provide a window where your board can print messages.

Connect your board to your computer over USB. This should work out of the box on Linux and macOS, but for Windows earlier than Windows 10, you will probably need to install a serial port driver.

For example, We can run screen on macOS. macOS. In Terminal, run:

$ screen /dev/cu.usbmodem1412 115200
If there is nothing printed, just press RESET button on the board.
screen message

Using nRF Connect

Test the application with the nRF Connect mobile app by performing the following steps:

  1. Get the nRF Connect app from App Store or Google Play.
  2. Connect to the device from nRF Connect (the device is advertising as nRF52840-MDK).
  3. Observe that BLUE LED is on and GREEN LED is off. This indicates that the connections is established.
  4. Observe that the LED Button Service is shown in the connected device and then you can enable services for the Button Characteristic by clicking the Play button.
  5. Notifications are received on the Button Characteristic (0x1524) when pressing or releasing the USER Button.
  6. Write 01 to the Nordic Blinky LED Characteristic (0x1525) and observe that RED LED is turned on.
  7. Write 00 to the Nordic Blinky LED Characteristic (0x1525) and observe that RED LED is turned off.How to program your nRF52840-MDK
ble app blinky

How to program your nRF52840-MDK

You have the following two options to program your board:

  • Drag-n-drop Programming
  • Using pyOCD

Drag-n-drop Programming

Drag and drop the hex file into the DAPLINK removable drive mentioned above. The file contains firmware which will be automatically programmed onto the nRF52840 SoC.

When programming is completed, the removable drive will be re-detected by the computer. The application will run after pressing the RESET button.

Using pyOCD

pyOCD is an Open Source python 2.7 based library for programming and debugging ARM Cortex-M microcontrollers using CMSIS-DAP. Linux, OSX and Windows are supported.

The latest stable version of pyOCD may be installed via pip as follows:

$ pip install --pre -U pyocd

Alternatively, to install the latest development version (master branch), you can do the following:

$ pip install --pre -U https://github.com/mbedmicro/pyOCD/archive/master.zip

You can verify that your board is detected by pyOCD by running:

$ pyocd-flashtool -l

and then flash the board by running:

$ pyocd-flashtool -d debug -t nrf52 -se nrf52840_mdk_ble_app_hrs_s140.hex

Next Step

Clone the makerdiary/nrf52840-mdk repository or download it as a zip package and put its contents to your working directory.

$ git clone https://github.com/makerdiary/nrf52840-mdk.git

This repository provides documents and example applications that you can run on your nRF52840-MDK to ensure that everything is set up correctly.

Enjoy the demos and your nRF52840-MDK!

License

Creative Commons License
This post is licensed under a Creative Commons Attribution 4.0 International License.
Back to blog