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
- Connecting the board
- Using Terminal Applications
- Using nRF Connect
- How to program your nRF52840-MDK
- Next Step
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
Connecting the board
Connect the board by performing the following steps:
- 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.
- 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.
Using terminal applications
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:
If there is nothing printed, just press RESET button on the board.
$ screen /dev/cu.usbmodem1412 115200
Using nRF Connect
Test the application with the nRF Connect mobile app by performing the following steps:
- Get the nRF Connect app from App Store or Google Play.
- Connect to the device from nRF Connect (the device is advertising as
- Observe that BLUE LED is on and GREEN LED is off. This indicates that the connections is established.
- Observe that the
LED Button Serviceis shown in the connected device and then you can enable services for the Button Characteristic by clicking the
- Notifications are received on the Button Characteristic (0x1524) when pressing or releasing the USER Button.
Nordic Blinky LEDCharacteristic (0x1525) and observe that RED LED is turned on.
Nordic Blinky LEDCharacteristic (0x1525) and observe that RED LED is turned off.How to program your nRF52840-MDK
How to program your nRF52840-MDK
You have the following two options to program your board:
- Drag-n-drop Programming
- Using pyOCD
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.
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
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!
This post is licensed under a Creative Commons Attribution 4.0 International License.