You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2016/04/28 02:17:37 UTC
[2/4] incubator-mynewt-site git commit: Add bootloader to blinky
tutorials. Pull request #74 to add BLE host API docs.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_add_cpu/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_add_cpu/index.html b/network/ble/ini_stack/ble_add_cpu/index.html
index cf911d6..15167d5 100644
--- a/network/ble/ini_stack/ble_add_cpu/index.html
+++ b/network/ble/ini_stack/ble_add_cpu/index.html
@@ -357,6 +357,16 @@
<li>
+ <a href="../ble_parent_ini/">Initialize parent task</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../ble_host_ini/">Initialize host</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_consolepkg/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_consolepkg/index.html b/network/ble/ini_stack/ble_consolepkg/index.html
index 6e2967a..0af0329 100644
--- a/network/ble/ini_stack/ble_consolepkg/index.html
+++ b/network/ble/ini_stack/ble_consolepkg/index.html
@@ -357,6 +357,16 @@
<li>
+ <a href="../ble_parent_ini/">Initialize parent task</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../ble_host_ini/">Initialize host</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_controller_ini/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_controller_ini/index.html b/network/ble/ini_stack/ble_controller_ini/index.html
index 0a48228..c8aa12a 100644
--- a/network/ble/ini_stack/ble_controller_ini/index.html
+++ b/network/ble/ini_stack/ble_controller_ini/index.html
@@ -357,6 +357,16 @@
<li>
+ <a href="../ble_parent_ini/">Initialize parent task</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../ble_host_ini/">Initialize host</a>
</li>
@@ -615,8 +625,8 @@ long; even a few milliseconds could cause undesirable behavior.</p>
</li>
<li class="pull-right">
- <a href=../ble_host_ini/>
- Next: Initialize host
+ <a href=../ble_parent_ini/>
+ Next: Initialize parent task
<span class="fa fa-arrow-right"></span>
</a>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_devadd/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_devadd/index.html b/network/ble/ini_stack/ble_devadd/index.html
index a5dbc34..68fe5c7 100644
--- a/network/ble/ini_stack/ble_devadd/index.html
+++ b/network/ble/ini_stack/ble_devadd/index.html
@@ -357,6 +357,16 @@
<li>
+ <a href="../ble_parent_ini/">Initialize parent task</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../ble_host_ini/">Initialize host</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_host_ini/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_host_ini/index.html b/network/ble/ini_stack/ble_host_ini/index.html
index 59d0a6c..58c520f 100644
--- a/network/ble/ini_stack/ble_host_ini/index.html
+++ b/network/ble/ini_stack/ble_host_ini/index.html
@@ -356,6 +356,16 @@
+ <li>
+ <a href="../ble_parent_ini/">Initialize parent task</a>
+ </li>
+
+
+
+
+
+
+
<li class="active">
Initialize host
</li>
@@ -500,7 +510,7 @@
<h2 id="initialize-the-nimble-host">Initialize the NimBLE host<a class="headerlink" href="#initialize-the-nimble-host" title="Permanent link">¶</a></h2>
<p>The Nimble host is initialized via a call to <code>ble_hs_init()</code>. This function is declared as follows:</p>
-<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">ble_hs_init</span>(<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">prio</span>, <span style="color: #A90D91">struct</span> <span style="color: #000000">ble_hs_cfg</span> <span style="color: #000000">*cfg</span>)
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">ble_hs_init</span>(<span style="color: #A90D91">struct</span> <span style="color: #000000">os_eventq</span> <span style="color: #000000">*parent_evq</span>, <span style="color: #A90D91">struct</span> <span style="color: #000000">ble_hs_cfg</span> <span style="color: #000000">*cfg</span>)
</pre></div>
@@ -514,8 +524,8 @@
</thead>
<tbody>
<tr>
-<td><em>prio</em></td>
-<td>The priority of the Nimble host task. A lower number corresponds to higher priority.</td>
+<td><em>parent_evq</em></td>
+<td>The OS event queue that the host should use to schedule host-related operations.</td>
</tr>
<tr>
<td><em>cfg</em></td>
@@ -523,26 +533,23 @@
</tr>
</tbody>
</table>
-<p><strong>prio</strong>:</p>
-<p>Unlike the controller, the host does not have any strict timing requirements.
-This number should be greater than the priority of any time-critical tasks in
-your application (remember, bigger number = lower priority!). There are no
-restrictions with regards to the host task's priority relative to its client
-tasks. In the below example, the host is assigned a priority of 1.</p>
+<p><strong>parent_evq</strong>:</p>
+<p>This is the event queue associated with the <a href="#ble_parent_ini">host parent task</a>.</p>
<p><strong>cfg</strong>:</p>
<p>As mentioned above, passing a <em>cfg</em> value of <em>NULL</em> will initialize the Nimble
host with the default configuration. This is convenient while familiarizing
yourself with the Nimble stack, but ultimately you will probably want to use a
custom configuration. For more information on configuring the host, see the
Nimble Configuration Guide (TBD).</p>
-<p>Continuing with our running example, we now add Nimble host initialization to the <em>main()</em> function. This application uses the default host configuration, so it specifies <em>NULL</em> as the second argument to <code>ble_hs_init()</code>.</p>
+<p>Continuing with our running example, we now add Nimble host initialization to
+the <em>main()</em> function. This application uses the default host configuration,
+so it specifies <em>NULL</em> as the second argument to <code>ble_hs_init()</code>.</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="background-color: #ffffcc"><span style="color: #633820">#include "host/ble_hs.h"</span>
</span>
<span style="color: #A90D91">int</span>
<span style="color: #000000">main</span>(<span style="color: #A90D91">void</span>)
{
<span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>;
- <span style="color: #A90D91">struct</span> <span style="color: #000000">ble_hs_cfg</span> <span style="color: #000000">cfg</span>;
<span style="color: #177500">/* Initialize OS */</span>
<span style="color: #000000">os_init</span>();
@@ -579,8 +586,13 @@ Nimble Configuration Guide (TBD).</p>
<span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">ble_ll_init</span>(<span style="color: #1C01CE">0</span>, <span style="color: #1C01CE">7</span>, <span style="color: #1C01CE">260</span>);
<span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
+ <span style="color: #177500">/* Initialize the application task. */</span>
+ <span style="color: #000000">os_eventq_init</span>(<span style="color: #000000">&app_evq</span>);
+ <span style="color: #000000">os_task_init</span>(<span style="color: #000000">&app_task</span>, <span style="color: #C41A16">"app"</span>, <span style="color: #000000">app_task_handler</span>, <span style="color: #A90D91">NULL</span>, <span style="color: #1C01CE">1</span>, <span style="color: #000000">OS_WAIT_FOREVER</span>,
+ <span style="color: #000000">app_stack</span>, <span style="color: #000000">APP_STACK_SIZE</span>);
+
<span style="background-color: #ffffcc"> <span style="color: #177500">/* Initialize the BLE host. */</span>
-</span><span style="background-color: #ffffcc"> <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">ble_hs_init</span>(<span style="color: #000000">BLE_HS_TASK_PRI</span>, <span style="color: #A90D91">NULL</span>);
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">ble_hs_init</span>(<span style="color: #000000">&app_evq</span>, <span style="color: #A90D91">NULL</span>);
</span><span style="background-color: #ffffcc"> <span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
</span>
<span style="color: #177500">/* Start the OS */</span>
@@ -602,9 +614,9 @@ Nimble Configuration Guide (TBD).</p>
<ul class="nav nav-pills" style="margin-bottom: 10px">
<li>
- <a href=../ble_controller_ini/>
+ <a href=../ble_parent_ini/>
<span class="fa fa-arrow-left"></span>
- Previous: Initialize controller
+ Previous: Initialize parent task
</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_ini_intro/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_ini_intro/index.html b/network/ble/ini_stack/ble_ini_intro/index.html
index 0a87f12..27ec1e1 100644
--- a/network/ble/ini_stack/ble_ini_intro/index.html
+++ b/network/ble/ini_stack/ble_ini_intro/index.html
@@ -357,6 +357,16 @@
<li>
+ <a href="../ble_parent_ini/">Initialize parent task</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../ble_host_ini/">Initialize host</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_mempool/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_mempool/index.html b/network/ble/ini_stack/ble_mempool/index.html
index ac12d7d..a92ba26 100644
--- a/network/ble/ini_stack/ble_mempool/index.html
+++ b/network/ble/ini_stack/ble_mempool/index.html
@@ -357,6 +357,16 @@
<li>
+ <a href="../ble_parent_ini/">Initialize parent task</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../ble_host_ini/">Initialize host</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_parent_ini/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_parent_ini/index.html b/network/ble/ini_stack/ble_parent_ini/index.html
new file mode 100644
index 0000000..51e053e
--- /dev/null
+++ b/network/ble/ini_stack/ble_parent_ini/index.html
@@ -0,0 +1,701 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+
+ <link rel="canonical" href="http://mynewt.apache.org/network/ble/ini_stack/ble_parent_ini/">
+ <link rel="shortcut icon" href="../../../../img/favicon.ico">
+
+ <title>Initialize parent task - Apache Mynewt</title>
+
+ <link href="../../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
+ <link href="../../../../css/font-awesome-4.0.3.css" rel="stylesheet">
+ <link rel="stylesheet" href="../../../../css/highlight.css">
+ <link href="../../../../css/base.css" rel="stylesheet">
+ <link href="../../../../css/custom.css" rel="stylesheet">
+ <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
+ <link href="../../../../extra.css" rel="stylesheet">
+
+ <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
+ <!--[if lt IE 9]>
+ <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
+ <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
+ <![endif]-->
+
+
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
+ ga('send', 'pageview');
+ </script>
+
+ </head>
+
+
+ <body class="Initialize parent task">
+
+
+ <div id="navbar" class="navbar navbar-default navbar-fixed-top" role="navigation">
+ <div class="logo-container">
+ <img src="/img/logo.svg">
+ </div>
+ <div class="container-fluid">
+ <!-- Collapsed navigation -->
+ <div class="navbar-header">
+ <!-- Expander button -->
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+
+ </div>
+
+ <!-- Expanded navigation -->
+ <div class="navbar-collapse collapse">
+ <!-- Main navigation -->
+ <ul class="nav navbar-nav navbar-right">
+ <li>
+ <a href="/">Home</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li class="dropdown">
+ <a href="/documentation/" class="dropdown-toggle" data-toggle="dropdown">Docs <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+
+
+
+
+
+
+ <li >
+ <a href="../../../../documentation/">
+ Overview
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="active">
+ <a href="../../../../os/get_started/introduction/">
+ Mynewt OS Manual
+ </a>
+ </li>
+
+
+
+ <li >
+ <a href="../../../../newt/newt_intro/">
+ Newt Tool Manual
+ </a>
+ </li>
+
+
+
+ <li >
+ <a href="../../../../newtmgr/overview/">
+ Newt Manager Manual
+ </a>
+ </li>
+
+
+
+ <li >
+ <a href="../../../../os/tutorials/how_to_edit_docs/">
+ Appendix
+ </a>
+ </li>
+
+
+ </ul>
+ </li>
+ <li>
+ <a href="/download/">Download</a>
+ </li>
+ <li>
+ <a href="/community/">Community</a>
+ </li>
+ <li>
+ <a href="/events/">Events</a>
+ </li>
+ </ul>
+
+ <!-- Search, Navigation and Repo links -->
+ <ul class="nav navbar-nav navbar-right">
+
+ </ul>
+ </div>
+ </div>
+</div>
+
+
+
+ <div class="container-fluid">
+
+ <div class="row sm-extra-padding">
+ <div id="docSidebar" class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
+ <div class="sidebar-top">
+ <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
+ <div class="small" role="search">
+ <form id ="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
+ <div class="form-group">
+ <input type="text" name="q" placeholder="Search documentation" />
+ <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
+ </div>
+ </form>
+ </div>
+ </div>
+ <ul class="nav bs-sidenav">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li><a href="
+ ../../../../os/get_started/introduction/
+">Mynewt OS Manual</a>
+
+
+ <ul class="current-toc">
+
+
+
+
+ <li>
+ <a href="../../../../os/get_started/introduction/">Introduction</a>
+ </li>
+
+
+
+
+
+
+
+
+ <li ><a href="../../../../os/get_started/get_started/">Quick Start</a></li>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li ><a href="../../../../os/get_started/vocabulary/">Concepts</a></li>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li ><a href="../../../../os/tutorials/tutorials/">Tutorials</a></li>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li ><a href="../../../../os/os_user_guide/">OS User Guide</a></li>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li><a href="
+ ../../ble_intro/
+">BLE User Guide</a>
+
+
+ <ul class="current-toc">
+
+
+
+
+ <li>
+ <a href="../../ble_intro/">NimBLE Introduction</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../../ble_sec/">NimBLE Security</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../../nimble_setup/">Set up application</a>
+ </li>
+
+
+
+
+
+
+
+
+ <li ><a href="../ble_ini_intro/">Initialize stack</a></li>
+
+
+ <ul class="current-toc">
+
+
+
+
+
+
+ <li>
+ <a href="../ble_add_cpu/">Add cputime</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../ble_mempool/">Create mem pool</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../ble_devadd/">Initialize device addr</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../ble_statpkg/">Initialize stats pkg</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../ble_consolepkg/">Initialize console pkg</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../ble_controller_ini/">Initialize controller</a>
+ </li>
+
+
+
+
+
+
+
+ <li class="active">
+ Initialize parent task
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../ble_host_ini/">Initialize host</a>
+ </li>
+
+
+
+
+ </ul>
+
+ </li>
+
+
+
+
+
+
+
+ <li ><a href="../../bletiny_api/">API for bletiny app</a></li>
+
+
+ </li>
+
+
+
+ </ul>
+
+ </li>
+
+
+
+ </ul>
+
+ </li>
+
+
+
+
+
+
+
+ <li><a href="
+ ../../../../newt/newt_intro/
+">Newt Tool Manual</a>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li><a href="
+ ../../../../newtmgr/overview/
+">Newt Manager Manual</a>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li><a href="
+ ../../../../os/tutorials/how_to_edit_docs/
+">Appendix</a>
+
+
+ </li>
+
+
+
+ </ul>
+</div></div>
+
+ <div class="show-sidebar-container">
+ <button class="show-sidebar">Docs Menu</button>
+ </div>
+
+ <div class="col-md-offset-3 col-md-9 documentation-viewer" role="main">
+ <div class="row doc-header">
+ <div class="col-sm-6">
+
+<ul class="nav nav-pills">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="active" role="presentation"><a href="../../../../os/get_started/introduction/">Mynewt OS</a></li>
+
+
+
+ <li role="presentation"><a href="../../../../newt/newt_intro/">Newt Tool</a></li>
+
+
+
+ <li role="presentation"><a href="../../../../newtmgr/overview/">Newt Mgr</a></li>
+
+
+
+
+</ul>
+ </div>
+ <div class="col-sm-6">
+ <div role="navigation" aria-label="breadcrumbs navigation">
+ <ul class="wy-breadcrumbs">
+ <li><a href="/documentation/">Docs</a></li>
+
+
+
+ <li>» <a href="../../ble_intro/">BLE User Guide</a></li>
+
+
+
+ <li>» <a href="../ble_ini_intro/">Initialize stack</a></li>
+
+
+
+ <li>» Initialize parent task</li>
+
+
+
+ </ul>
+</div>
+ </div>
+ </div>
+
+ <h2 id="create-the-host-parent-task">Create the host parent task<a class="headerlink" href="#create-the-host-parent-task" title="Permanent link">¶</a></h2>
+<p>The NimBLE stack requires an application task to function. One application
+task in particular is designated as the <em>host parent task</em>. In addition to
+application-specific work, the host parent task does work for NimBLE by
+processing events generated by the host.</p>
+<p>The process of creating an OS task is described in the <a href="#../../../../os/tutorials/event_queue/">Add Task
+tutorial</a>.</p>
+<p><strong>Priority:</strong>
+It is up to you which priority to use for the host parent task. Unlike the
+controller, the host does not have any strict timing requirements, so the
+priority should be based on the application's needs. In the below example, we
+use a priority of <strong>1</strong>.</p>
+<p><strong>Stack size:</strong>
+The host parent task's stack needs to be sufficiently large to handle BLE
+operations. This depends on the set of BLE features your application uses, and
+on the specifics application callbacks that the stack is configured to use. A
+safe value is to use here is <strong>300 words</strong>; that is the value used in the below
+example.</p>
+<p>The parent task must do two things:</p>
+<ul>
+<li>Call <code>ble_hs_start()</code> before starting its task loop.</li>
+<li>Handle <em>OS_EVENT_T_TIMER</em> events within its task loop.</li>
+</ul>
+<p>The <code>ble_hs_start()</code> function is declared as follows:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">ble_hs_start</span>(<span style="color: #A90D91">void</span>)
+</pre></div>
+
+
+<p>The <code>ble_hs_start()</code> function causes the host to send a sequence of HCI
+commands to the controller. This sequence of commands is necessary for the
+host and controller to remain in sync.</p>
+<p>We add an application task to our example below.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="background-color: #ffffcc"><span style="color: #633820">#include "os/os.h"</span>
+</span>
+<span style="background-color: #ffffcc"><span style="color: #177500">/** Application task. */</span>
+</span><span style="background-color: #ffffcc"><span style="color: #A90D91">static</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">os_task</span> <span style="color: #000000">app_task</span>;
+</span>
+<span style="background-color: #ffffcc"><span style="color: #177500">/** Application task event queue. */</span>
+</span><span style="background-color: #ffffcc"><span style="color: #A90D91">static</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">os_eventq</span> <span style="color: #000000">app_evq</span>;
+</span>
+<span style="background-color: #ffffcc"><span style="color: #177500">/** Application task stack. */</span>
+</span><span style="background-color: #ffffcc"><span style="color: #633820">#define APP_STACK_SIZE (OS_STACK_ALIGN(300))</span>
+</span><span style="background-color: #ffffcc"><span style="color: #A90D91">static</span> <span style="color: #A90D91">os_stack_t</span> <span style="color: #000000">app_stack</span>[<span style="color: #000000">APP_STACK_SIZE</span>];
+</span>
+<span style="background-color: #ffffcc"><span style="color: #177500">/**</span>
+</span><span style="background-color: #ffffcc"><span style="color: #177500"> * Application task.</span>
+</span><span style="background-color: #ffffcc"><span style="color: #177500"> */</span>
+</span><span style="background-color: #ffffcc"><span style="color: #A90D91">static</span> <span style="color: #A90D91">void</span>
+</span><span style="background-color: #ffffcc"><span style="color: #000000">app_task_handler</span>(<span style="color: #A90D91">void</span> <span style="color: #000000">*arg</span>)
+</span><span style="background-color: #ffffcc">{
+</span><span style="background-color: #ffffcc"> <span style="color: #A90D91">struct</span> <span style="color: #000000">os_callout_func</span> <span style="color: #000000">*cf</span>;
+</span><span style="background-color: #ffffcc"> <span style="color: #A90D91">struct</span> <span style="color: #000000">os_event</span> <span style="color: #000000">*ev</span>;
+</span><span style="background-color: #ffffcc"> <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>;
+</span>
+<span style="background-color: #ffffcc"> <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">ble_hs_start</span>();
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
+</span>
+<span style="background-color: #ffffcc"> <span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) {
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">ev</span> <span style="color: #000000">=</span> <span style="color: #000000">os_eventq_get</span>(<span style="color: #000000">&app_evq</span>);
+</span><span style="background-color: #ffffcc"> <span style="color: #A90D91">switch</span> (<span style="color: #000000">ev->ev_type</span>) {
+</span><span style="background-color: #ffffcc"> <span style="color: #A90D91">case</span> <span style="color: #000000">OS_EVENT_T_TIMER</span>:
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">cf</span> <span style="color: #000000">=</span> (<span style="color: #A90D91">struct</span> <span style="color: #000000">os_callout_func</span> <span style="color: #000000">*</span>)<span style="color: #000000">ev</span>;
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">assert</span>(<span style="color: #000000">cf->cf_func</span>);
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">cf->cf_func</span>(<span style="color: #000000">cf->cf_arg</span>);
+</span><span style="background-color: #ffffcc"> <span style="color: #A90D91">break</span>;
+</span><span style="background-color: #ffffcc"> <span style="color: #A90D91">default</span><span style="color: #000000">:</span>
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">assert</span>(<span style="color: #1C01CE">0</span>);
+</span><span style="background-color: #ffffcc"> <span style="color: #A90D91">break</span>;
+</span><span style="background-color: #ffffcc"> }
+</span><span style="background-color: #ffffcc"> }
+</span><span style="background-color: #ffffcc">}
+</span>
+<span style="color: #A90D91">int</span>
+<span style="color: #000000">main</span>(<span style="color: #A90D91">void</span>)
+{
+ <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>;
+
+ <span style="color: #177500">/* Initialize OS */</span>
+ <span style="color: #000000">os_init</span>();
+
+ <span style="color: #177500">/* Set cputime to count at 1 usec increments */</span>
+ <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">cputime_init</span>(<span style="color: #1C01CE">1000000</span>);
+ <span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
+
+ <span style="color: #177500">/* Create memory pool for Nimble packets and register with Msys */</span>
+ <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">os_mempool_init</span>(<span style="color: #000000">&g_mbuf_mempool</span>, <span style="color: #000000">MBUF_NUM_MBUFS</span>,
+ <span style="color: #000000">MBUF_MEMBLOCK_SIZE</span>, <span style="color: #000000">&g_mbuf_buffer</span>[<span style="color: #1C01CE">0</span>], <span style="color: #C41A16">"mbuf_pool"</span>);
+ <span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
+
+ <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">os_mbuf_pool_init</span>(<span style="color: #000000">&g_mbuf_pool</span>, <span style="color: #000000">&g_mbuf_mempool</span>, <span style="color: #000000">MBUF_MEMBLOCK_SIZE</span>,
+ <span style="color: #000000">MBUF_NUM_MBUFS</span>);
+ <span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
+
+ <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">os_msys_register</span>(<span style="color: #000000">&g_mbuf_pool</span>);
+ <span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
+
+ <span style="color: #177500">/* Initialize our device address */</span>
+ <span style="color: #000000">g_dev_addr</span>[<span style="color: #1C01CE">0</span>] <span style="color: #000000">=</span> <span style="color: #1C01CE">0x33</span>;
+ <span style="color: #000000">g_dev_addr</span>[<span style="color: #1C01CE">1</span>] <span style="color: #000000">=</span> <span style="color: #1C01CE">0x22</span>;
+ <span style="color: #000000">g_dev_addr</span>[<span style="color: #1C01CE">2</span>] <span style="color: #000000">=</span> <span style="color: #1C01CE">0x11</span>;
+ <span style="color: #000000">g_dev_addr</span>[<span style="color: #1C01CE">3</span>] <span style="color: #000000">=</span> <span style="color: #1C01CE">0xcc</span>;
+ <span style="color: #000000">g_dev_addr</span>[<span style="color: #1C01CE">4</span>] <span style="color: #000000">=</span> <span style="color: #1C01CE">0xbb</span>;
+ <span style="color: #000000">g_dev_addr</span>[<span style="color: #1C01CE">5</span>] <span style="color: #000000">=</span> <span style="color: #1C01CE">0x0a</span>;
+
+ <span style="color: #177500">/* Initialize the statistics package */</span>
+ <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">stats_module_init</span>();
+ <span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
+
+ <span style="color: #177500">/* Initialize the BLE LL */</span>
+ <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">ble_ll_init</span>(<span style="color: #1C01CE">0</span>, <span style="color: #1C01CE">7</span>, <span style="color: #1C01CE">260</span>);
+ <span style="color: #000000">assert</span>(<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>);
+
+<span style="background-color: #ffffcc"> <span style="color: #177500">/* Initialize the application task. */</span>
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">os_eventq_init</span>(<span style="color: #000000">&app_evq</span>);
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">os_task_init</span>(<span style="color: #000000">&app_task</span>, <span style="color: #C41A16">"app"</span>, <span style="color: #000000">app_task_handler</span>, <span style="color: #A90D91">NULL</span>, <span style="color: #1C01CE">1</span>, <span style="color: #000000">OS_WAIT_FOREVER</span>,
+</span><span style="background-color: #ffffcc"> <span style="color: #000000">app_stack</span>, <span style="color: #000000">APP_STACK_SIZE</span>);
+</span><span style="background-color: #ffffcc">
+</span> <span style="color: #177500">/* Start the OS */</span>
+ <span style="color: #000000">os_start</span>();
+
+ <span style="color: #177500">/* os start should never return. If it does, this should be an error */</span>
+ <span style="color: #000000">assert</span>(<span style="color: #1C01CE">0</span>);
+}
+</pre></div>
+
+ <div class="row">
+
+
+
+
+<ul class="nav nav-pills" style="margin-bottom: 10px">
+ <li>
+
+ <a href=../ble_controller_ini/>
+ <span class="fa fa-arrow-left"></span>
+ Previous: Initialize controller
+ </a>
+
+ </li>
+ <li class="pull-right">
+
+ <a href=../ble_host_ini/>
+ Next: Initialize host
+ <span class="fa fa-arrow-right"></span>
+ </a>
+
+ </li>
+</ul>
+ </div>
+ <div class="row">
+ <footer>
+ <div class="row">
+ <div class="col-md-12">
+
+ <p class="copyright">Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
+
+ </div>
+ </div>
+ <div class="copyright-logos">
+ <div class="row">
+ <div class="col-xs-6 text-right">
+ <img src="/img/apache-feather.png" alt="Apache" title="Apache">
+ </div>
+ <div class="col-xs-6 text-left">
+ <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12">
+ <small class="footnote">
+ MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
+ </small>
+ </div>
+ </div>
+</footer>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+ <script src="../../../../js/jquery-1.10.2.min.js"></script>
+ <script src="../../../../js/bootstrap-3.0.3.min.js"></script>
+ <script src="../../../../js/highlight.pack.js"></script>
+ <script src="../../../../js/base.js"></script>
+ <script src="../../../../js/custom.js"></script>
+
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/network/ble/ini_stack/ble_statpkg/index.html
----------------------------------------------------------------------
diff --git a/network/ble/ini_stack/ble_statpkg/index.html b/network/ble/ini_stack/ble_statpkg/index.html
index c9dc84f..c489956 100644
--- a/network/ble/ini_stack/ble_statpkg/index.html
+++ b/network/ble/ini_stack/ble_statpkg/index.html
@@ -357,6 +357,16 @@
<li>
+ <a href="../ble_parent_ini/">Initialize parent task</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../ble_host_ini/">Initialize host</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/STM32F303/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/STM32F303/index.html b/os/tutorials/STM32F303/index.html
index 68302d1..368a1cf 100644
--- a/os/tutorials/STM32F303/index.html
+++ b/os/tutorials/STM32F303/index.html
@@ -274,6 +274,16 @@
<li>
+ <a href="../blinky_sram_olimex/">Run Blinky from SRAM, no bootloader</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../add_repos/">Add repo to project</a>
</li>
@@ -304,7 +314,7 @@
<li>
- <a href="../bletiny_project/">BLE commands via console</a>
+ <a href="../bletiny_project/">Use BLE app to check stats via console</a>
</li>
@@ -620,7 +630,7 @@ targets/stmf3_boot
<p><br></p>
-<h3 id="build-the-images">Build the images<a class="headerlink" href="#build-the-images" title="Permanent link">¶</a></h3>
+<h3 id="build-the-target-executables">Build the target executables<a class="headerlink" href="#build-the-target-executables" title="Permanent link">¶</a></h3>
<p>To build the images, use the <code>newt build</code> command below.</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ newt build stmf3_blinky
...
@@ -637,7 +647,7 @@ App successfully built: ~/dev/myproj/bin/stmf3_boot/apps/boot/boot.elf
<p><br></p>
-<h3 id="create-an-application-image-from-the-binary">Create an application image from the binary<a class="headerlink" href="#create-an-application-image-from-the-binary" title="Permanent link">¶</a></h3>
+<h3 id="sign-and-create-the-blinky-application-image">Sign and create the blinky application image<a class="headerlink" href="#sign-and-create-the-blinky-application-image" title="Permanent link">¶</a></h3>
<p>You must sign and version your application image to download it using newt. Use
the <code>newt create-image</code> command to perform this action. Here we assign this
image an arbitrary version <code>1.2.3</code>.</p>
@@ -663,9 +673,10 @@ $ newt -v load stmf3_blinky
<p><br></p>
<h3 id="watch-the-led-blink">Watch the LED blink<a class="headerlink" href="#watch-the-led-blink" title="Permanent link">¶</a></h3>
-<p>Congratulations! You have built, downloaded, and run your first application using mynewt for the
-stf32f3 discovery board. One of the LEDs on the LED wheel should be blinking
-at 1 Hz.</p>
+<p>Congratulations! You have built, downloaded, and run your first application using mynewt for the stm32f3 discovery board. One of the LEDs on the LED wheel should be blinking at 1 Hz.</p>
+<p>We have more fun tutorials for you to get your hands dirty. Be bold and try other Blinky-like <a href="../nRF52/">tutorials</a> or try enabling additional functionality such as <a href="../project-target-slinky/">remote comms</a> on the current board.</p>
+<p>If you see anything missing or want to send us feedback, please do so by signing up for appropriate mailing lists on our <a href="../../../community/">Community Page</a>.</p>
+<p>Keep on hacking and blinking!</p>
<div class="row">
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/add_repos/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/add_repos/index.html b/os/tutorials/add_repos/index.html
index 6cfc554..4cc331e 100644
--- a/os/tutorials/add_repos/index.html
+++ b/os/tutorials/add_repos/index.html
@@ -273,6 +273,16 @@
+ <li>
+ <a href="../blinky_sram_olimex/">Run Blinky from SRAM, no bootloader</a>
+ </li>
+
+
+
+
+
+
+
<li class="active">
Add repo to project
</li>
@@ -304,7 +314,7 @@
<li>
- <a href="../bletiny_project/">BLE commands via console</a>
+ <a href="../bletiny_project/">Use BLE app to check stats via console</a>
</li>
@@ -760,9 +770,9 @@ should give you all the information to add it to your <code>project.yml</code> f
<ul class="nav nav-pills" style="margin-bottom: 10px">
<li>
- <a href=../nRF52/>
+ <a href=../blinky_sram_olimex/>
<span class="fa fa-arrow-left"></span>
- Previous: Blinky on nRF52
+ Previous: Run Blinky from SRAM, no bootloader
</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/air_quality_sensor/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/air_quality_sensor/index.html b/os/tutorials/air_quality_sensor/index.html
index 1682034..e1b9049 100644
--- a/os/tutorials/air_quality_sensor/index.html
+++ b/os/tutorials/air_quality_sensor/index.html
@@ -274,6 +274,16 @@
<li>
+ <a href="../blinky_sram_olimex/">Run Blinky from SRAM, no bootloader</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../add_repos/">Add repo to project</a>
</li>
@@ -304,7 +314,7 @@
<li>
- <a href="../bletiny_project/">BLE commands via console</a>
+ <a href="../bletiny_project/">Use BLE app to check stats via console</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/arduino_zero/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/arduino_zero/index.html b/os/tutorials/arduino_zero/index.html
index 8e405a4..2be2df4 100644
--- a/os/tutorials/arduino_zero/index.html
+++ b/os/tutorials/arduino_zero/index.html
@@ -274,6 +274,16 @@
<li>
+ <a href="../blinky_sram_olimex/">Run Blinky from SRAM, no bootloader</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../add_repos/">Add repo to project</a>
</li>
@@ -304,7 +314,7 @@
<li>
- <a href="../bletiny_project/">BLE commands via console</a>
+ <a href="../bletiny_project/">Use BLE app to check stats via console</a>
</li>
@@ -750,6 +760,9 @@ debugger and restart the board. The image you programmed will come and run on t
<h3 id="watch-the-led-blink">Watch the LED blink<a class="headerlink" href="#watch-the-led-blink" title="Permanent link">¶</a></h3>
<p>Congratulations! You have created a Mynewt operating system running on the
Arduino Zero. The LED right next to the power LED should be blinking. It is toggled by one task running on the Mynewt OS. </p>
+<p>We have more fun tutorials for you to get your hands dirty. Be bold and try other Blinky-like <a href="../nRF52/">tutorials</a> or try enabling additional functionality such as <a href="../project-target-slinky/">remote comms</a> on the current board.</p>
+<p>If you see anything missing or want to send us feedback, please do so by signing up for appropriate mailing lists on our <a href="../../../community/">Community Page</a>.</p>
+<p>Keep on hacking and blinking!</p>
<div class="row">
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/bletiny_project/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/bletiny_project/index.html b/os/tutorials/bletiny_project/index.html
index d852d68..34f3e9e 100644
--- a/os/tutorials/bletiny_project/index.html
+++ b/os/tutorials/bletiny_project/index.html
@@ -9,7 +9,7 @@
<link rel="canonical" href="http://mynewt.apache.org/os/tutorials/bletiny_project/">
<link rel="shortcut icon" href="../../../img/favicon.ico">
- <title>BLE commands via console - Apache Mynewt</title>
+ <title>Use BLE app to check stats via console - Apache Mynewt</title>
<link href="../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
<link href="../../../css/font-awesome-4.0.3.css" rel="stylesheet">
@@ -40,7 +40,7 @@
</head>
- <body class="BLE commands via console">
+ <body class="Use BLE app to check stats via console">
<div id="navbar" class="navbar navbar-default navbar-fixed-top" role="navigation">
@@ -274,6 +274,16 @@
<li>
+ <a href="../blinky_sram_olimex/">Run Blinky from SRAM, no bootloader</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../add_repos/">Add repo to project</a>
</li>
@@ -304,7 +314,7 @@
<li class="active">
- BLE commands via console
+ Use BLE app to check stats via console
</li>
@@ -493,7 +503,7 @@
- <li>» BLE commands via console</li>
+ <li>» Use BLE app to check stats via console</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/blinky_sram_olimex/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/blinky_sram_olimex/index.html b/os/tutorials/blinky_sram_olimex/index.html
new file mode 100644
index 0000000..e656517
--- /dev/null
+++ b/os/tutorials/blinky_sram_olimex/index.html
@@ -0,0 +1,728 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+
+ <link rel="canonical" href="http://mynewt.apache.org/os/tutorials/blinky_sram_olimex/">
+ <link rel="shortcut icon" href="../../../img/favicon.ico">
+
+ <title>Run Blinky from SRAM, no bootloader - Apache Mynewt</title>
+
+ <link href="../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
+ <link href="../../../css/font-awesome-4.0.3.css" rel="stylesheet">
+ <link rel="stylesheet" href="../../../css/highlight.css">
+ <link href="../../../css/base.css" rel="stylesheet">
+ <link href="../../../css/custom.css" rel="stylesheet">
+ <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
+ <link href="../../../extra.css" rel="stylesheet">
+
+ <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
+ <!--[if lt IE 9]>
+ <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
+ <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
+ <![endif]-->
+
+
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
+ ga('send', 'pageview');
+ </script>
+
+ </head>
+
+
+ <body class="Run Blinky from SRAM, no bootloader">
+
+
+ <div id="navbar" class="navbar navbar-default navbar-fixed-top" role="navigation">
+ <div class="logo-container">
+ <img src="/img/logo.svg">
+ </div>
+ <div class="container-fluid">
+ <!-- Collapsed navigation -->
+ <div class="navbar-header">
+ <!-- Expander button -->
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+
+ </div>
+
+ <!-- Expanded navigation -->
+ <div class="navbar-collapse collapse">
+ <!-- Main navigation -->
+ <ul class="nav navbar-nav navbar-right">
+ <li>
+ <a href="/">Home</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li class="dropdown">
+ <a href="/documentation/" class="dropdown-toggle" data-toggle="dropdown">Docs <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+
+
+
+
+
+
+ <li >
+ <a href="../../../documentation/">
+ Overview
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="active">
+ <a href="../../get_started/introduction/">
+ Mynewt OS Manual
+ </a>
+ </li>
+
+
+
+ <li >
+ <a href="../../../newt/newt_intro/">
+ Newt Tool Manual
+ </a>
+ </li>
+
+
+
+ <li >
+ <a href="../../../newtmgr/overview/">
+ Newt Manager Manual
+ </a>
+ </li>
+
+
+
+ <li >
+ <a href="../how_to_edit_docs/">
+ Appendix
+ </a>
+ </li>
+
+
+ </ul>
+ </li>
+ <li>
+ <a href="/download/">Download</a>
+ </li>
+ <li>
+ <a href="/community/">Community</a>
+ </li>
+ <li>
+ <a href="/events/">Events</a>
+ </li>
+ </ul>
+
+ <!-- Search, Navigation and Repo links -->
+ <ul class="nav navbar-nav navbar-right">
+
+ </ul>
+ </div>
+ </div>
+</div>
+
+
+
+ <div class="container-fluid">
+
+ <div class="row sm-extra-padding">
+ <div id="docSidebar" class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
+ <div class="sidebar-top">
+ <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
+ <div class="small" role="search">
+ <form id ="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
+ <div class="form-group">
+ <input type="text" name="q" placeholder="Search documentation" />
+ <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
+ </div>
+ </form>
+ </div>
+ </div>
+ <ul class="nav bs-sidenav">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li><a href="
+ ../../get_started/introduction/
+">Mynewt OS Manual</a>
+
+
+ <ul class="current-toc">
+
+
+
+
+ <li>
+ <a href="../../get_started/introduction/">Introduction</a>
+ </li>
+
+
+
+
+
+
+
+
+ <li ><a href="../../get_started/get_started/">Quick Start</a></li>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li ><a href="../../get_started/vocabulary/">Concepts</a></li>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li ><a href="../tutorials/">Tutorials</a></li>
+
+
+ <ul class="current-toc">
+
+
+
+
+
+
+ <li>
+ <a href="../arduino_zero/">Blinky on Arduino Zero</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../olimex/">Blinky on Olimex</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../STM32F303/">Blinky on STM32F303</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../nRF52/">Blinky on nRF52</a>
+ </li>
+
+
+
+
+
+
+
+ <li class="active">
+ Run Blinky from SRAM, no bootloader
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../add_repos/">Add repo to project</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../create_repo/">Create a repo</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../upgrade_repo/">Upgrade a repo</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../bletiny_project/">Use BLE app to check stats via console</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../project-slinky/">Enable remote comms on sim device</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../project-target-slinky/">Enable remote comms on STM32 board</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../unit_test/">Write a Test Suite for a Package</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../air_quality_sensor/">Air-quality Sensor project</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
+ <a href="../event_queue/">Add task to manage multiple events</a>
+ </li>
+
+
+
+
+ </ul>
+
+ </li>
+
+
+
+
+
+
+
+ <li ><a href="../../os_user_guide/">OS User Guide</a></li>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li><a href="
+ ../../../network/ble/ble_intro/
+">BLE User Guide</a>
+
+
+ </li>
+
+
+
+ </ul>
+
+ </li>
+
+
+
+
+
+
+
+ <li><a href="
+ ../../../newt/newt_intro/
+">Newt Tool Manual</a>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li><a href="
+ ../../../newtmgr/overview/
+">Newt Manager Manual</a>
+
+
+ </li>
+
+
+
+
+
+
+
+ <li><a href="
+ ../how_to_edit_docs/
+">Appendix</a>
+
+
+ </li>
+
+
+
+ </ul>
+</div></div>
+
+ <div class="show-sidebar-container">
+ <button class="show-sidebar">Docs Menu</button>
+ </div>
+
+ <div class="col-md-offset-3 col-md-9 documentation-viewer" role="main">
+ <div class="row doc-header">
+ <div class="col-sm-6">
+
+<ul class="nav nav-pills">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="active" role="presentation"><a href="../../get_started/introduction/">Mynewt OS</a></li>
+
+
+
+ <li role="presentation"><a href="../../../newt/newt_intro/">Newt Tool</a></li>
+
+
+
+ <li role="presentation"><a href="../../../newtmgr/overview/">Newt Mgr</a></li>
+
+
+
+
+</ul>
+ </div>
+ <div class="col-sm-6">
+ <div role="navigation" aria-label="breadcrumbs navigation">
+ <ul class="wy-breadcrumbs">
+ <li><a href="/documentation/">Docs</a></li>
+
+
+
+ <li>» <a href="../../get_started/introduction/">Mynewt OS Manual</a></li>
+
+
+
+ <li>» <a href="../tutorials/">Tutorials</a></li>
+
+
+
+ <li>» Run Blinky from SRAM, no bootloader</li>
+
+
+
+ </ul>
+</div>
+ </div>
+ </div>
+
+ <h2 id="run-blinky-from-sram-without-bootloader">Run Blinky from SRAM without bootloader<a class="headerlink" href="#run-blinky-from-sram-without-bootloader" title="Permanent link">¶</a></h2>
+<h3 id="objective">Objective<a class="headerlink" href="#objective" title="Permanent link">¶</a></h3>
+<p>To download an application image directly into the embedded SRAM in the microcontroller and run it without the bootloader. This tutorial describes how you do it on an Olimex STM32 board.</p>
+<h3 id="what-you-need">What you need<a class="headerlink" href="#what-you-need" title="Permanent link">¶</a></h3>
+<ol>
+<li>STM32-E407 development board from Olimex. You can order it from <a href="http://www.mouser.com/ProductDetail/Olimex-Ltd/STM32-E407/?qs=UN6GZl1KCcit6Ye0xmPO4A%3D%3D">http://www.mouser.com</a>, <a href="http://www.digikey.com/product-detail/en/STM32-E407/1188-1093-ND/3726951">http://www.digikey.com</a>, and other places.</li>
+<li>ARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)</li>
+<li>USB A-B type cable to connect the debugger to your personal computer</li>
+<li>Personal Computer with Mac OS (Mac: OS X Yosemite Version 10.10.5) or Linux box (Ubuntu 14.10: Utopic Unicorn)</li>
+<li>An account on Github repository and <em>git</em> installed on your computer.</li>
+<li>It is assumed you have already installed newt tool. </li>
+<li>It is assumed you already installed native tools as described <a href="../../get_started/native_tools/">here</a></li>
+</ol>
+<p>Also, we assume that you're familiar with UNIX shells. Let's gets started!</p>
+<p><br></p>
+<h3 id="prepare-the-software">Prepare the Software<a class="headerlink" href="#prepare-the-software" title="Permanent link">¶</a></h3>
+<ul>
+<li>Make sure the PATH environment variable includes the $HOME/dev/go/bin directory. </li>
+</ul>
+<p><br></p>
+<h3 id="create-a-project">Create a project<a class="headerlink" href="#create-a-project" title="Permanent link">¶</a></h3>
+<p>Create a new project to hold your work. For a deeper understanding, you can read about project creation in
+<a href="../../get_started/project_create/">Get Started -- Creating Your First Project</a>
+or just follow the commands below.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> $ mkdir ~/dev
+ $ cd ~/dev
+ $ newt new myproj
+ Downloading project skeleton from apache/incubator-mynewt-blinky...
+ Installing skeleton in myproj...
+ Project myproj successfully created.
+
+ $cd myproj
+
+ $ newt install -v
+ apache-mynewt-core
+ Downloading repository description for apache-mynewt-core... success!
+ ...
+ apache-mynewt-core successfully installed version 0.7.9-none
+</pre></div>
+
+
+<p><br></p>
+<h3 id="create-a-target">Create a target<a class="headerlink" href="#create-a-target" title="Permanent link">¶</a></h3>
+<p>Change directory to ~/dev/myproj directory and define the <em>blinky</em> target inside myproj, using the <em>newt</em> tool. Starting with the target name, assign specific aspects of the project, as shown below, to pull the appropriate packages and build the right bundle or list for the board. For example, we set the build_profile, board support package (bsp), and app.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> $ newt target create blinky
+ $ newt target set blinky build_profile=debug
+ $ newt target set blinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard
+ $ newt target set blinky app=apps/blinky
+ $ newt target show blinky
+ targets/blinky
+ app=apps/blinky
+ bsp=hw/bsp/olimex_stm32-e407_devboard
+ build_profile=debug
+</pre></div>
+
+
+<p><br></p>
+<h3 id="build-the-image">Build the image<a class="headerlink" href="#build-the-image" title="Permanent link">¶</a></h3>
+<p>Next, let's build the image for the above target. By default, the linker script within the <code>hw/bsp/olimex_stm32-e407_devboard</code> package builds an image for flash memory, which we don't want; instead, we want an image for the SRAM, so you need to switch that script with <code>run_from_sram.ld</code>. </p>
+<p>Afer you build the target, you can find the executable <em>blinky.elf</em> in the project directory <em>~/dev/myproj/bin/blinky/apps/blinky/.</em> </p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> $ cd ~/dev/myproj/repos/apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard/
+ $ diff olimex_stm32-e407_devboard.ld run_from_sram.ld
+ (some diff will be displayed)
+ $ cp run_from_sram.ld olimex_stm32-e407_devboard.ld
+ $ cd ~/dev/myproj
+ $ newt build blinky
+ Compiling case.c
+ Compiling suite.c
+ ...
+ Linking blinky.elf
+ App successfully built:~/dev/myproj/bin/blinky/apps/blinky/blinky.elf
+ $ ls ~/dev/myproj/bin/blinky/apps/blinky/
+ blinky.elf blinky.elf.bin blinky.elf.cmd
+ blinky.elf.lst blinky.elf.map
+</pre></div>
+
+
+<p><br></p>
+<h3 id="prepare-the-hardware-to-boot-from-embedded-sram">Prepare the hardware to boot from embedded SRAM<a class="headerlink" href="#prepare-the-hardware-to-boot-from-embedded-sram" title="Permanent link">¶</a></h3>
+<ul>
+<li>Locate the boot jumpers on the board.</li>
+</ul>
+<p><br></p>
+<p><img alt="Alt Layout - Top View" src="../pics/topview.png" />
+<img alt="Alt Layout - Bottom View" src="../pics/bottomview.png" /></p>
+<p><br></p>
+<ul>
+<li>
+<p>B1_1/B1_0 and B0_1/B0_0 are PTH jumpers. Note that because the markings on the board may not always be accurate, when in doubt, you should always refer to the manual for the correct positioning. Since the jumpers are a pair, they should move together, and as such, the pair is responsible for the boot mode when bootloader is present.
+To locate the bootloader, the board searches in three places: User Flash Memory, System Memory or the Embedded SRAM. For this Blinky project, we will configure it to boot from SRAM by jumpering <strong>B0_1</strong> and <strong>B1_1</strong>.</p>
+</li>
+<li>
+<p>Connect USB-OTG#2 in the picture above to a USB port on your computer (or a powered USB hub to make sure there is enough power available to the board). </p>
+</li>
+<li>
+<p>The red PWR LED should be lit. </p>
+</li>
+<li>
+<p>Connect the JTAG connector to the SWD/JTAG interface on the board. The other end of the cable should be connected to the USB port or hub of your computer.</p>
+</li>
+</ul>
+<p><br></p>
+<h3 id="lets-go">Let's Go!<a class="headerlink" href="#lets-go" title="Permanent link">¶</a></h3>
+<ul>
+<li>Ensure that you are in the blinky project directory with the <em>blinky.elf</em> executable. Run the debug command in the <em>newt</em> tool. You'll see some status messages as shown below. In case you need to halt the debugging session, you can issue an <code>-c "reset halt"</code> command.</li>
+</ul>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> $ newt debug blinky
+ Debugging with ~/dev/core/hw/bsp/olimex_...
+ Debugging ~/dev/core/project/blinky/bin/blinky/blinky.elf
+ GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
+ Copyright (C) 2014 Free Software Foundation, Inc.
+ License GPLv3+: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>
+ ...
+ (info)
+ ...
+ target state: halted
+ target halted due to debug-request, current mode: Thread
+ xPSR: 0x01000000 pc: 0x080003c0 msp: 0x10010000
+ Info : accepting 'gdb' connection on tcp/3333
+ Info : device id = 0x10036413
+ Info : flash size = 1024kbytes
+</pre></div>
+
+
+<p><br></p>
+<p>Check the value of the msp (main service pointer) register. If it is not 0x10010000 as indicated above, you will have to manually set it after you open the gdb tool and load the image on it. For example, </p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> (gdb) set $msp=0x10010000
+</pre></div>
+
+
+<p><br></p>
+<p>Now load the image and type "c" or "continue" from the GNU debugger. </p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> (gdb) load ~/dev/myproj/bin/blinky/apps/blinky/blinky.elf
+ Loading section .text, size 0x16b88 lma 0x20000000
+ Loading section .ARM.exidx, size 0x18 lma 0x20016b88
+ Loading section .data, size 0x9ec lma 0x20016ba0
+ Start address 0x200004b8, load size 95628
+ Transfer rate: 74 KB/sec, 3825 bytes/write.
+ (gdb) c
+ Continuing.
+</pre></div>
+
+
+<ul>
+<li>VoilĂ ! The board's LED should be blinking at 1 Hz. Success!</li>
+</ul>
+<p><br></p>
+
+ <div class="row">
+
+
+
+
+<ul class="nav nav-pills" style="margin-bottom: 10px">
+ <li>
+
+ <a href=../nRF52/>
+ <span class="fa fa-arrow-left"></span>
+ Previous: Blinky on nRF52
+ </a>
+
+ </li>
+ <li class="pull-right">
+
+ <a href=../add_repos/>
+ Next: Add repo to project
+ <span class="fa fa-arrow-right"></span>
+ </a>
+
+ </li>
+</ul>
+ </div>
+ <div class="row">
+ <footer>
+ <div class="row">
+ <div class="col-md-12">
+
+ <p class="copyright">Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
+
+ </div>
+ </div>
+ <div class="copyright-logos">
+ <div class="row">
+ <div class="col-xs-6 text-right">
+ <img src="/img/apache-feather.png" alt="Apache" title="Apache">
+ </div>
+ <div class="col-xs-6 text-left">
+ <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12">
+ <small class="footnote">
+ MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
+ </small>
+ </div>
+ </div>
+</footer>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+ <script src="../../../js/jquery-1.10.2.min.js"></script>
+ <script src="../../../js/bootstrap-3.0.3.min.js"></script>
+ <script src="../../../js/highlight.pack.js"></script>
+ <script src="../../../js/base.js"></script>
+ <script src="../../../js/custom.js"></script>
+
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/create_repo/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/create_repo/index.html b/os/tutorials/create_repo/index.html
index 724135a..f938329 100644
--- a/os/tutorials/create_repo/index.html
+++ b/os/tutorials/create_repo/index.html
@@ -274,6 +274,16 @@
<li>
+ <a href="../blinky_sram_olimex/">Run Blinky from SRAM, no bootloader</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../add_repos/">Add repo to project</a>
</li>
@@ -304,7 +314,7 @@
<li>
- <a href="../bletiny_project/">BLE commands via console</a>
+ <a href="../bletiny_project/">Use BLE app to check stats via console</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/event_queue/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/event_queue/index.html b/os/tutorials/event_queue/index.html
index 9736092..ee707dc 100644
--- a/os/tutorials/event_queue/index.html
+++ b/os/tutorials/event_queue/index.html
@@ -274,6 +274,16 @@
<li>
+ <a href="../blinky_sram_olimex/">Run Blinky from SRAM, no bootloader</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../add_repos/">Add repo to project</a>
</li>
@@ -304,7 +314,7 @@
<li>
- <a href="../bletiny_project/">BLE commands via console</a>
+ <a href="../bletiny_project/">Use BLE app to check stats via console</a>
</li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e5bb88f8/os/tutorials/nRF52/index.html
----------------------------------------------------------------------
diff --git a/os/tutorials/nRF52/index.html b/os/tutorials/nRF52/index.html
index 1d711ee..3cfa900 100644
--- a/os/tutorials/nRF52/index.html
+++ b/os/tutorials/nRF52/index.html
@@ -274,6 +274,16 @@
<li>
+ <a href="../blinky_sram_olimex/">Run Blinky from SRAM, no bootloader</a>
+ </li>
+
+
+
+
+
+
+
+ <li>
<a href="../add_repos/">Add repo to project</a>
</li>
@@ -304,7 +314,7 @@
<li>
- <a href="../bletiny_project/">BLE commands via console</a>
+ <a href="../bletiny_project/">Use BLE app to check stats via console</a>
</li>
@@ -507,16 +517,25 @@
<h3 id="objective">Objective<a class="headerlink" href="#objective" title="Permanent link">¶</a></h3>
<p>Learn how to use packages from a default application repository of Mynewt to build your first <em>Hello World</em> application (Blinky) on a target board. Once built using the <em>newt</em> tool, this application will blink the LED lights on the target board.</p>
<p>Create a project with a simple app that blinks an LED on the nRF52 board from Nordic Semiconductors. Download the application to the target and watch it blink!</p>
-<h4 id="hardware-needed">Hardware needed<a class="headerlink" href="#hardware-needed" title="Permanent link">¶</a></h4>
+<p>Note that there are several versions of the nRF52 in the market. The boards tested with this tutorial are listed under "Hardware needed" below.</p>
+<p><br></p>
+<h3 id="hardware-needed">Hardware needed<a class="headerlink" href="#hardware-needed" title="Permanent link">¶</a></h3>
<ul>
-<li>nRF52 Development Kit</li>
+<li>nRF52 Development Kit (one of the following)<ul>
+<li>Preview Kit from Nordic - PCA 10036</li>
+<li>Dev Kit from Nordic - PCA 10040</li>
+<li>Eval Kit from Rigado - BMD-300-EVAL-ES</li>
+</ul>
+</li>
<li>Laptop running Mac OS</li>
<li>It is assumed you have already installed newt tool. </li>
<li>It is assumed you already installed native tools as described <a href="../../get_started/native_tools/">here</a></li>
</ul>
-<h4 id="install-jlinkexe">Install jlinkEXE<a class="headerlink" href="#install-jlinkexe" title="Permanent link">¶</a></h4>
+<p><br></p>
+<h3 id="install-jlinkexe">Install jlinkEXE<a class="headerlink" href="#install-jlinkexe" title="Permanent link">¶</a></h3>
<p>In order to be able to communicate with the SEGGER J-Link debugger on the dev board, you have to download and install the J-Link GDB Server software on to your laptop. You may download the "Software and documentation pack for Mac OS X" from <a href="https://www.segger.com/jlink-software.html">https://www.segger.com/jlink-software.html</a>. </p>
-<h4 id="create-a-project">Create a project.<a class="headerlink" href="#create-a-project" title="Permanent link">¶</a></h4>
+<p><br></p>
+<h3 id="create-a-project">Create a project.<a class="headerlink" href="#create-a-project" title="Permanent link">¶</a></h3>
<p>Create a new project to hold your work. For a deeper understanding, you can read about project creation in
<a href="../../get_started/project_create/">Get Started -- Creating Your First Project</a>
or just follow the commands below.</p>
@@ -537,23 +556,49 @@ or just follow the commands below.</p>
</pre></div>
-<h4 id="create-the-target">Create the target<a class="headerlink" href="#create-the-target" title="Permanent link">¶</a></h4>
-<p>Create a single target for the nrf52. NOTE: The nrf52 mynewt core does not
-yet have bootloader support, so we will create a single image to download
-to the device.</p>
+<p><br></p>
+<h3 id="create-the-targets">Create the targets<a class="headerlink" href="#create-the-targets" title="Permanent link">¶</a></h3>
+<p>Create two targets - one for the bootloader and one for the nrf52 board. </p>
+<p><font color="#F2853F">
+Note: The correct bsp must be chosen for the board you are using. </font></p>
+<ul>
+<li>For the Nordic Preview Dev Kit choose @apache-mynewt-core/hw/bsp/nrf52pdk (as shown below)</li>
+<li>For the Nordic Dev Kit choose @apache-mynewt-core/hw/bsp/nrf52dk instead (in the highlighted lines)</li>
+<li>For the Rigado Eval Kit choose @apache-mynewt-core/hw/bsp/bmd300eval instead (in the highlighted lines)</li>
+</ul>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ newt target create blink_nordic
$ newt target set blink_nordic app=apps/blinky
-$ newt target set blink_nordic bsp=@apache-mynewt-core/hw/bsp/nrf52pdk
-$ newt target set blink_nordic build_profile=debug
+<span style="background-color: #ffffcc">$ newt target set blink_nordic bsp=@apache-mynewt-core/hw/bsp/nrf52pdk
+</span>$ newt target set blink_nordic build_profile=debug
+
+$ newt target create nrf52_boot
+$ newt target set nrf52_boot app=@apache-mynewt-core/apps/boot
+<span style="background-color: #ffffcc">$ newt target set nrf52_boot bsp=@apache-mynewt-core/hw/bsp/nrf52pdk
+</span>$ newt target set nrf52_boot build_profile=optimized
+
$ newt target show
targets/blink_nordic
app=apps/blinky
bsp=@apache-mynewt-core/hw/bsp/nrf52pdk
build_profile=debug
+targets/nrf52_boot
+ app=@apache-mynewt-core/apps/boot
+ bsp=@apache-mynewt-core/hw/bsp/nrf52pdk
+ build_profile=optimized
+</pre></div>
+
+
+<p><br></p>
+<h3 id="build-the-target-executables">Build the target executables<a class="headerlink" href="#build-the-target-executables" title="Permanent link">¶</a></h3>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ newt build nrf52_boot
+...
+Compiling log_shell.c
+Archiving log.a
+Linking boot.elf
+App successfully built: ~/dev/myproj/bin/nrf52_boot/apps/boot/boot.elf
</pre></div>
-<h4 id="build-the-image">Build the image<a class="headerlink" href="#build-the-image" title="Permanent link">¶</a></h4>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ newt build blink_nordic
...
Compiling main.c
@@ -563,17 +608,59 @@ App successfully built: ~/dev/myproj/bin/blink_nordic/apps/blinky/blinky.elf
</pre></div>
-<h4 id="connect-the-board">Connect the board<a class="headerlink" href="#connect-the-board" title="Permanent link">¶</a></h4>
+<p><br></p>
+<h3 id="sign-and-create-the-blinky-application-image">Sign and create the blinky application image<a class="headerlink" href="#sign-and-create-the-blinky-application-image" title="Permanent link">¶</a></h3>
+<p>You must sign and version your application image to download it using newt to the board. Use the newt create-image command to perform this action. You may assign an arbitrary version (e.g. 1.0.0) to the image.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ newt create-image blink_nordic 1.0.0
+App image succesfully generated: ~/dev/myproj/bin/blink_nordic/apps/blinky/blinky.img
+Build manifest: ~/dev/myproj/bin/blink_nordic/apps/blinky/manifest.json
+</pre></div>
+
+
+<p><br></p>
+<h3 id="connect-the-board">Connect the board<a class="headerlink" href="#connect-the-board" title="Permanent link">¶</a></h3>
<p>Connect the evaluation board via micro-USB to your PC via USB cable.</p>
-<h4 id="download-to-the-target">Download to the target<a class="headerlink" href="#download-to-the-target" title="Permanent link">¶</a></h4>
-<p>Download the executable to the target platform.</p>
-<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ newt -v load blink_nordic
+<p><br></p>
+<h3 id="download-to-the-target">Download to the target<a class="headerlink" href="#download-to-the-target" title="Permanent link">¶</a></h3>
+<p>Download the bootloader first and then the blinky executable to the target platform. Don't forget to reset the board if you don't see the LED blinking right away!</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ newt -v load nrf52_boot
+$ newt -v load blink_nordic
+</pre></div>
+
+
+<p><br></p>
+<p><strong>Note:</strong> If you want to erase the flash and load the image again, you can use JLinkExe to issue an <code>erase</code> command.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ JLinkExe -device nRF52 -speed 4000 -if SWD
+SEGGER J-Link Commander V5.12c (Compiled Apr 21 2016 16:05:51)
+DLL version V5.12c, compiled Apr 21 2016 16:05:45
+
+Connecting to J-Link via USB...O.K.
+Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 15 2016 18:03:17
+Hardware version: V1.00
+S/N: 682863966
+VTref = 3.300V
+
+
+Type "connect" to establish a target connection, '?' for help
+J-Link>erase
+Cortex-M4 identified.
+Erasing device (0;?i?)...
+Comparing flash [100%] Done.
+Erasing flash [100%] Done.
+Verifying flash [100%] Done.
+J-Link: Flash download: Total time needed: 0.363s (Prepare: 0.093s, Compare: 0.000s, Erase: 0.262s, Program: 0.000s, Verify: 0.000s, Restore: 0.008s)
+Erasing done.
+J-Link>exit
+$
</pre></div>
-<h4 id="congratulations">Congratulations<a class="headerlink" href="#congratulations" title="Permanent link">¶</a></h4>
+<h3 id="conclusion">Conclusion<a class="headerlink" href="#conclusion" title="Permanent link">¶</a></h3>
<p>You have created, setup, compiled, loaded, and ran your first mynewt application
-for the nrf52 evaluation board.</p>
+for an nrf52 board.</p>
+<p>We have more fun tutorials for you to get your hands dirty. Be bold and work on the OS with tutorials on <a href="../unit_test/">writing a test suite</a> or try enabling additional functionality such as <a href="../project-target-slinky/">remote comms</a> or <a href="../bletiny_project/">Bluetooth Low Energy</a> on your current board.</p>
+<p>If you see anything missing or want to send us feedback, please do so by signing up for appropriate mailing lists on our <a href="../../../community/">Community Page</a>.</p>
+<p>Keep on hacking and blinking!</p>
<div class="row">
@@ -591,8 +678,8 @@ for the nrf52 evaluation board.</p>
</li>
<li class="pull-right">
- <a href=../add_repos/>
- Next: Add repo to project
+ <a href=../blinky_sram_olimex/>
+ Next: Run Blinky from SRAM, no bootloader
<span class="fa fa-arrow-right"></span>
</a>