
Nordic nRF51822 PCA10001
Hardware Description:
nRF51822 Evaluation Kit
https://www.arduino.cc/en/Main/ArduinoBoardMega2560
Video
How to setup:
- Download and install ICBlock Application
- Setup and Download nordic nRF51822 SDK follow below steps.
Windows
Step 1: Go to Nordic’s nRF51822 download page
Step 2: Get nRF51822 SDK
- Click nRF51-SDK-zip to download
- Please refer to “How To Download nRF51 SDK v7.x.x” if you want to use SDK 7.x.x version.
Step 3: Get nRF51822 SoftDevice (S110)
Step 4: Get nRF51822 Tools
Note: See OSX/Linux session below if you are not using Windows.
- Download the nRFTools_6_1_0_Installer.exe
- Run the .exe and install it
- We just need the mergehex.exe and it should be installed by default at
C:\Program Files (x86)\Nordic Semiconductor\nrf51\bin\
Step 5: Get ARM GCC
- Download ARM GCC
https://launchpadlibrarian.net/177524899/gcc-arm-none-eabi-4_8-2014q2-20140609-win32.zip
Step 6: Get GNU Make utility
- Download GNU Make
http://iweb.dl.sourceforge.net/project/gnuwin32/make/3.81/make-3.81-bin.zip -
Download GNU dependency files
http://iweb.dl.sourceforge.net/project/gnuwin32/make/3.81/make-3.81-dep.zip
Note: For Windows, the make.exe needs some DLLs to run, these are in make-3.81-dep, put them into a same folder
Step 7: Putting all tools into a folder
- Unzip all tools to a folder, for example “D:\nRF51822”, we will use this as our development folder, and you should see the follow structure
Step 8: Modify Makefiles
- In this folder, modify Makefile.windows
D:\nRF51822\nrf51_sdk_v6_1_0_b2ec2e6\nrf51822\Source\templates\gcc
With the follow code:
ifeq ($(findstring 86, $(ProgramFiles)), ) PROGFILES := C:/Program Files else PROGFILES := C:/Program Files (x86) endif GNU_INSTALL_ROOT := D:/nRF51822/gcc-arm-none-eabi-4_8-2014q2-20140609-win32 GNU_VERSION := 4.7.3 GNU_PREFIX := arm-none-eabi
- modify Makefile.common, add SDK_PATH and SDK_SOURCE_PATH:
DEVICE := NRF51 DEVICESERIES := nrf51 SDK_PATH = D:/nRF51822/nrf51_sdk_v6_1_0_b2ec2e6/nrf51822/ SDK_SOURCE_PATH = D:/nRF51822/nrf51_sdk_v6_1_0_b2ec2e6/nrf51822/Source/ SDK_INCLUDE_PATH = $(SDK_PATH)/Include/ SDK_SOURCE_PATH = $(SDK_PATH)/Source/ TEMPLATE_PATH += $(SDK_SOURCE_PATH)/templates/gcc/ OUTPUT_BINARY_DIRECTORY := _build
Step 9: Compile Heart Rate Sensor (HRS) example
- Start a Command Prompt:
- Go to this folder:
D:\nRF51822\nrf51_sdk_v6_1_0_b2ec2e6\nrf51822\Board\nrf6310\s110\ble_app_hrs\gcc - In command prompt, run:
D:\nRF51822\make-3.81\make.exe -f ble_app_hrs.Makefile - The firmware file (.hex) will be created inside the _build folder
Step 10: Merge HRS with SoftDevice Note: See OSX/Linux session below if you are not using Windows.
- Run merge tool:
D:\nRF51822\mergehex.exe –merge D:\nRF51822\s110_nrf51822_7.0.0_softdevice.hex _build\ble_app_hrs_s110_xxaa.hex –output hrs.hex - Sample screen output:
Parsing D:\nRF51822\s110_nrf51822_7.0.0_softdevice.hex file. Parsing _build\ble_app_hrs_s110_xxaa.hex file. Merging files. Writing merged file.
Step 11: Load the compiled firmware
- Connect your nRF51822 board to an USB port
- Drag and drop the hrs.hex to the MSD drive, e.g. E:
**You should be able to do this if you follow the Getting Started – nRF51822
Step 12: Test it with Nordic nRF ToolBox App
- Go to App Store and download “nRF ToolBox”
- Run “HRM” and connect to the development board
Mac OSX
Step 1: Click here to download ARM-GCC for MAC application, unzip and install.
Step 2: The mergehex.exe is only for Windows platform. Use srec_cat instead on Mac OSX.
Step 3: Install brew from Terminal
$ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
Step 4: Install srecord using brew from Terminal
$ brew install srecord
Step 5: Merge using srec_cat command
$ sreccat s110nrf518227.0.0softdevice.hex -intel bleapphrss110xxaa.hex -intel -o hrs.hex -intel –line-length=44
Linux
The mergehex.exe is only for Windows platform. Use srec_cat instead on Linux.
Step 1: Install srecord
$ sudo apt-get install srecord
Step 2: Merge using srec_cat command
$ sreccat s110nrf518227.0.0softdevice.hex -intel bleapphrss110xxaa.hex -intel -o hrs.hex -intel –line-length=44