{"id":6528,"date":"2016-09-29T21:43:28","date_gmt":"2016-09-29T21:43:28","guid":{"rendered":"http:\/\/www.ifroglab.com\/en\/?p=6528"},"modified":"2016-09-29T21:43:28","modified_gmt":"2016-09-29T21:43:28","slug":"nordic-nrf51822-pca10001","status":"publish","type":"post","link":"https:\/\/www.ifroglab.com\/en\/?p=6528","title":{"rendered":"Nordic nRF51822 PCA10001"},"content":{"rendered":"<div id=\"block-yui_3_17_2_1_1411896632810_144801\" class=\"sqs-block markdown-block sqs-block-markdown\" data-block-type=\"44\">\n<div id=\"yui_3_17_2_1_1459353772466_234\" class=\"sqs-block-content\">\n<p><a href=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/2016-03-30_09_08_47_3.jpg\" rel=\"attachment wp-att-7021\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-7021\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/2016-03-30_09_08_47_3.jpg\" alt=\"2016-03-30_09_08_47_3\" width=\"570\" height=\"278\" \/><\/a><\/p>\n<h2>Hardware Description\uff1a<\/h2>\n<p>nRF51822 Evaluation Kit<br \/>\n<a href=\"https:\/\/www.arduino.cc\/en\/Main\/ArduinoBoardMega2560\">https:\/\/www.arduino.cc\/en\/Main\/ArduinoBoardMega2560<\/a><\/p>\n<h2>Video<\/h2>\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/C3QnvznVayY\" width=\"420\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2>How to setup\uff1a<\/h2>\n<ol>\n<li>Download and install\u00a0<a href=\"http:\/\/www.ifroglab.com\/?page_id=6968\">ICBlock<\/a>\u00a0Application<\/li>\n<li>Setup and Download nordic\u00a0nRF51822 SDK \u00a0follow below steps.<\/li>\n<\/ol>\n<h3>\u00a0Windows<\/h3>\n<p>Step 1: Go to Nordic&#8217;s nRF51822 download page<\/p>\n<ul id=\"yui_3_17_2_1_1459353772466_256\">\n<li id=\"yui_3_17_2_1_1459353772466_255\"><a id=\"yui_3_17_2_1_1459353772466_254\" href=\"http:\/\/www.nordicsemi.com\/eng\/Products\/Bluetooth-Smart-Bluetooth-low-energy\/nRF51822#Downloads\" target=\"_blank\" data-preserve-html-node=\"true\">Nordic nRF51822 Download<\/a> <br data-preserve-html-node=\"true\" \/><a href=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-30-at-9.19.52-AM.png\" rel=\"attachment wp-att-7026\"><img decoding=\"async\" class=\"alignnone size-full wp-image-7026\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-30-at-9.19.52-AM.png\" alt=\"Screen Shot 2016-03-30 at 9.19.52 AM\" width=\"714\" height=\"203\" \/><\/a><\/li>\n<\/ul>\n<p><br data-preserve-html-node=\"true\" \/>Step 2: Get nRF51822 SDK<\/p>\n<ul id=\"yui_3_17_2_1_1459353772466_233\">\n<li id=\"yui_3_17_2_1_1459353772466_232\">Click nRF51-SDK-zip to download <br data-preserve-html-node=\"true\" \/><a href=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/nRF51-SDK-zip.png\" rel=\"attachment wp-att-7024\"><img decoding=\"async\" class=\"alignnone size-full wp-image-7024\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/nRF51-SDK-zip.png\" alt=\"nRF51-SDK-zip\" width=\"343\" height=\"25\" \/><\/a><\/li>\n<li><em>Please refer to &#8220;How To Download nRF51 SDK v7.x.x&#8221; if you want to use SDK 7.x.x version.<\/em> <br data-preserve-html-node=\"true\" \/><br data-preserve-html-node=\"true\" \/><\/li>\n<\/ul>\n<p>Step 3: Get nRF51822 SoftDevice (S110)<\/p>\n<ul>\n<li>Click S110-SD-v7 <br data-preserve-html-node=\"true\" \/><a href=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-30-at-9.20.55-AM.png\" rel=\"attachment wp-att-7027\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7027\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-30-at-9.20.55-AM.png\" alt=\"Screen Shot 2016-03-30 at 9.20.55 AM\" width=\"340\" height=\"35\" \/><\/a><\/li>\n<li><em>Note: current SDK requires S110 v7 to compile<\/em> <br data-preserve-html-node=\"true\" \/><br data-preserve-html-node=\"true\" \/><\/li>\n<\/ul>\n<p>Step 4: Get nRF51822 Tools<\/p>\n<p><em>Note: See OSX\/Linux session below if you are not using Windows.<\/em><\/p>\n<ol>\n<li>Download the nRFTools_6_1_0_Installer.exe <br data-preserve-html-node=\"true\" \/><a href=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/nRF51-Tools.png\" rel=\"attachment wp-att-7023\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7023\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2016\/03\/nRF51-Tools.png\" alt=\"nRF51-Tools\" width=\"337\" height=\"52\" \/><\/a><\/li>\n<li>Run the .exe and install it<\/li>\n<li>We just need the mergehex.exe and it should be installed by default at <br data-preserve-html-node=\"true\" \/>C:\\Program Files (x86)\\Nordic Semiconductor\\nrf51\\bin\\<\/li>\n<\/ol>\n<p><br data-preserve-html-node=\"true\" \/>Step 5: Get ARM GCC<\/p>\n<ul>\n<li>Download ARM GCC <br data-preserve-html-node=\"true\" \/><a href=\"https:\/\/launchpadlibrarian.net\/177524899\/gcc-arm-none-eabi-4_8-2014q2-20140609-win32.zip\">https:\/\/launchpadlibrarian.net\/177524899\/gcc-arm-none-eabi-4_8-2014q2-20140609-win32.zip<\/a><\/li>\n<\/ul>\n<p><br data-preserve-html-node=\"true\" \/>Step 6: Get GNU Make utility<\/p>\n<ol id=\"yui_3_17_2_1_1459353772466_271\">\n<li>Download GNU Make<br data-preserve-html-node=\"true\" \/><a href=\"http:\/\/iweb.dl.sourceforge.net\/project\/gnuwin32\/make\/3.81\/make-3.81-bin.zip[][6]\">http:\/\/iweb.dl.sourceforge.net\/project\/gnuwin32\/make\/3.81\/make-3.81-bin.zip<\/a><\/li>\n<li id=\"yui_3_17_2_1_1459353772466_270\">\n<p id=\"yui_3_17_2_1_1459353772466_269\">Download GNU dependency files<br data-preserve-html-node=\"true\" \/><a href=\"http:\/\/iweb.dl.sourceforge.net\/project\/gnuwin32\/make\/3.81\/make-3.81-dep.zip\">http:\/\/iweb.dl.sourceforge.net\/project\/gnuwin32\/make\/3.81\/make-3.81-dep.zip<\/a> <br data-preserve-html-node=\"true\" \/><em>Note: For Windows, the make.exe needs some DLLs to run, these are in make-3.81-dep, put them into a same folder<\/em><\/p>\n<\/li>\n<\/ol>\n<p><br data-preserve-html-node=\"true\" \/>Step 7: Putting all tools into a folder<\/p>\n<ul>\n<li>Unzip all tools to a folder, for example &#8220;D:\\nRF51822&#8221;, we will use this as our development folder, and you should see the follow structure <br data-preserve-html-node=\"true\" \/><img decoding=\"async\" title=\"\" src=\"http:\/\/redbearlab.com\/s\/GCC_Folder.png\" alt=\"alt text\" \/><\/li>\n<\/ul>\n<p><br data-preserve-html-node=\"true\" \/>Step 8: Modify Makefiles<\/p>\n<ul>\n<li>In this folder, modify <strong>Makefile.windows<\/strong><br data-preserve-html-node=\"true\" \/><br data-preserve-html-node=\"true\" \/>D:\\nRF51822\\nrf51_sdk_v6_1_0_b2ec2e6\\nrf51822\\Source\\templates\\gcc <br data-preserve-html-node=\"true\" \/><br data-preserve-html-node=\"true\" \/>With the follow code:<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"row sqs-row\">\n<div class=\"col sqs-col-1 span-1\"><\/div>\n<div class=\"col sqs-col-11 span-11\">\n<div id=\"block-yui_3_17_2_1_1411896632810_207374\" class=\"sqs-block code-block sqs-block-code\" data-block-type=\"23\">\n<div class=\"sqs-block-content\">\n<pre class=\"source-code\">ifeq ($(findstring 86, $(ProgramFiles)), )\r\n    PROGFILES := C:\/Program Files\r\nelse\r\n    PROGFILES := C:\/Program Files (x86)\r\nendif\r\n\r\nGNU_INSTALL_ROOT := D:\/nRF51822\/gcc-arm-none-eabi-4_8-2014q2-20140609-win32\r\nGNU_VERSION := 4.7.3\r\nGNU_PREFIX := arm-none-eabi<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"block-yui_3_17_2_1_1411896632810_212602\" class=\"sqs-block markdown-block sqs-block-markdown\" data-block-type=\"44\">\n<div class=\"sqs-block-content\">\n<ul>\n<li>modify <strong>Makefile.common<\/strong>, add SDK_PATH and SDK_SOURCE_PATH:<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"row sqs-row\">\n<div class=\"col sqs-col-1 span-1\"><\/div>\n<div class=\"col sqs-col-11 span-11\">\n<div id=\"block-yui_3_17_2_1_1411896632810_213812\" class=\"sqs-block code-block sqs-block-code\" data-block-type=\"23\">\n<div class=\"sqs-block-content\">\n<pre class=\"source-code\">DEVICE := NRF51\r\nDEVICESERIES := nrf51\r\n\r\nSDK_PATH = D:\/nRF51822\/nrf51_sdk_v6_1_0_b2ec2e6\/nrf51822\/\r\nSDK_SOURCE_PATH = D:\/nRF51822\/nrf51_sdk_v6_1_0_b2ec2e6\/nrf51822\/Source\/\r\n\r\nSDK_INCLUDE_PATH = $(SDK_PATH)\/Include\/\r\nSDK_SOURCE_PATH = $(SDK_PATH)\/Source\/\r\nTEMPLATE_PATH += $(SDK_SOURCE_PATH)\/templates\/gcc\/\r\nOUTPUT_BINARY_DIRECTORY := _build<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"block-yui_3_17_2_1_1411896632810_216676\" class=\"sqs-block markdown-block sqs-block-markdown\" data-block-type=\"44\">\n<div class=\"sqs-block-content\">\n<p>Step 9: Compile Heart Rate Sensor (HRS) example<\/p>\n<ol>\n<li>Start a Command Prompt:<\/li>\n<li>Go to this folder:<br data-preserve-html-node=\"true\" \/>D:\\nRF51822\\nrf51_sdk_v6_1_0_b2ec2e6\\nrf51822\\Board\\nrf6310\\s110\\ble_app_hrs\\gcc<\/li>\n<li>In command prompt, run:<br data-preserve-html-node=\"true\" \/>D:\\nRF51822\\make-3.81\\make.exe -f ble_app_hrs.Makefile<\/li>\n<li>The firmware file (.hex) will be created inside the <strong>_build<\/strong> folder<\/li>\n<\/ol>\n<p><br data-preserve-html-node=\"true\" \/>Step 10: Merge HRS with SoftDevice <em>Note: See OSX\/Linux session below if you are not using Windows.<\/em><\/p>\n<ol>\n<li>Run merge tool:<br data-preserve-html-node=\"true\" \/>D:\\nRF51822\\mergehex.exe &#8211;merge D:\\nRF51822\\s110_nrf51822_7.0.0_softdevice.hex _build\\ble_app_hrs_s110_xxaa.hex &#8211;output hrs.hex<\/li>\n<li>Sample screen output:<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<div class=\"row sqs-row\">\n<div class=\"col sqs-col-1 span-1\"><\/div>\n<div class=\"col sqs-col-11 span-11\">\n<div id=\"block-yui_3_17_2_1_1411896632810_225501\" class=\"sqs-block code-block sqs-block-code\" data-block-type=\"23\">\n<div class=\"sqs-block-content\">\n<pre class=\"source-code\">Parsing D:\\nRF51822\\s110_nrf51822_7.0.0_softdevice.hex file.\r\nParsing _build\\ble_app_hrs_s110_xxaa.hex file.\r\nMerging files.\r\nWriting merged file.<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"block-yui_3_17_2_1_1411896632810_228929\" class=\"sqs-block markdown-block sqs-block-markdown\" data-block-type=\"44\">\n<div id=\"yui_3_17_2_1_1459353772466_283\" class=\"sqs-block-content\">\n<p>Step 11: Load the compiled firmware<\/p>\n<ol>\n<li>Connect your nRF51822 board to an USB port<\/li>\n<li>Drag and drop the hrs.hex to the MSD drive, e.g. E:<\/li>\n<\/ol>\n<p id=\"yui_3_17_2_1_1459353772466_282\">**You should be able to do this if you follow the <a href=\"http:\/\/redbearlab.com\/s\/nRFToolBox.jpg\">Getting Started &#8211; nRF51822<\/a><\/p>\n<p><br data-preserve-html-node=\"true\" \/>Step 12: Test it with Nordic nRF ToolBox App<\/p>\n<ol>\n<li>Go to App Store and download &#8220;nRF ToolBox&#8221;<\/li>\n<li>Run &#8220;HRM&#8221; and connect to the development board<\/li>\n<\/ol>\n<p><br data-preserve-html-node=\"true\" \/><img decoding=\"async\" title=\"\" src=\"http:\/\/redbearlab.com\/s\/nRFToolBox.jpg\" alt=\"alt text\" \/><\/p>\n<p><br data-preserve-html-node=\"true\" \/><img decoding=\"async\" title=\"\" src=\"http:\/\/redbearlab.com\/s\/nRFToolBoxHRM1.jpg\" alt=\"alt text\" \/><\/p>\n<p><br data-preserve-html-node=\"true\" \/><img decoding=\"async\" title=\"\" src=\"http:\/\/redbearlab.com\/s\/nRFToolBoxHRM2.jpg\" alt=\"alt text\" \/><\/p>\n<\/div>\n<\/div>\n<div id=\"block-yui_3_17_2_4_1423122488618_17942\" class=\"sqs-block horizontalrule-block sqs-block-horizontalrule\" data-block-type=\"47\">\n<div class=\"sqs-block-content\">\n<hr \/>\n<\/div>\n<\/div>\n<div id=\"block-yui_3_17_2_4_1423122488618_18054\" class=\"sqs-block markdown-block sqs-block-markdown\" data-block-type=\"44\">\n<div class=\"sqs-block-content\">\n<h3 id=\"macosx\">Mac OSX<\/h3>\n<p>Step 1: Click <a href=\"https:\/\/launchpad.net\/gcc-arm-embedded\/+download\">here<\/a> to download ARM-GCC for MAC application, unzip and install.<\/p>\n<p>Step 2: The mergehex.exe is only for Windows platform. Use srec_cat instead on Mac OSX.<\/p>\n<p>Step 3: Install brew from Terminal<\/p>\n<p>$ ruby -e &#8220;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)&#8221;<\/p>\n<p><br data-preserve-html-node=\"true\" \/>Step 4: Install srecord using brew from Terminal<\/p>\n<p>$ brew install srecord<\/p>\n<p>Step 5: Merge using srec_cat command<\/p>\n<p>$ srec<em>cat<\/em><em> s110<\/em>nrf51822<em>7.0.0<\/em>softdevice.hex -intel ble<em>app<\/em>hrs<em>s110<\/em>xxaa.hex -intel -o hrs.hex -intel &#8211;line-length=44<\/p>\n<\/div>\n<\/div>\n<div id=\"block-yui_3_17_2_4_1423122488618_19233\" class=\"sqs-block horizontalrule-block sqs-block-horizontalrule\" data-block-type=\"47\">\n<div class=\"sqs-block-content\">\n<hr \/>\n<\/div>\n<\/div>\n<div id=\"block-yui_3_17_2_4_1423122488618_19339\" class=\"sqs-block markdown-block sqs-block-markdown\" data-block-type=\"44\">\n<div class=\"sqs-block-content\">\n<h3 id=\"linux\">Linux<\/h3>\n<p>The mergehex.exe is only for Windows platform. Use srec_cat instead on Linux.<\/p>\n<p>Step 1: Install srecord<\/p>\n<p>$ sudo apt-get install srecord<\/p>\n<p><br data-preserve-html-node=\"true\" \/>Step 2: Merge using srec_cat command<\/p>\n<p>$ srec<em>cat<\/em><em> s110<\/em>nrf51822<em>7.0.0<\/em>softdevice.hex -intel ble<em>app<\/em>hrs<em>s110<\/em>xxaa.hex -intel -o hrs.hex -intel &#8211;line-length=44<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hardware Description\uff1a nRF51822 Evaluation Kit https:\/\/www.arduino.cc\/en\/Main\/ArduinoBoardMega2560 Video How to setup\uff1a Download and install\u00a0ICBlock\u00a0Application Setup and Download nordic\u00a0nRF51822 SDK \u00a0follow below steps. \u00a0Windows Step 1: Go to Nordic&#8217;s nRF51822 download page Nordic nRF51822 Download Step 2: Get nRF51822 SDK Click nRF51-SDK-zip to download Please refer to &#8220;How To Download nRF51 SDK v7.x.x&#8221; if you want to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6529,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[],"class_list":["post-6528","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hardware"],"_links":{"self":[{"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=\/wp\/v2\/posts\/6528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6528"}],"version-history":[{"count":1,"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=\/wp\/v2\/posts\/6528\/revisions"}],"predecessor-version":[{"id":6530,"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=\/wp\/v2\/posts\/6528\/revisions\/6530"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=\/wp\/v2\/media\/6529"}],"wp:attachment":[{"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ifroglab.com\/en\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}