nRF52 is a series of ARM Cortex M4 based microcontrollers with short range wireless capabilities. They support a wide range of protocols like ANT, Thread, 802.15.4, Zigbee, the widely used Bluetooth Low Energy (BLE) and BLE mesh.
The nRF52 is widely used for BLE projects as it has an a well documented SDK with a large number of libraries and drivers. It is one of the go to MCUs for anything BLE related and has been widely adopted.
The nRF5 SDK supports a wide range of workflows. You can use it with a text editor to edit and a terminal to build the project. Or you can use an Integrated Development Environment (IDE) like ARM Keil, Segger Embedded Studio (SES), Eclipse etc. Nordic and Segger have a partnership where they provide SES for free to anyone using a Nordic product.
This post will show you how to setup SES and run your first program on the nRF52 DK.
The blinky project is the “Hello world” project for embedded engineers. This objective of this project is to check if the hardware and the installed software are working properly. This program will toggle the state of all the 4 LEDs on the nRF52 DK.
Navigate to where you have extracted the nRF5 SDK. Navigate to “examples/peripheral/blinky/pca10040/s132/ses/”. In this folder, you will notice a file called “blinky_pca10040_s132.emproject”. Double click this file and SES should load the project.
blinky -> Name of the project
pca10040 -> Codename for the nRF52 DK
s132 -> Softdevice version
Softdevice is a library provided by Nordic which handles all of the BLE/any wireless protocol related operations.
To build the project, you ca use the shortcut “F7” or click on “Build > Build blinky_pca10040_s132”.
The status of the build can be seen in the output section which is situated in bottom center of the window. A successful build will look like this:
If there are any errors, it will be listed in the output section.
Connect the nRF52 DK to your computer using a micro USB to USB Type A cable. The program can be downloaded by going to “Target > Download blinky_pca10040_s132”.
You will observe that the LEDs from LED1 to LED4 will first turn on and then will turn off in the same order continuously