Nordic nRF51822 PCA10001

Nordic nRF51822 PCA10001

2016-03-30_09_08_47_3

Hardware Description:

nRF51822 Evaluation Kit
https://www.arduino.cc/en/Main/ArduinoBoardMega2560

Video

How to setup:

  1. Download and install ICBlock Application
  2. 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
    nRF51-SDK-zip
  • 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)

  • Click S110-SD-v7
    Screen Shot 2016-03-30 at 9.20.55 AM
  • Note: current SDK requires S110 v7 to compile

Step 4: Get nRF51822 Tools

Note: See OSX/Linux session below if you are not using Windows.

  1. Download the nRFTools_6_1_0_Installer.exe
    nRF51-Tools
  2. Run the .exe and install it
  3. 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


Step 6: Get GNU Make utility

  1. Download GNU Make
    http://iweb.dl.sourceforge.net/project/gnuwin32/make/3.81/make-3.81-bin.zip
  2. 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
    alt text


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

  1. Start a Command Prompt:
  2. Go to this folder:
    D:\nRF51822\nrf51_sdk_v6_1_0_b2ec2e6\nrf51822\Board\nrf6310\s110\ble_app_hrs\gcc
  3. In command prompt, run:
    D:\nRF51822\make-3.81\make.exe -f ble_app_hrs.Makefile
  4. 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.

  1. 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
  2. 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

  1. Connect your nRF51822 board to an USB port
  2. 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

  1. Go to App Store and download “nRF ToolBox”
  2. Run “HRM” and connect to the development board


alt text


alt text


alt text


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

No Comments

Comments are closed.