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 2017/03/07 10:27:57 UTC

[1/7] incubator-mynewt-site git commit: PRs #160, #161, minor edits to various docs

Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/asf-site 36d47613e -> 86a273816


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/otherfs/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/otherfs/index.html b/latest/os/modules/fs/otherfs/index.html
index f258abc..d4fa4c4 100644
--- a/latest/os/modules/fs/otherfs/index.html
+++ b/latest/os/modules/fs/otherfs/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/hal/hal_gpio/hal_gpio/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/hal/hal_gpio/hal_gpio/index.html b/latest/os/modules/hal/hal_gpio/hal_gpio/index.html
index bc792a5..1b78ab2 100644
--- a/latest/os/modules/hal/hal_gpio/hal_gpio/index.html
+++ b/latest/os/modules/hal/hal_gpio/hal_gpio/index.html
@@ -681,7 +681,7 @@ within a Mynewt system.</p>
 port pins) depends on the specific variant of the stm32F4xx.  </p>
 <p>So if I want to turn on port B pin 3, that would be virtual pin  1*16 + 3 = 19.
 This translation is defined in the MCU implementation of
-<a href="https://github.com/apache/incubator-mynewt-larva/blob/master/hw/mcu/stm/stm32f4xx/src/hal_gpio.c">hal_gpio.c</a>
+<a href="https://github.com/apache/incubator-mynewt-core/blob/master/hw/mcu/stm/stm32f4xx/src/hal_gpio.c">hal_gpio.c</a>
 for the stmf32F4xx.  Each MCU will typically have a different translation method
 depending on its GPIO architecture.</p>
 <p>Now, when writing a BSP, it's common to give names to the relevant port pins that you are using.  Thus, the BSP may define a mapping between a function and a virtual port pin in the <code>bsp.h</code> header file for the BSP.  For example,</p>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/shell/shell/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/shell/shell/index.html b/latest/os/modules/shell/shell/index.html
index 2f1aa4e..d62194a 100644
--- a/latest/os/modules/shell/shell/index.html
+++ b/latest/os/modules/shell/shell/index.html
@@ -587,22 +587,22 @@ receives newtmgr request messages.</p>
 </ul>
 <p><br></p>
 <p>Create a sim target to check out these commands available in shell.</p>
-<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">user@~/dev/larva$ newt target create blinky_sim
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">user@~/dev$ newt target create blinky_sim
 Creating target blinky_sim
 Target blinky_sim successfully created!
-user@~/dev/larva$ newt target set blinky_sim name=blinky_sim
+user@~/dev$ newt target set blinky_sim name=blinky_sim
 Target blinky_sim successfully set name to blinky_sim
-user@~/dev/larva$ newt target set blinky_sim arch=sim
+user@~/dev$ newt target set blinky_sim arch=sim
 Target blinky_sim successfully set arch to sim
-user@~/dev/larva$ newt target set blinky_sim project=blinky
+user@~/dev$ newt target set blinky_sim project=blinky
 Target blinky_sim successfully set project to blinky
-user@~/dev/larva$ newt target set blinky_sim bsp=hw/bsp/native
+user@~/dev$ newt target set blinky_sim bsp=hw/bsp/native
 Target blinky_sim successfully set bsp to hw/bsp/native
-user@~/dev/larva$ newt target set blinky_sim compiler_def=debug
+user@~/dev$ newt target set blinky_sim compiler_def=debug
 Target blinky_sim successfully set compiler_def to debug
-user@~/dev/larva$ newt target set blinky_sim compiler=sim
+user@~/dev$ newt target set blinky_sim compiler=sim
 Target blinky_sim successfully set compiler to sim
-user@~/dev/larva$ newt target show
+user@~/dev$ newt target show
 blinky_sim
     arch: sim
     bsp: hw/bsp/native
@@ -610,7 +610,7 @@ blinky_sim
     compiler_def: debug
     name: blinky_sim
     project: blinky
-user@~/dev/larva$ newt target build blinky_sim
+user@~/dev$ newt target build blinky_sim
 Building target blinky_sim (project = blinky)
 Compiling case.c
 Compiling suite.c
@@ -621,7 +621,7 @@ Building project blinky
 Linking blinky.elf
 Successfully run!
 
-user@~/dev/larva$ ./project/blinky/bin/blinky_sim/blinky.elf
+user@~/dev$ ./project/blinky/bin/blinky_sim/blinky.elf
 uart0 at /dev/ttys005
 </pre></div>
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/testutil/testutil/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/testutil/testutil/index.html b/latest/os/modules/testutil/testutil/index.html
index 6a3fa63..d03e6ef 100644
--- a/latest/os/modules/testutil/testutil/index.html
+++ b/latest/os/modules/testutil/testutil/index.html
@@ -669,9 +669,9 @@ This should be populated before <code>tu_init()</code> is called.</p>
 <ul class="nav nav-pills" style="margin-bottom: 10px">
     <li>
     
-    <a href=../../drivers/driver/>
+    <a href=../../../../network/ble/ble_intro/>
         <span class="fa fa-arrow-left"></span>
-        Previous: Drivers
+        Previous: nimBLE
     </a>
     
     </li>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/tutorials/project-target-slinky/index.html
----------------------------------------------------------------------
diff --git a/latest/os/tutorials/project-target-slinky/index.html b/latest/os/tutorials/project-target-slinky/index.html
index b79060f..e88d83c 100644
--- a/latest/os/tutorials/project-target-slinky/index.html
+++ b/latest/os/tutorials/project-target-slinky/index.html
@@ -643,7 +643,7 @@ $ newt load stm32_slinky
 <li>You now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as the very imaginative <code>olimex01</code>.</li>
 </ul>
 <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">        $ pwd
-        /Users/&lt;user&gt;/dev/larva/project/slinky
+        /Users/&lt;user&gt;/dev/project/slinky
         $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ
         Connection profile olimex01 successfully added
         $ newtmgr conn show

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/sitemap.xml
----------------------------------------------------------------------
diff --git a/latest/sitemap.xml b/latest/sitemap.xml
index 0ccc1fb..608248e 100644
--- a/latest/sitemap.xml
+++ b/latest/sitemap.xml
@@ -4,7 +4,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -13,7 +13,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/pages/ble/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -22,7 +22,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/quick-start/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -30,7 +30,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/about/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -38,7 +38,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/talks/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -46,7 +46,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/download/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -54,7 +54,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/community/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -62,7 +62,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/events/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -71,7 +71,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/os/introduction/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -83,7 +83,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/os/get_started/vocabulary/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -123,13 +123,13 @@
         
     <url>
      <loc>http://mynewt.apache.org/faq/how_to_edit_docs/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
     <url>
      <loc>http://mynewt.apache.org/faq/answers/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/sitemap.xml
----------------------------------------------------------------------
diff --git a/sitemap.xml b/sitemap.xml
index e7466d3..21d5305 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -4,7 +4,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -13,13 +13,13 @@
         
     <url>
      <loc>http://mynewt.apache.org/pages/ble/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
     <url>
      <loc>http://mynewt.apache.org/pages/securitybullets/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -28,7 +28,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/quick-start/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -36,7 +36,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/about/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -44,7 +44,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/talks/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -52,7 +52,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/download/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -60,7 +60,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/community/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -68,7 +68,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/events/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -77,7 +77,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/os/introduction/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -89,7 +89,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/os/get_started/vocabulary/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -129,13 +129,13 @@
         
     <url>
      <loc>http://mynewt.apache.org/faq/how_to_edit_docs/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
     <url>
      <loc>http://mynewt.apache.org/faq/answers/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/v0_9_0/sitemap.xml
----------------------------------------------------------------------
diff --git a/v0_9_0/sitemap.xml b/v0_9_0/sitemap.xml
index e7466d3..21d5305 100644
--- a/v0_9_0/sitemap.xml
+++ b/v0_9_0/sitemap.xml
@@ -4,7 +4,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -13,13 +13,13 @@
         
     <url>
      <loc>http://mynewt.apache.org/pages/ble/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
     <url>
      <loc>http://mynewt.apache.org/pages/securitybullets/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -28,7 +28,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/quick-start/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -36,7 +36,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/about/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -44,7 +44,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/talks/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -52,7 +52,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/download/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -60,7 +60,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/community/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -68,7 +68,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/events/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -77,7 +77,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/os/introduction/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -89,7 +89,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/os/get_started/vocabulary/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -129,13 +129,13 @@
         
     <url>
      <loc>http://mynewt.apache.org/faq/how_to_edit_docs/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
     <url>
      <loc>http://mynewt.apache.org/faq/answers/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         


[2/7] incubator-mynewt-site git commit: PRs #160, #161, minor edits to various docs

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/bootloader/bootloader/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/bootloader/bootloader/index.html b/latest/os/modules/bootloader/bootloader/index.html
index 932a24c..badd373 100644
--- a/latest/os/modules/bootloader/bootloader/index.html
+++ b/latest/os/modules/bootloader/bootloader/index.html
@@ -602,14 +602,6 @@ characteristics:</p>
     <span style="color: #A90D91">uint8_t</span>  <span style="color: #000000">ih_key_id</span>;
     <span style="color: #A90D91">uint8_t</span>  <span style="color: #000000">_pad1</span>;
     <span style="color: #A90D91">uint16_t</span> <span style="color: #000000">ih_hdr_s&lt;</span> <span style="color: #000000">bok@bok</span>.<span style="color: #000000">net</span>
-<span style="color: #1C01CE">35</span><span style="color: #000000">d33</span>
-<span style="color: #000000">&lt;</span> <span style="color: #000000">ericmanganaro@gmail</span>.<span style="color: #000000">com</span>
-<span style="color: #1C01CE">42</span><span style="color: #000000">d39</span>
-<span style="color: #000000">&lt;</span> <span style="color: #000000">tam@proxy</span>.<span style="color: #000000">co</span>
-<span style="color: #1C01CE">55</span><span style="color: #000000">d51</span>
-<span style="color: #000000">&lt;</span> <span style="color: #000000">nathan@natb1</span>.<span style="color: #000000">com</span>
-<span style="color: #1C01CE">110</span><span style="color: #000000">d105</span>
-<span style="color: #000000">&lt;</span> <span style="color: #000000">rvs@apache</span>.<span style="color: #000000">orgize</span>;
     <span style="color: #A90D91">uint16_t</span> <span style="color: #000000">_pad2</span>;
     <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">ih_img_size</span>; <span style="color: #177500">/* Does not include header. */</span>
     <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">ih_flags</span>;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/drivers/driver/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/drivers/driver/index.html b/latest/os/modules/drivers/driver/index.html
index cf010b3..20be93c 100644
--- a/latest/os/modules/drivers/driver/index.html
+++ b/latest/os/modules/drivers/driver/index.html
@@ -343,6 +343,19 @@
           
               
           
+              
+                
+  
+  
+    <li><a href="
+  ../flash/
+">Supported Drivers</a>
+  
+  
+    </li>
+
+              
+          
     </ul>
   
     </li>
@@ -596,6 +609,46 @@
 <h3 id="example">Example</h3>
 <p>The Mynewt core repo includes an example of a driver using the HAL to provide extra functionality - the UART driver. It uses HAL GPIO and UART to provide multiple serial ports on the NRF52 (but allowed on other platforms too.)</p>
 <p>The gist of the driver design is that there is an API for the driver (for use by applications), and then sub-packages to that driver that implement that driver API using the HAL and BSP APIs.</p>
+<h3 id="implemented-drivers">Implemented drivers</h3>
+<p>Drivers live under <code>hw/drivers</code>. The current list of supported drivers includes:</p>
+<table>
+<thead>
+<tr>
+<th>Driver</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><a href="adc.md">adc</a></td>
+<td>TODO: ADC driver.</td>
+</tr>
+<tr>
+<td><a href="../flash/">flash</a></td>
+<td>SPI/I2C flash drivers.</td>
+</tr>
+<tr>
+<td><a href="lwip.md">lwip</a></td>
+<td>TODO: LWIP.</td>
+</tr>
+<tr>
+<td><a href="../mmc/">mmc</a></td>
+<td>MMC/SD card driver.</td>
+</tr>
+<tr>
+<td><a href="../../../../network/ble/ble_intro/">nimble</a></td>
+<td>NIMBLE.</td>
+</tr>
+<tr>
+<td><a href="sensors.md">sensors</a></td>
+<td>TODO: sensors.</td>
+</tr>
+<tr>
+<td><a href="uart.md">uart</a></td>
+<td>TODO: UART driver.</td>
+</tr>
+</tbody>
+</table>
                         
                         <div class="row">
                             
@@ -613,8 +666,8 @@
     </li>
     <li class="pull-right">
     
-    <a href=../../testutil/testutil/>
-        Next: Test Utilities
+    <a href=../flash/>
+        Next: flash
         <span class="fa fa-arrow-right"></span>
     </a>
     

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/drivers/flash/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/drivers/flash/index.html b/latest/os/modules/drivers/flash/index.html
new file mode 100644
index 0000000..df666cf
--- /dev/null
+++ b/latest/os/modules/drivers/flash/index.html
@@ -0,0 +1,744 @@
+<!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">
+        
+        
+        <!-- This is broken by doc revisioning.
+        <link rel="canonical" href="http://mynewt.apache.org/os/modules/drivers/flash/"> -->
+        <link rel="shortcut icon" href="../../../../img/favicon.ico">
+
+	    <title>flash - Apache Mynewt</title>
+
+        <link href="../../../../css/bootstrap-3.0.3.min.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="../../../../css/v2.css" rel="stylesheet">
+        <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
+        <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', 'auto');
+                ga('send', 'pageview');
+            </script>
+        
+    </head>
+
+
+    <body class="flash">
+
+
+        <div class="container">
+    <div class="row v2-main-banner">
+        <a class="logo-cell" href="/">
+            <img class="logo" src="/img/logo.png">
+        </a>
+        <div class="tagline-cell">
+            <h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4>
+        </div>
+        <div class="news-cell">
+            <div class="well">
+                <h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.0.0-b2</a> released (Feb 15, 2017)
+            </div>
+        </div>
+    </div>
+</div>
+
+        
+
+
+
+
+
+
+<nav id="navbar" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="150" role="navigation">
+    <div class="container">
+        <!-- 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 
+  class=""
+>
+                    <a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a>
+                </li>
+                <li 
+  class="important"
+>
+                    <a href="/quick-start/">Quick Start</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/about/">About</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/talks/">Talks</a>
+                </li>
+                <li 
+  class="active"
+>
+                    <a href="/latest/os/introduction">Documentation</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/download/">Download</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/community/">Community</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/events/">Events</a>
+                </li>
+            </ul>
+
+            <!-- Search, Navigation and Repo links -->
+            <ul class="nav navbar-nav navbar-right">
+                
+            </ul>
+        </div>
+    </div>
+</nav>
+
+        
+
+        <div class="container">
+            
+                <div class="row">
+                    <div class="col-md-3 v2-sidebar sidebar-container"><div id="docSidebar" class="hidden-print" role="complementary">
+    <div class="top">
+        <div role="search">
+            <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
+                <div class="form-group">
+                    <input type="text" name="q" class="form-control" placeholder="Search documentation" />
+                </div>
+            </form>
+        </div>
+    </div>
+    <ul class="toc-nav">
+      <li class="doc-version">
+<select class="form-control" onchange="if (this.value) window.location.href=this.value">
+    
+    <option
+      value="/develop/os/introduction"
+      selected="selected"
+    >
+      Version: develop (latest)
+    </option>
+    
+    <option
+      value="/v0_9_0/os/introduction"
+      
+    >
+      Version: 0.9.0
+    </option>
+    
+</select>
+</li>
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+          
+  
+  
+    <li ><a href="../../../introduction/">Mynewt Documentation</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../get_started/get_started/">Basic Setup</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../get_started/vocabulary/">Concepts</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../tutorials/tutorials/">Tutorials</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../os_user_guide/">OS User Guide</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/mynewt_os/">OS Core</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/porting/port_os/">Porting to your Platform</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../console/console/">Console</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../shell/shell/">Shell</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../split/split/">Split Images</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../bootloader/bootloader/">Bootloader</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  
+  
+  ../../fs/fs/fs/
+
+">File System</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../hal/hal/">Hardware Abstraction Layer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../driver/">Drivers</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ./
+">Supported Drivers</a>
+  
+  
+    <ul>
+          
+              
+                
+    <li class="active">
+      <a href="./">flash</a>
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../mmc/">mmc</a>
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../../network/ble/ble_intro/">nimBLE</a>
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../testutil/testutil/">Test Utilities</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../devmgmt/newtmgr/">Device Management with Newt Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../imgmgr/imgmgr/">Image Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../baselibc/">Baselibc library</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../elua/elua/">Embedded Lua</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../json/json/">JSON</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../fcb/fcb/">Flash Circular Buffer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../stats/stats/">Stats</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../logs/logs/">Logs</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../sysinitconfig/sysinitconfig/">System Configuration And Initialization</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ../../../../network/ble/ble_intro/
+">BLE User Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newt/newt_intro/">Newt Tool Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newtmgr/overview/">Newt Manager Guide</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+        
+      
+        
+          
+  
+  
+    <li><a href="
+  ../../../../faq/how_to_edit_docs/
+">Appendix</a>
+  
+  
+    </li>
+
+        
+      
+    </ul>
+</div></div>
+
+                    <div class="col-md-9" role="main">
+                        <div class="doc-header">
+                            <div role="navigation" aria-label="breadcrumbs navigation">
+  <ul class="wy-breadcrumbs pull-right">
+    <li><a href="/latest/os/introduction">Docs</a></li>
+    
+    
+        
+          <li>&raquo; <a href="../driver/">Drivers</a></li>
+        
+      
+        
+          <li>&raquo; Supported Drivers</li>
+        
+      
+      
+        <li>&raquo; flash</li>
+      
+    
+    
+  </ul>
+</div>
+                        </div>
+                        
+                            <h2 id="flash"><font color="#F2853F" style="font-size:24pt">flash</font></h2>
+<p>The flash driver subsystem is a work in progress which aims at supporting
+common external SPI/I2C flash/eeprom memory chips. This is equivalent
+to what Linux calls <code>MTD</code> for <code>Memory Technology Devices</code>.</p>
+<p>At the moment the only <code>flash</code> device that is already supported is the
+AT45DBxxx SPI flash family with the <code>at45db</code> driver.</p>
+<p>The flash driver aims for full compatibility with the <code>hal_flash</code> API,
+which means initialization and usage can be performed by any <code>fs</code> that
+supports the <code>hal_flash</code> interface.</p>
+<h4 id="initialization">Initialization</h4>
+<p>To be compatible with the standard <code>hal_flash</code> interface, the <code>at45db</code> driver
+embeds a <code>struct hal_flash</code> to its own <code>struct at45db_dev</code>. The whole <code>at45db_dev</code>
+struct is shown below.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">struct</span> <span style="color: #000000">at45db_dev</span> {
+    <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">hal</span>;
+    <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_spi_settings</span> <span style="color: #000000">*settings</span>;
+    <span style="color: #A90D91">int</span> <span style="color: #000000">spi_num</span>;
+    <span style="color: #A90D91">void</span> <span style="color: #000000">*spi_cfg</span>;                  <span style="color: #177500">/** Low-level MCU SPI config */</span>
+    <span style="color: #A90D91">int</span> <span style="color: #000000">ss_pin</span>;
+    <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">baudrate</span>;
+    <span style="color: #A90D91">uint16_t</span> <span style="color: #000000">page_size</span>;             <span style="color: #177500">/** Page size to be used, valid: 512 and 528 */</span>
+    <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">disable_auto_erase</span>;     <span style="color: #177500">/** Reads and writes auto-erase by default */</span>
+};
+</pre></div>
+
+
+<p>To ease with initialization a helper function <code>at45db_default_config</code> was added.
+It returns an already initialized <code>struct at45db_dev</code> leaving the user with just
+having to provide the SPI related config.</p>
+<p>To initialize the device, pass the <code>at45db_dev</code> struct to <code>at45db_init</code>.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">at45db_init</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>);
+</pre></div>
+
+
+<p>For low-level access to the device the following functions are provided:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">at45db_read</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">addr</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*buf</span>,
+                <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">len</span>);
+<span style="color: #A90D91">int</span> <span style="color: #000000">at45db_write</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">addr</span>, <span style="color: #A90D91">const</span> <span style="color: #A90D91">void</span> <span style="color: #000000">*buf</span>,
+                 <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">len</span>);
+<span style="color: #A90D91">int</span> <span style="color: #000000">at45db_erase_sector</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">sector_address</span>);
+<span style="color: #A90D91">int</span> <span style="color: #000000">at45db_sector_info</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>, <span style="color: #A90D91">int</span> <span style="color: #000000">idx</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">*address</span>,
+                       <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">*sz</span>);
+</pre></div>
+
+
+<p>Also, <code>nffs</code> is able to run on the device due to the fact that standard <code>hal_flash</code>
+interface compatibility is provided. Due to current limitations of <code>nffs</code>, it can
+only run on <code>at45db</code> if the internal flash of the MCU is not being used.</p>
+<h4 id="dependencies">Dependencies</h4>
+<p>To include the <code>at45db</code> driver on a project, just include it as a dependency in your
+pkg.yml:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">pkg.deps:
+    - hw/drivers/flash/at45db
+</pre></div>
+
+
+<h4 id="header-file">Header file</h4>
+<p>The <code>at45db</code> SPI flash follows the standard <code>hal_flash</code> interface but requires
+that a special struct </p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include &lt;at45db/at45db.h&gt;</span>
+</pre></div>
+
+
+<h4 id="example">Example</h4>
+<p>This following examples assume that the <code>at45db</code> is being used on a STM32F4 MCU.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">int</span> <span style="color: #000000">SPI_SS_PIN</span>   <span style="color: #000000">=</span> <span style="color: #000000">MCU_GPIO_PORTA</span>(<span style="color: #1C01CE">4</span>);
+<span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">int</span> <span style="color: #000000">SPI_SCK_PIN</span>  <span style="color: #000000">=</span> <span style="color: #000000">MCU_GPIO_PORTA</span>(<span style="color: #1C01CE">5</span>);
+<span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">int</span> <span style="color: #000000">SPI_MISO_PIN</span> <span style="color: #000000">=</span> <span style="color: #000000">MCU_GPIO_PORTA</span>(<span style="color: #1C01CE">6</span>);
+<span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">int</span> <span style="color: #000000">SPI_MOSI_PIN</span> <span style="color: #000000">=</span> <span style="color: #000000">MCU_GPIO_PORTA</span>(<span style="color: #1C01CE">7</span>);
+
+<span style="color: #A90D91">struct</span> <span style="color: #000000">stm32f4_hal_spi_cfg</span> <span style="color: #000000">spi_cfg</span> <span style="color: #000000">=</span> {
+    .<span style="color: #000000">ss_pin</span>   <span style="color: #000000">=</span> <span style="color: #000000">SPI_SS_PIN</span>,
+    .<span style="color: #000000">sck_pin</span>  <span style="color: #000000">=</span> <span style="color: #000000">SPI_SCK_PIN</span>,
+    .<span style="color: #000000">miso_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">SPI_MISO_PIN</span>,
+    .<span style="color: #000000">mosi_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">SPI_MOSI_PIN</span>,
+    .<span style="color: #000000">irq_prio</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">2</span>
+};
+
+<span style="color: #A90D91">struct</span> <span style="color: #000000">at45db_dev</span> <span style="color: #000000">*my_at45db_dev</span> <span style="color: #000000">=</span> <span style="color: #A90D91">NULL</span>;
+
+<span style="color: #000000">my_at45db_dev</span> <span style="color: #000000">=</span> <span style="color: #000000">at45db_default_config</span>();
+<span style="color: #000000">my_at45db_dev-&gt;spi_num</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">0</span>;
+<span style="color: #000000">my_at45db_dev-&gt;spi_cfg</span> <span style="color: #000000">=</span> <span style="color: #000000">&amp;spi_cfg</span>;
+<span style="color: #000000">my_at45db_dev-&gt;ss_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">spi_cfg</span>.<span style="color: #000000">ss_pin</span>;
+
+<span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">at45db_init</span>((<span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*</span>) <span style="color: #000000">my_at45db_dev</span>);
+<span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span>) {
+    <span style="color: #177500">/* XXX: error handling */</span>
+}
+</pre></div>
+
+
+<p>The enable <code>nffs</code> to run on the <code>at45db</code>, the <code>flash_id</code> 0 needs to map to
+provide a mapping from 0 to this struct.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*</span>
+<span style="color: #000000">hal_bsp_flash_dev</span>(<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">id</span>)
+{
+    <span style="color: #A90D91">if</span> (<span style="color: #000000">id</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) {
+        <span style="color: #A90D91">return</span> <span style="color: #A90D91">NULL</span>;
+    }
+    <span style="color: #A90D91">return</span> <span style="color: #000000">&amp;my_at45db_dev</span>;
+}
+</pre></div>
+                        
+                        <div class="row">
+                            
+
+
+
+<ul class="nav nav-pills" style="margin-bottom: 10px">
+    <li>
+    
+    <a href=../driver/>
+        <span class="fa fa-arrow-left"></span>
+        Previous: Drivers
+    </a>
+    
+    </li>
+    <li class="pull-right">
+    
+    <a href=../mmc/>
+        Next: mmc
+        <span class="fa fa-arrow-right"></span>
+    </a>
+    
+    </li>
+</ul>
+                        </div>
+                        <footer class="row">
+    <div class="col-xs-12">
+        
+            <p class="copyright">Apache Mynewt (incubating) is available under Apache License, version 2.0.</p>
+        
+    </div>
+    <div class="col-xs-12">
+        <div class="logos">
+            <img src="/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
+            <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>
+            <img src="/img/egg-logo2.png" alt="Apache Incubator" title="Apache Incubator">
+        </div>
+    </div>
+</footer>
+                    </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/86a27381/latest/os/modules/drivers/mmc/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/drivers/mmc/index.html b/latest/os/modules/drivers/mmc/index.html
new file mode 100644
index 0000000..8f85469
--- /dev/null
+++ b/latest/os/modules/drivers/mmc/index.html
@@ -0,0 +1,761 @@
+<!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">
+        
+        
+        <!-- This is broken by doc revisioning.
+        <link rel="canonical" href="http://mynewt.apache.org/os/modules/drivers/mmc/"> -->
+        <link rel="shortcut icon" href="../../../../img/favicon.ico">
+
+	    <title>mmc - Apache Mynewt</title>
+
+        <link href="../../../../css/bootstrap-3.0.3.min.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="../../../../css/v2.css" rel="stylesheet">
+        <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
+        <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', 'auto');
+                ga('send', 'pageview');
+            </script>
+        
+    </head>
+
+
+    <body class="mmc">
+
+
+        <div class="container">
+    <div class="row v2-main-banner">
+        <a class="logo-cell" href="/">
+            <img class="logo" src="/img/logo.png">
+        </a>
+        <div class="tagline-cell">
+            <h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4>
+        </div>
+        <div class="news-cell">
+            <div class="well">
+                <h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.0.0-b2</a> released (Feb 15, 2017)
+            </div>
+        </div>
+    </div>
+</div>
+
+        
+
+
+
+
+
+
+<nav id="navbar" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="150" role="navigation">
+    <div class="container">
+        <!-- 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 
+  class=""
+>
+                    <a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a>
+                </li>
+                <li 
+  class="important"
+>
+                    <a href="/quick-start/">Quick Start</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/about/">About</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/talks/">Talks</a>
+                </li>
+                <li 
+  class="active"
+>
+                    <a href="/latest/os/introduction">Documentation</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/download/">Download</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/community/">Community</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/events/">Events</a>
+                </li>
+            </ul>
+
+            <!-- Search, Navigation and Repo links -->
+            <ul class="nav navbar-nav navbar-right">
+                
+            </ul>
+        </div>
+    </div>
+</nav>
+
+        
+
+        <div class="container">
+            
+                <div class="row">
+                    <div class="col-md-3 v2-sidebar sidebar-container"><div id="docSidebar" class="hidden-print" role="complementary">
+    <div class="top">
+        <div role="search">
+            <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
+                <div class="form-group">
+                    <input type="text" name="q" class="form-control" placeholder="Search documentation" />
+                </div>
+            </form>
+        </div>
+    </div>
+    <ul class="toc-nav">
+      <li class="doc-version">
+<select class="form-control" onchange="if (this.value) window.location.href=this.value">
+    
+    <option
+      value="/develop/os/introduction"
+      selected="selected"
+    >
+      Version: develop (latest)
+    </option>
+    
+    <option
+      value="/v0_9_0/os/introduction"
+      
+    >
+      Version: 0.9.0
+    </option>
+    
+</select>
+</li>
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+          
+  
+  
+    <li ><a href="../../../introduction/">Mynewt Documentation</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../get_started/get_started/">Basic Setup</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../get_started/vocabulary/">Concepts</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../tutorials/tutorials/">Tutorials</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../os_user_guide/">OS User Guide</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/mynewt_os/">OS Core</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/porting/port_os/">Porting to your Platform</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../console/console/">Console</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../shell/shell/">Shell</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../split/split/">Split Images</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../bootloader/bootloader/">Bootloader</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  
+  
+  ../../fs/fs/fs/
+
+">File System</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../hal/hal/">Hardware Abstraction Layer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../driver/">Drivers</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ../flash/
+">Supported Drivers</a>
+  
+  
+    <ul>
+          
+              
+                
+    <li >
+      <a href="../flash/">flash</a>
+    </li>
+
+              
+          
+              
+                
+    <li class="active">
+      <a href="./">mmc</a>
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../../network/ble/ble_intro/">nimBLE</a>
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../testutil/testutil/">Test Utilities</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../devmgmt/newtmgr/">Device Management with Newt Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../imgmgr/imgmgr/">Image Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../baselibc/">Baselibc library</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../elua/elua/">Embedded Lua</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../json/json/">JSON</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../fcb/fcb/">Flash Circular Buffer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../stats/stats/">Stats</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../logs/logs/">Logs</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../sysinitconfig/sysinitconfig/">System Configuration And Initialization</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ../../../../network/ble/ble_intro/
+">BLE User Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newt/newt_intro/">Newt Tool Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newtmgr/overview/">Newt Manager Guide</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+        
+      
+        
+          
+  
+  
+    <li><a href="
+  ../../../../faq/how_to_edit_docs/
+">Appendix</a>
+  
+  
+    </li>
+
+        
+      
+    </ul>
+</div></div>
+
+                    <div class="col-md-9" role="main">
+                        <div class="doc-header">
+                            <div role="navigation" aria-label="breadcrumbs navigation">
+  <ul class="wy-breadcrumbs pull-right">
+    <li><a href="/latest/os/introduction">Docs</a></li>
+    
+    
+        
+          <li>&raquo; <a href="../driver/">Drivers</a></li>
+        
+      
+        
+          <li>&raquo; <a href="../flash/">Supported Drivers</a></li>
+        
+      
+      
+        <li>&raquo; mmc</li>
+      
+    
+    
+  </ul>
+</div>
+                        </div>
+                        
+                            <h2 id="mmc"><font color="#F2853F" style="font-size:24pt">mmc</font></h2>
+<p>The MMC driver provides support for SPI based MMC/SDcard interfaces. It exports
+a <code>disk_ops</code> struct that can be used by any FS. Currently only <code>fatfs</code> can run
+over MMC.</p>
+<h4 id="initialization">Initialization</h4>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">mmc_init</span>(<span style="color: #A90D91">int</span> <span style="color: #000000">spi_num</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*spi_cfg</span>, <span style="color: #A90D91">int</span> <span style="color: #000000">ss_pin</span>)
+</pre></div>
+
+
+<p>Initializes the mmc driver to be used by a FS.</p>
+<p>MMC uses the <code>hal_gpio</code> interface to access the SPI <code>ss_pin</code> and the <code>hal_spi</code>
+interface for the communication with the card. <code>spi_cfg</code> must be a hw dependent
+structure used by <code>hal_spi_init</code> to initialize the SPI subsystem.</p>
+<h4 id="dependencies">Dependencies</h4>
+<p>To include the <code>mmc</code> driver on a project, just include it as a dependency in your
+pkg.yml:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">pkg.deps:
+    - hw/drivers/mmc
+</pre></div>
+
+
+<h4 id="returned-values">Returned values</h4>
+<p>MMC functions return one of the following status codes:</p>
+<table>
+<thead>
+<tr>
+<th>Return code</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>MMC_OK</td>
+<td>Success.</td>
+</tr>
+<tr>
+<td>MMC_CARD_ERROR</td>
+<td>General failure on the card.</td>
+</tr>
+<tr>
+<td>MMC_READ_ERROR</td>
+<td>Error reading from the card.</td>
+</tr>
+<tr>
+<td>MMC_WRITE_ERROR</td>
+<td>Error writing to the card.</td>
+</tr>
+<tr>
+<td>MMC_TIMEOUT</td>
+<td>Timed out waiting for the execution of a command.</td>
+</tr>
+<tr>
+<td>MMC_PARAM_ERROR</td>
+<td>An invalid parameter was given to a function.</td>
+</tr>
+<tr>
+<td>MMC_CRC_ERROR</td>
+<td>CRC error reading card.</td>
+</tr>
+<tr>
+<td>MMC_DEVICE_ERROR</td>
+<td>Tried to use an invalid device.</td>
+</tr>
+<tr>
+<td>MMC_RESPONSE_ERROR</td>
+<td>A command received an invalid response.</td>
+</tr>
+<tr>
+<td>MMC_VOLTAGE_ERROR</td>
+<td>The interface doesn't support the requested voltage.</td>
+</tr>
+<tr>
+<td>MMC_INVALID_COMMAND</td>
+<td>The interface haven't accepted some command.</td>
+</tr>
+<tr>
+<td>MMC_ERASE_ERROR</td>
+<td>Error erasing the current card.</td>
+</tr>
+<tr>
+<td>MMC_ADDR_ERROR</td>
+<td>Tried to access an invalid address.</td>
+</tr>
+</tbody>
+</table>
+<h4 id="header-file">Header file</h4>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include &quot;mmc/mmc.h&quot;</span>
+</pre></div>
+
+
+<h4 id="example"><a name="Example"></a>Example</h4>
+<p>This example runs on the STM32F4-Discovery and prints out a listing of
+the root directory on the currently installed card.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #177500">// NOTE: error handling removed for clarity!</span>
+
+<span style="color: #A90D91">struct</span> <span style="color: #000000">stm32f4_hal_spi_cfg</span> <span style="color: #000000">spi_cfg</span> <span style="color: #000000">=</span> {
+    .<span style="color: #000000">ss_pin</span>   <span style="color: #000000">=</span> <span style="color: #000000">SPI_SS_PIN</span>,
+    .<span style="color: #000000">sck_pin</span>  <span style="color: #000000">=</span> <span style="color: #000000">SPI_SCK_PIN</span>,
+    .<span style="color: #000000">miso_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">SPI_MISO_PIN</span>,
+    .<span style="color: #000000">mosi_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">SPI_MOSI_PIN</span>,
+    .<span style="color: #000000">irq_prio</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">2</span>
+};
+
+<span style="color: #000000">mmc_init</span>(<span style="color: #1C01CE">0</span>, <span style="color: #000000">&amp;spi_cfg</span>, <span style="color: #000000">spi_cfg</span>.<span style="color: #000000">ss_pin</span>);
+<span style="color: #000000">disk_register</span>(<span style="color: #C41A16">&quot;mmc0&quot;</span>, <span style="color: #C41A16">&quot;fatfs&quot;</span>, <span style="color: #000000">&amp;mmc_ops</span>);
+
+<span style="color: #000000">fs_opendir</span>(<span style="color: #C41A16">&quot;mmc0:/&quot;</span>, <span style="color: #000000">&amp;dir</span>);
+
+<span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) {
+    <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_readdir</span>(<span style="color: #000000">dir</span>, <span style="color: #000000">&amp;dirent</span>);
+    <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #000000">FS_ENOENT</span>) {
+        <span style="color: #A90D91">break</span>;
+    }
+
+    <span style="color: #000000">fs_dirent_name</span>(<span style="color: #000000">dirent</span>, <span style="color: #A90D91">sizeof</span>(<span style="color: #000000">out_name</span>), <span style="color: #000000">out_name</span>, <span style="color: #000000">&amp;u8_len</span>);
+    <span style="color: #000000">printf</span>(<span style="color: #C41A16">&quot;%s\n&quot;</span>, <span style="color: #000000">out_name</span>);
+}
+
+<span style="color: #000000">fs_closedir</span>(<span style="color: #000000">dir</span>);
+</pre></div>
+                        
+                        <div class="row">
+                            
+
+
+
+<ul class="nav nav-pills" style="margin-bottom: 10px">
+    <li>
+    
+    <a href=../flash/>
+        <span class="fa fa-arrow-left"></span>
+        Previous: flash
+    </a>
+    
+    </li>
+    <li class="pull-right">
+    
+    <a href=../../../../network/ble/ble_intro/>
+        Next: nimBLE
+        <span class="fa fa-arrow-right"></span>
+    </a>
+    
+    </li>
+</ul>
+                        </div>
+                        <footer class="row">
+    <div class="col-xs-12">
+        
+            <p class="copyright">Apache Mynewt (incubating) is available under Apache License, version 2.0.</p>
+        
+    </div>
+    <div class="col-xs-12">
+        <div class="logos">
+            <img src="/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
+            <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>
+            <img src="/img/egg-logo2.png" alt="Apache Incubator" title="Apache Incubator">
+        </div>
+    </div>
+</footer>
+                    </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/86a27381/latest/os/modules/fs/fatfs/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fatfs/index.html b/latest/os/modules/fs/fatfs/index.html
new file mode 100644
index 0000000..17a0991
--- /dev/null
+++ b/latest/os/modules/fs/fatfs/index.html
@@ -0,0 +1,673 @@
+<!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">
+        
+        
+        <!-- This is broken by doc revisioning.
+        <link rel="canonical" href="http://mynewt.apache.org/os/modules/fs/fatfs/"> -->
+        <link rel="shortcut icon" href="../../../../img/favicon.ico">
+
+	    <title>FAT File System - Apache Mynewt</title>
+
+        <link href="../../../../css/bootstrap-3.0.3.min.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="../../../../css/v2.css" rel="stylesheet">
+        <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
+        <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', 'auto');
+                ga('send', 'pageview');
+            </script>
+        
+    </head>
+
+
+    <body class="FAT File System">
+
+
+        <div class="container">
+    <div class="row v2-main-banner">
+        <a class="logo-cell" href="/">
+            <img class="logo" src="/img/logo.png">
+        </a>
+        <div class="tagline-cell">
+            <h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4>
+        </div>
+        <div class="news-cell">
+            <div class="well">
+                <h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.0.0-b2</a> released (Feb 15, 2017)
+            </div>
+        </div>
+    </div>
+</div>
+
+        
+
+
+
+
+
+
+<nav id="navbar" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="150" role="navigation">
+    <div class="container">
+        <!-- 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 
+  class=""
+>
+                    <a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a>
+                </li>
+                <li 
+  class="important"
+>
+                    <a href="/quick-start/">Quick Start</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/about/">About</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/talks/">Talks</a>
+                </li>
+                <li 
+  class="active"
+>
+                    <a href="/latest/os/introduction">Documentation</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/download/">Download</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/community/">Community</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/events/">Events</a>
+                </li>
+            </ul>
+
+            <!-- Search, Navigation and Repo links -->
+            <ul class="nav navbar-nav navbar-right">
+                
+            </ul>
+        </div>
+    </div>
+</nav>
+
+        
+
+        <div class="container">
+            
+                <div class="row">
+                    <div class="col-md-3 v2-sidebar sidebar-container"><div id="docSidebar" class="hidden-print" role="complementary">
+    <div class="top">
+        <div role="search">
+            <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
+                <div class="form-group">
+                    <input type="text" name="q" class="form-control" placeholder="Search documentation" />
+                </div>
+            </form>
+        </div>
+    </div>
+    <ul class="toc-nav">
+      <li class="doc-version">
+<select class="form-control" onchange="if (this.value) window.location.href=this.value">
+    
+    <option
+      value="/develop/os/introduction"
+      selected="selected"
+    >
+      Version: develop (latest)
+    </option>
+    
+    <option
+      value="/v0_9_0/os/introduction"
+      
+    >
+      Version: 0.9.0
+    </option>
+    
+</select>
+</li>
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+          
+  
+  
+    <li ><a href="../../../introduction/">Mynewt Documentation</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../get_started/get_started/">Basic Setup</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../get_started/vocabulary/">Concepts</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../tutorials/tutorials/">Tutorials</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../os_user_guide/">OS User Guide</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/mynewt_os/">OS Core</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/porting/port_os/">Porting to your Platform</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../console/console/">Console</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../shell/shell/">Shell</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../split/split/">Split Images</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../bootloader/bootloader/">Bootloader</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  
+  
+  ../fs/fs/
+
+">File System</a>
+  
+  
+    <ul>
+          
+              
+                
+  
+  
+    <li ><a href="../fs/fs/">File System Abstraction</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li class="active">
+      <a href="./">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../nffs/nffs/">Newtron Flash File System</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../otherfs/">Other File Systems</a>
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../hal/hal/">Hardware Abstraction Layer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../drivers/driver/">Drivers</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../testutil/testutil/">Test Utilities</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../devmgmt/newtmgr/">Device Management with Newt Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../imgmgr/imgmgr/">Image Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../baselibc/">Baselibc library</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../elua/elua/">Embedded Lua</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../json/json/">JSON</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../fcb/fcb/">Flash Circular Buffer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../stats/stats/">Stats</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../logs/logs/">Logs</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../sysinitconfig/sysinitconfig/">System Configuration And Initialization</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ../../../../network/ble/ble_intro/
+">BLE User Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newt/newt_intro/">Newt Tool Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newtmgr/overview/">Newt Manager Guide</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+        
+      
+        
+          
+  
+  
+    <li><a href="
+  ../../../../faq/how_to_edit_docs/
+">Appendix</a>
+  
+  
+    </li>
+
+        
+      
+    </ul>
+</div></div>
+
+                    <div class="col-md-9" role="main">
+                        <div class="doc-header">
+                            <div role="navigation" aria-label="breadcrumbs navigation">
+  <ul class="wy-breadcrumbs pull-right">
+    <li><a href="/latest/os/introduction">Docs</a></li>
+    
+    
+        
+          <li>&raquo; <a href="../../../os_user_guide/">OS User Guide</a></li>
+        
+      
+        
+          <li>&raquo; File System</li>
+        
+      
+      
+        <li>&raquo; FAT File System</li>
+      
+    
+    
+  </ul>
+</div>
+                        </div>
+                        
+                            <h1 id="the-fat-file-system">The FAT File System</h1>
+<p>Mynewt provides an implementation of the FAT filesystem which is currently
+supported on MMC/SD cards.</p>
+<h3 id="description">Description</h3>
+<blockquote>
+<p>File Allocation Table (FAT) is a computer file system architecture and a family
+of industry-standard file systems utilizing it. The FAT file system is a legacy
+file system which is simple and robust. It offers good performance even in
+lightweight implementations, but cannot deliver the same performance, reliability
+and scalability as some modern file systems.</p>
+</blockquote>
+<h3 id="configuration">Configuration</h3>
+<p><code>fatfs</code> configuration can be tweaked by editing <code>fs/fatfs/include/fatfs/ffconf.h</code>.
+The current configuraton was chosen to minimize memory use and some options address
+limitations existing in the OS:</p>
+<ul>
+<li>Write support is enabled by default (can be disabled to minimize memory use).</li>
+<li>Long filename (up to 255) support is disabled.</li>
+<li>When writing files, time/dates are not persisted due to current lack of a
+  standard <code>hal_rtc</code> interface.</li>
+<li>No unicode support. Vanilla config uses standard US codepage 437.</li>
+<li>Formatting of new volumes is disabled.</li>
+<li>Default number of volumes is configured to 1.</li>
+</ul>
+<h3 id="api">API</h3>
+<p>To include <code>fatfs</code> on a project just include it as a dependency in your
+project:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">pkg.deps:
+    - fs/fatfs
+</pre></div>
+
+
+<p>It can now be used through the standard file system abstraction functions as
+described in <a href="../../../../os/modules/fs/fs/fs#API">FS API</a>.</p>
+<h4 id="example">Example</h4>
+<p>An example of using <code>fatfs</code> on a MMC card is provided on the
+<a href="../../../../os/modules/drivers/mmc#Example">MMC</a> documentation.</p>
+                        
+                        <div class="row">
+                            
+
+
+
+<ul class="nav nav-pills" style="margin-bottom: 10px">
+    <li>
+    
+    <a href=../fs/fsutil_write_file/>
+        <span class="fa fa-arrow-left"></span>
+        Previous: fsutil_write_file
+    </a>
+    
+    </li>
+    <li class="pull-right">
+    
+    <a href=../nffs/nffs/>
+        Next: Newtron Flash File System
+        <span class="fa fa-arrow-right"></span>
+    </a>
+    
+    </li>
+</ul>
+                        </div>
+                        <footer class="row">
+    <div class="col-xs-12">
+        
+            <p class="copyright">Apache Mynewt (incubating) is available under Apache License, version 2.0.</p>
+        
+    </div>
+    <div class="col-xs-12">
+        <div class="logos">
+            <img src="/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
+            <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>
+            <img src="/img/egg-logo2.png" alt="Apache Incubator" title="Apache Incubator">
+        </div>
+    </div>
+</footer>
+                    </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/86a27381/latest/os/modules/fs/fs/fs/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs/index.html b/latest/os/modules/fs/fs/fs/index.html
index b2b2d5a..3ea0401 100644
--- a/latest/os/modules/fs/fs/fs/index.html
+++ b/latest/os/modules/fs/fs/fs/index.html
@@ -372,6 +372,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>
@@ -651,6 +659,40 @@ pkg.deps:
 
 
 <p>The <code>libs/imgmgr</code> package uses the <code>fs/fs</code> API for all file system operations.</p>
+<h3 id="support-for-multiple-filesystems">Support for multiple filesystems</h3>
+<p>When using a single filesystem/disk, it is valid to provide paths in the standard
+unix way, eg, <code>/&lt;dir-name&gt;/&lt;file-name&gt;</code>. When trying to run more than one filesystem
+or a single filesystem in multiple devices simultaneosly, an extra name has to be
+given to the disk that is being used. The abstraction for that was added as the
+<code>fs/disk</code> package which is a dependency of <code>fs/fs</code>. It adds the following extra
+user function:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">disk_register</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*disk_name</span>, <span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*fs_name</span>, <span style="color: #A90D91">struct</span> <span style="color: #000000">disk_ops</span> <span style="color: #000000">*dops</span>)
+</pre></div>
+
+
+<p>As an example os usage:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #000000">disk_register</span>(<span style="color: #C41A16">&quot;mmc0&quot;</span>, <span style="color: #C41A16">&quot;fatfs&quot;</span>, <span style="color: #000000">&amp;mmc_ops</span>);
+<span style="color: #000000">disk_register</span>(<span style="color: #C41A16">&quot;flash0&quot;</span>, <span style="color: #C41A16">&quot;nffs&quot;</span>, <span style="color: #A90D91">NULL</span>);
+</pre></div>
+
+
+<p>This registers the name <code>mmc0</code> to use <code>fatfs</code> as the filesystem and <code>mmc_ops</code> for
+the low-level disk driver and also registers <code>flash0</code> to use <code>nffs</code>. <code>nffs</code> is
+currently strongly bound to the <code>hal_flash</code> interface, ignoring any other possible
+<code>disk_ops</code> given.</p>
+<h4 id="struct-disk_ops">struct disk_ops</h4>
+<p>To support a new low-level disk interface, the <code>struct disk_ops</code> interface must
+be implemented by the low-level driver. Currently only <code>read</code> and <code>write</code> are
+effectively used (by <code>fatfs</code>).</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">struct</span> <span style="color: #000000">disk_ops</span> {
+    <span style="color: #A90D91">int</span> (<span style="color: #000000">*read</span>)(<span style="color: #A90D91">uint8_t</span>, <span style="color: #A90D91">uint32_t</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*</span>, <span style="color: #A90D91">uint32_t</span>);
+    <span style="color: #A90D91">int</span> (<span style="color: #000000">*write</span>)(<span style="color: #A90D91">uint8_t</span>, <span style="color: #A90D91">uint32_t</span>, <span style="color: #A90D91">const</span> <span style="color: #A90D91">void</span> <span style="color: #000000">*</span>, <span style="color: #A90D91">uint32_t</span>);
+    <span style="color: #A90D91">int</span> (<span style="color: #000000">*ioctl</span>)(<span style="color: #A90D91">uint8_t</span>, <span style="color: #A90D91">uint32_t</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*</span>);
+    <span style="color: #000000">SLIST_ENTRY</span>(<span style="color: #000000">disk_ops</span>) <span style="color: #000000">sc_next</span>;
+}
+</pre></div>
+
+
 <h3 id="thread-safety">Thread Safety</h3>
 <p>All <code>fs/fs</code> functions are thread safe.</p>
 <h3 id="header-files">Header Files</h3>
@@ -667,7 +709,7 @@ pkg.deps:
 </pre></div>
 
 
-<h3 id="api">API</h3>
+<h3 id="api"><a name="API"></a>API</h3>
 <p>Functions in <code>fs/fs</code> that indicate success or failure do so with the following set of return codes:</p>
 <ul>
 <li><a href="../fs_return_codes/">Return Codes</a></li>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_close/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_close/index.html b/latest/os/modules/fs/fs/fs_close/index.html
index 03efc57..32e790a 100644
--- a/latest/os/modules/fs/fs/fs_close/index.html
+++ b/latest/os/modules/fs/fs/fs_close/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_closedir/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_closedir/index.html b/latest/os/modules/fs/fs/fs_closedir/index.html
index 1541a57..579a21f 100644
--- a/latest/os/modules/fs/fs/fs_closedir/index.html
+++ b/latest/os/modules/fs/fs/fs_closedir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_dirent_is_dir/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_dirent_is_dir/index.html b/latest/os/modules/fs/fs/fs_dirent_is_dir/index.html
index 427f55e..efcec1d 100644
--- a/latest/os/modules/fs/fs/fs_dirent_is_dir/index.html
+++ b/latest/os/modules/fs/fs/fs_dirent_is_dir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_dirent_name/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_dirent_name/index.html b/latest/os/modules/fs/fs/fs_dirent_name/index.html
index a71df21..8cda941 100644
--- a/latest/os/modules/fs/fs/fs_dirent_name/index.html
+++ b/latest/os/modules/fs/fs/fs_dirent_name/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_filelen/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_filelen/index.html b/latest/os/modules/fs/fs/fs_filelen/index.html
index 0caeab0..d1b4fdf 100644
--- a/latest/os/modules/fs/fs/fs_filelen/index.html
+++ b/latest/os/modules/fs/fs/fs_filelen/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_getpos/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_getpos/index.html b/latest/os/modules/fs/fs/fs_getpos/index.html
index c51a5e1..ef1b3c0 100644
--- a/latest/os/modules/fs/fs/fs_getpos/index.html
+++ b/latest/os/modules/fs/fs/fs_getpos/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_mkdir/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_mkdir/index.html b/latest/os/modules/fs/fs/fs_mkdir/index.html
index a1f81af..529061b 100644
--- a/latest/os/modules/fs/fs/fs_mkdir/index.html
+++ b/latest/os/modules/fs/fs/fs_mkdir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_open/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_open/index.html b/latest/os/modules/fs/fs/fs_open/index.html
index 28bb30c..c5ab0dc 100644
--- a/latest/os/modules/fs/fs/fs_open/index.html
+++ b/latest/os/modules/fs/fs/fs_open/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_opendir/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_opendir/index.html b/latest/os/modules/fs/fs/fs_opendir/index.html
index 17a0bbf..16198a0 100644
--- a/latest/os/modules/fs/fs/fs_opendir/index.html
+++ b/latest/os/modules/fs/fs/fs_opendir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_ops/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_ops/index.html b/latest/os/modules/fs/fs/fs_ops/index.html
index ed10583..b6878b1 100644
--- a/latest/os/modules/fs/fs/fs_ops/index.html
+++ b/latest/os/modules/fs/fs/fs_ops/index.html
@@ -384,6 +384,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_read/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_read/index.html b/latest/os/modules/fs/fs/fs_read/index.html
index 56bfb1b..df2f4a9 100644
--- a/latest/os/modules/fs/fs/fs_read/index.html
+++ b/latest/os/modules/fs/fs/fs_read/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_readdir/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_readdir/index.html b/latest/os/modules/fs/fs/fs_readdir/index.html
index 36ec822..fbf2837 100644
--- a/latest/os/modules/fs/fs/fs_readdir/index.html
+++ b/latest/os/modules/fs/fs/fs_readdir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_register/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_register/index.html b/latest/os/modules/fs/fs/fs_register/index.html
index 31205df..7be43ca 100644
--- a/latest/os/modules/fs/fs/fs_register/index.html
+++ b/latest/os/modules/fs/fs/fs_register/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_rename/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_rename/index.html b/latest/os/modules/fs/fs/fs_rename/index.html
index b31781e..39c483b 100644
--- a/latest/os/modules/fs/fs/fs_rename/index.html
+++ b/latest/os/modules/fs/fs/fs_rename/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_return_codes/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_return_codes/index.html b/latest/os/modules/fs/fs/fs_return_codes/index.html
index 9806f7a..ed99efb 100644
--- a/latest/os/modules/fs/fs/fs_return_codes/index.html
+++ b/latest/os/modules/fs/fs/fs_return_codes/index.html
@@ -372,6 +372,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_seek/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_seek/index.html b/latest/os/modules/fs/fs/fs_seek/index.html
index efe2bc6..e43d8c6 100644
--- a/latest/os/modules/fs/fs/fs_seek/index.html
+++ b/latest/os/modules/fs/fs/fs_seek/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_unlink/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_unlink/index.html b/latest/os/modules/fs/fs/fs_unlink/index.html
index e1938a3..32b5637 100644
--- a/latest/os/modules/fs/fs/fs_unlink/index.html
+++ b/latest/os/modules/fs/fs/fs_unlink/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fs_write/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fs_write/index.html b/latest/os/modules/fs/fs/fs_write/index.html
index 23dc21f..a6a75e6 100644
--- a/latest/os/modules/fs/fs/fs_write/index.html
+++ b/latest/os/modules/fs/fs/fs_write/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fsutil_read_file/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fsutil_read_file/index.html b/latest/os/modules/fs/fs/fsutil_read_file/index.html
index c9c055a..92c82fc 100644
--- a/latest/os/modules/fs/fs/fsutil_read_file/index.html
+++ b/latest/os/modules/fs/fs/fsutil_read_file/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/fs/fsutil_write_file/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/fs/fsutil_write_file/index.html b/latest/os/modules/fs/fs/fsutil_write_file/index.html
index 355e2b6..43f7b4a 100644
--- a/latest/os/modules/fs/fs/fsutil_write_file/index.html
+++ b/latest/os/modules/fs/fs/fsutil_write_file/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>
@@ -837,8 +845,8 @@
     </li>
     <li class="pull-right">
     
-    <a href=../../nffs/nffs/>
-        Next: Newtron Flash File System
+    <a href=../../fatfs/>
+        Next: FAT File System
         <span class="fa fa-arrow-right"></span>
     </a>
     

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/nffs/nffs/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/nffs/nffs/index.html b/latest/os/modules/fs/nffs/nffs/index.html
index 347926f..7323988 100644
--- a/latest/os/modules/fs/nffs/nffs/index.html
+++ b/latest/os/modules/fs/nffs/nffs/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li class="active"><a href="./">Newtron Flash File System</a>
@@ -720,9 +728,9 @@
 <ul class="nav nav-pills" style="margin-bottom: 10px">
     <li>
     
-    <a href=../../fs/fsutil_write_file/>
+    <a href=../../fatfs/>
         <span class="fa fa-arrow-left"></span>
-        Previous: fsutil_write_file
+        Previous: FAT File System
     </a>
     
     </li>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/nffs/nffs_area_desc/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/nffs/nffs_area_desc/index.html b/latest/os/modules/fs/nffs/nffs_area_desc/index.html
index 20b8c8c..8e8d672 100644
--- a/latest/os/modules/fs/nffs/nffs_area_desc/index.html
+++ b/latest/os/modules/fs/nffs/nffs_area_desc/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/nffs/nffs_config/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/nffs/nffs_config/index.html b/latest/os/modules/fs/nffs/nffs_config/index.html
index 294136f..188af80 100644
--- a/latest/os/modules/fs/nffs/nffs_config/index.html
+++ b/latest/os/modules/fs/nffs/nffs_config/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/nffs/nffs_detect/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/nffs/nffs_detect/index.html b/latest/os/modules/fs/nffs/nffs_detect/index.html
index 47700c7..27bae9a 100644
--- a/latest/os/modules/fs/nffs/nffs_detect/index.html
+++ b/latest/os/modules/fs/nffs/nffs_detect/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/nffs/nffs_format/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/nffs/nffs_format/index.html b/latest/os/modules/fs/nffs/nffs_format/index.html
index 30af292..2bdfe39 100644
--- a/latest/os/modules/fs/nffs/nffs_format/index.html
+++ b/latest/os/modules/fs/nffs/nffs_format/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/nffs/nffs_init/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/nffs/nffs_init/index.html b/latest/os/modules/fs/nffs/nffs_init/index.html
index f8db02a..73b2b4c 100644
--- a/latest/os/modules/fs/nffs/nffs_init/index.html
+++ b/latest/os/modules/fs/nffs/nffs_init/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/os/modules/fs/nffs/nffs_internals/index.html
----------------------------------------------------------------------
diff --git a/latest/os/modules/fs/nffs/nffs_internals/index.html b/latest/os/modules/fs/nffs/nffs_internals/index.html
index 9902649..42d0635 100644
--- a/latest/os/modules/fs/nffs/nffs_internals/index.html
+++ b/latest/os/modules/fs/nffs/nffs_internals/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>



[6/7] incubator-mynewt-site git commit: PRs #160, #161, minor edits to various docs

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/mkdocs/search_index.json
----------------------------------------------------------------------
diff --git a/develop/mkdocs/search_index.json b/develop/mkdocs/search_index.json
index 84d2e36..c6dfaad 100644
--- a/develop/mkdocs/search_index.json
+++ b/develop/mkdocs/search_index.json
@@ -1442,7 +1442,7 @@
         }, 
         {
             "location": "/os/tutorials/project-target-slinky/", 
-            "text": "Project Slinky using STM32 board\n\n\n\n\nThe goal of the project is to enable and demonstrate remote communications with the Mynewt OS via newt manager (newtmgr) by leveraging a sample app \"Slinky\" included under the /apps directory in the repository. In this project we will define a target for the STM32-E407 board and assign the app \"Slinky\" to it.\n\n\nIf you have an existing project using a target that does not use the Slinky app and you wish to add newtmgt functonality to it, check out the tutorial titled \nEnable newtmgr in any app\n.\n\n\n\n\nWhat you need\n\n\n\n\nSTM32-E407 development board from Olimex. You can order it from \nhttp://www.mouser.com\n, \nhttp://www.digikey.com\n, and other places.\n\n\nARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)\n\n\nUSB A-B type cable to connect the debugger to your personal computer\n\n\nA USB to TTL Serial Cable with female 
 wiring harness. An example is \nhttp://www.amazon.com/JBtek\u00ae-WINDOWS-Supported-Raspberry-Programming/dp/B00QT7LQ88/ref=lp_464404_1_9?s=pc\nie=UTF8\nqid=1454631303\nsr=1-9\n\n\nPersonal Computer\n\n\n\n\nThe instructions assume the user is using a Bourne-compatible shell (e.g. bash or zsh) on your computer. The given instructions have been tested with the following releases of operating systems:\n\n\n\n\nMac: OS X Yosemite Version 10.10.5\n\n\n\n\nOverview of steps\n\n\n\n\nInstall dependencies\n\n\nDefine a target using the newt tool\n\n\nBuild executables for the targets using the newt tool\n\n\nSet up serial connection with the targets\n\n\nCreate a connection profile using the newtmgr tool\n\n\nUse the newtmgr tool to communicate with the targets\n\n\n\n\nInstall newt\n\n\nIf you have not already installed \nnewt\n, see the\n\nnewt installation instructions\n and ensure newt is installed an in your path.\n\n\nInstall newtmgr\n\n\nIf you have not already installed \nnewtmgr\n
 , see the\n\nnewtmgr installation instructions\n and ensure newtmgr is installed an in your path.\n\n\nCreate a new project\n\n\nInstructions for creating a project are located in the \nBasic Setup\n section of the \nMynewt Documentation\n.\n\n\nIf you already completed \nSim Slinky\n you can skip this step.\n\n\nWe will list only the steps here for brevity.  We will name the project\n\nslinky\n.\n\n\n$ newt new slinky\nDownloading project skeleton from apache/incubator-mynewt-blinky...\n...\nInstalling skeleton in slink...\nProject slink successfully created\n$ cd slinky\n$newt install -v\nDownloading repository description for apache-mynewt-core... success!\n...\nRepos successfully installed\n\n\n\n\n\n\n\nSet up your target builds\n\n\nCreate a target for \nstm32_slinky\n using the native BSP. The Newt tool output is suppressed below for brevity.\n\n\n$ newt target create stm32_slinky\n$ newt target set stm32_slinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n$ new
 t target set stm32_slinky build_profile=debug\n$ newt target set stm32_slinky app=@apache-mynewt-core/apps/slinky\n\n\n\n\n\nCreate a second target for \nstm32_bootloader\n to build a bootloader to boot\nthe \nstm32_slinky\n image.  The tool output is suppressed below for brevity.\n\n\n$ newt target create stm32_bootloader\n$ newt target set stm32_bootloader bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n$ newt target set stm32_bootloader build_profile=optimized\n$ newt target set stm32_bootloader target.app=@apache-mynewt-core/apps/boot\n\n\n\n\n\n\n\nBuild Targets\n\n\n$ newt build stm32_slinky\nCompiling main.c\n...\nLinking slinky.elf\nApp successfully built: ~/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.elf\n\n\n\n\n\nnewt build stm32_bootloader\nCompiling crc16.c\n...\nLinking boot.elf\nApp successfully built: ~/slinky/bin/stm32_bootloader/apps/boot/boot.elf\n\n\n\n\n\nFor the main image, you need to create an image using newt create-image.\nGive this image some
  arbitrary version number \"1.2.3\".\n\n\n$ newt create-image stm32_slinky 1.2.3\nApp image successfully generated: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.img\nBuild manifest: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/manifest.json\n\n\n\n\n\n\n\nUsing newtmgr with a remote target\n\n\n\n\n\n\nFirst make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.\n\n\nNext go the to project directory and download the slinky project image to the flash of the Olimex board.\n\n\n\n\n\n\n$ newt load stm32_bootloader\n$ newt load stm32_slinky\n\n\n\n\n\nYou can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.\n\n\n\n\n\n\n\n\nNow you have to set up the serial connection from your computer to the Olimex board. Locate the PC6/USART6_TX (pin#3), PC7/USART6_RX (pin#4), and GND (pin#2) of the UEXT connector on the Olimex board.
  More information on the UEXT connector can be found at \nhttps://www.olimex.com/Products/Modules/UEXT/\n. The schematic of the board can be found at \nhttps://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf\n for reference.\n\n\n\n\n\n\nConnect the female RX pin of the USB-TTL serial cable to the TX of the UEXT connector on the board.\n\n\nConnect the female TX pin of the USB-TTL serial cable to the RX of the UEXT connector on the board.\n\n\nConnect the GND pin of the USB-TTL serial cable to the GND of the UEXT connector on the board.\n\n\n\n\n\n\n\n\n\n\n\n\nLocate the serial connection established in the /dev directory of your computer. It should be of the type \ntty.usbserial-\nsome identifier\n.\n\n\n\n\n        $ ls /dev/tty.usbserial-AJ03HAQQ\n        /dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\n\n\nYou now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as t
 he very imaginative \nolimex01\n.\n\n\n\n\n        $ pwd\n        /Users/\nuser\n/dev/larva/project/slinky\n        $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ\n        Connection profile olimex01 successfully added\n        $ newtmgr conn show\n        Connection profiles:\n          sim1: type=serial, connstring=\n/dev/ttys007\n\n          olimex01: type=serial, connstring=\n/dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\n\n\n\nNow go ahead and query the Olimex board to get responses back. The simplest command is the \necho\n command to ask it to respond with the text you send it.\n\n\n\n\n    $ newtmgr echo -c olimex01 hello\n    {\nr\n: \nhello\n}\n    $ newtmgr image -c olimex01 list\n    Images:\n        0 : 1.2.3\n    $ newtmgr -c olimex01 taskstats\n    Return Code = 0\n      newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)\n      task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 la
 st_checkin=0 next_checkin=0)\n      task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)\n      idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)\n      shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)", 
+            "text": "Project Slinky using STM32 board\n\n\n\n\nThe goal of the project is to enable and demonstrate remote communications with the Mynewt OS via newt manager (newtmgr) by leveraging a sample app \"Slinky\" included under the /apps directory in the repository. In this project we will define a target for the STM32-E407 board and assign the app \"Slinky\" to it.\n\n\nIf you have an existing project using a target that does not use the Slinky app and you wish to add newtmgt functonality to it, check out the tutorial titled \nEnable newtmgr in any app\n.\n\n\n\n\nWhat you need\n\n\n\n\nSTM32-E407 development board from Olimex. You can order it from \nhttp://www.mouser.com\n, \nhttp://www.digikey.com\n, and other places.\n\n\nARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)\n\n\nUSB A-B type cable to connect the debugger to your personal computer\n\n\nA USB to TTL Serial Cable with female 
 wiring harness. An example is \nhttp://www.amazon.com/JBtek\u00ae-WINDOWS-Supported-Raspberry-Programming/dp/B00QT7LQ88/ref=lp_464404_1_9?s=pc\nie=UTF8\nqid=1454631303\nsr=1-9\n\n\nPersonal Computer\n\n\n\n\nThe instructions assume the user is using a Bourne-compatible shell (e.g. bash or zsh) on your computer. The given instructions have been tested with the following releases of operating systems:\n\n\n\n\nMac: OS X Yosemite Version 10.10.5\n\n\n\n\nOverview of steps\n\n\n\n\nInstall dependencies\n\n\nDefine a target using the newt tool\n\n\nBuild executables for the targets using the newt tool\n\n\nSet up serial connection with the targets\n\n\nCreate a connection profile using the newtmgr tool\n\n\nUse the newtmgr tool to communicate with the targets\n\n\n\n\nInstall newt\n\n\nIf you have not already installed \nnewt\n, see the\n\nnewt installation instructions\n and ensure newt is installed an in your path.\n\n\nInstall newtmgr\n\n\nIf you have not already installed \nnewtmgr\n
 , see the\n\nnewtmgr installation instructions\n and ensure newtmgr is installed an in your path.\n\n\nCreate a new project\n\n\nInstructions for creating a project are located in the \nBasic Setup\n section of the \nMynewt Documentation\n.\n\n\nIf you already completed \nSim Slinky\n you can skip this step.\n\n\nWe will list only the steps here for brevity.  We will name the project\n\nslinky\n.\n\n\n$ newt new slinky\nDownloading project skeleton from apache/incubator-mynewt-blinky...\n...\nInstalling skeleton in slink...\nProject slink successfully created\n$ cd slinky\n$newt install -v\nDownloading repository description for apache-mynewt-core... success!\n...\nRepos successfully installed\n\n\n\n\n\n\n\nSet up your target builds\n\n\nCreate a target for \nstm32_slinky\n using the native BSP. The Newt tool output is suppressed below for brevity.\n\n\n$ newt target create stm32_slinky\n$ newt target set stm32_slinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n$ new
 t target set stm32_slinky build_profile=debug\n$ newt target set stm32_slinky app=@apache-mynewt-core/apps/slinky\n\n\n\n\n\nCreate a second target for \nstm32_bootloader\n to build a bootloader to boot\nthe \nstm32_slinky\n image.  The tool output is suppressed below for brevity.\n\n\n$ newt target create stm32_bootloader\n$ newt target set stm32_bootloader bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n$ newt target set stm32_bootloader build_profile=optimized\n$ newt target set stm32_bootloader target.app=@apache-mynewt-core/apps/boot\n\n\n\n\n\n\n\nBuild Targets\n\n\n$ newt build stm32_slinky\nCompiling main.c\n...\nLinking slinky.elf\nApp successfully built: ~/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.elf\n\n\n\n\n\nnewt build stm32_bootloader\nCompiling crc16.c\n...\nLinking boot.elf\nApp successfully built: ~/slinky/bin/stm32_bootloader/apps/boot/boot.elf\n\n\n\n\n\nFor the main image, you need to create an image using newt create-image.\nGive this image some
  arbitrary version number \"1.2.3\".\n\n\n$ newt create-image stm32_slinky 1.2.3\nApp image successfully generated: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.img\nBuild manifest: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/manifest.json\n\n\n\n\n\n\n\nUsing newtmgr with a remote target\n\n\n\n\n\n\nFirst make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.\n\n\nNext go the to project directory and download the slinky project image to the flash of the Olimex board.\n\n\n\n\n\n\n$ newt load stm32_bootloader\n$ newt load stm32_slinky\n\n\n\n\n\nYou can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.\n\n\n\n\n\n\n\n\nNow you have to set up the serial connection from your computer to the Olimex board. Locate the PC6/USART6_TX (pin#3), PC7/USART6_RX (pin#4), and GND (pin#2) of the UEXT connector on the Olimex board.
  More information on the UEXT connector can be found at \nhttps://www.olimex.com/Products/Modules/UEXT/\n. The schematic of the board can be found at \nhttps://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf\n for reference.\n\n\n\n\n\n\nConnect the female RX pin of the USB-TTL serial cable to the TX of the UEXT connector on the board.\n\n\nConnect the female TX pin of the USB-TTL serial cable to the RX of the UEXT connector on the board.\n\n\nConnect the GND pin of the USB-TTL serial cable to the GND of the UEXT connector on the board.\n\n\n\n\n\n\n\n\n\n\n\n\nLocate the serial connection established in the /dev directory of your computer. It should be of the type \ntty.usbserial-\nsome identifier\n.\n\n\n\n\n        $ ls /dev/tty.usbserial-AJ03HAQQ\n        /dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\n\n\nYou now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as t
 he very imaginative \nolimex01\n.\n\n\n\n\n        $ pwd\n        /Users/\nuser\n/dev/project/slinky\n        $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ\n        Connection profile olimex01 successfully added\n        $ newtmgr conn show\n        Connection profiles:\n          sim1: type=serial, connstring=\n/dev/ttys007\n\n          olimex01: type=serial, connstring=\n/dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\n\n\n\nNow go ahead and query the Olimex board to get responses back. The simplest command is the \necho\n command to ask it to respond with the text you send it.\n\n\n\n\n    $ newtmgr echo -c olimex01 hello\n    {\nr\n: \nhello\n}\n    $ newtmgr image -c olimex01 list\n    Images:\n        0 : 1.2.3\n    $ newtmgr -c olimex01 taskstats\n    Return Code = 0\n      newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)\n      task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 last_che
 ckin=0 next_checkin=0)\n      task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)\n      idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)\n      shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)", 
             "title": "Slinky on STM32 board"
         }, 
         {
@@ -1487,7 +1487,7 @@
         }, 
         {
             "location": "/os/tutorials/project-target-slinky/#using-newtmgr-with-a-remote-target", 
-            "text": "First make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.  Next go the to project directory and download the slinky project image to the flash of the Olimex board.    $ newt load stm32_bootloader\n$ newt load stm32_slinky  You can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.     Now you have to set up the serial connection from your computer to the Olimex board. Locate the PC6/USART6_TX (pin#3), PC7/USART6_RX (pin#4), and GND (pin#2) of the UEXT connector on the Olimex board. More information on the UEXT connector can be found at  https://www.olimex.com/Products/Modules/UEXT/ . The schematic of the board can be found at  https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf  for reference.    Connect the female RX pin of the USB-TTL serial cable to the TX of the UEXT connector on the board.  Connect the
  female TX pin of the USB-TTL serial cable to the RX of the UEXT connector on the board.  Connect the GND pin of the USB-TTL serial cable to the GND of the UEXT connector on the board.       Locate the serial connection established in the /dev directory of your computer. It should be of the type  tty.usbserial- some identifier .           $ ls /dev/tty.usbserial-AJ03HAQQ\n        /dev/tty.usbserial-AJ03HAQQ    You now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as the very imaginative  olimex01 .           $ pwd\n        /Users/ user /dev/larva/project/slinky\n        $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ\n        Connection profile olimex01 successfully added\n        $ newtmgr conn show\n        Connection profiles:\n          sim1: type=serial, connstring= /dev/ttys007 \n          olimex01: type=serial, connstring= /dev/tty.usbserial-AJ03HA
 QQ     Now go ahead and query the Olimex board to get responses back. The simplest command is the  echo  command to ask it to respond with the text you send it.       $ newtmgr echo -c olimex01 hello\n    { r :  hello }\n    $ newtmgr image -c olimex01 list\n    Images:\n        0 : 1.2.3\n    $ newtmgr -c olimex01 taskstats\n    Return Code = 0\n      newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)\n      task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 last_checkin=0 next_checkin=0)\n      task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)\n      idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)\n      shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)", 
+            "text": "First make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.  Next go the to project directory and download the slinky project image to the flash of the Olimex board.    $ newt load stm32_bootloader\n$ newt load stm32_slinky  You can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.     Now you have to set up the serial connection from your computer to the Olimex board. Locate the PC6/USART6_TX (pin#3), PC7/USART6_RX (pin#4), and GND (pin#2) of the UEXT connector on the Olimex board. More information on the UEXT connector can be found at  https://www.olimex.com/Products/Modules/UEXT/ . The schematic of the board can be found at  https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf  for reference.    Connect the female RX pin of the USB-TTL serial cable to the TX of the UEXT connector on the board.  Connect the
  female TX pin of the USB-TTL serial cable to the RX of the UEXT connector on the board.  Connect the GND pin of the USB-TTL serial cable to the GND of the UEXT connector on the board.       Locate the serial connection established in the /dev directory of your computer. It should be of the type  tty.usbserial- some identifier .           $ ls /dev/tty.usbserial-AJ03HAQQ\n        /dev/tty.usbserial-AJ03HAQQ    You now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as the very imaginative  olimex01 .           $ pwd\n        /Users/ user /dev/project/slinky\n        $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ\n        Connection profile olimex01 successfully added\n        $ newtmgr conn show\n        Connection profiles:\n          sim1: type=serial, connstring= /dev/ttys007 \n          olimex01: type=serial, connstring= /dev/tty.usbserial-AJ03HAQQ    
  Now go ahead and query the Olimex board to get responses back. The simplest command is the  echo  command to ask it to respond with the text you send it.       $ newtmgr echo -c olimex01 hello\n    { r :  hello }\n    $ newtmgr image -c olimex01 list\n    Images:\n        0 : 1.2.3\n    $ newtmgr -c olimex01 taskstats\n    Return Code = 0\n      newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)\n      task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 last_checkin=0 next_checkin=0)\n      task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)\n      idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)\n      shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)", 
             "title": "Using newtmgr with a remote target"
         }, 
         {
@@ -5102,7 +5102,7 @@
         }, 
         {
             "location": "/os/modules/shell/shell/", 
-            "text": "Shell\n\n\nThe shell runs above the console and provides two functionalities:\n\n\n\n\nProcesses console input. \n\n\nImplements the \nnewtmgr\n line protocol over serial transport. \n\n\n\n\nThe \nsys/shell\n package implements the shell.  The shell uses the OS default event queue \nfor shell events and runs in the context of the main task. An application can, optionally, \nspecify a dedicated event queue for the shell to use.\n\n\nDescription\n\n\n\n\n\n\nThe shell's first job is to direct incoming commands to other subsystems. It parses the incoming character string \ninto tokens and uses the first token to determine the subsystem command handler to call to process the command.\n\n\n\n\n\n\nSubsystems register their command handlers using the \nshell_cmd_register()\n \n  function.  When shell calls the command handler, it passes the other tokens as arguments.\n\n\n\n\n\n\nA few commands are currently available in the shell - \ntasks\n, \nlog\n, \necho\n, \nda
 te\n and \nprompt\n.\n\n\n\n\n\n\n\n\n\n\nThe shell's second job is to handle packet framing, encoding, and decoding of newtmgr protocol messages that are\nsent over the console.  The Newtmgr serial transport package (\nmgmt/newtmgr/transport/newtmgr_shell\n) \ncalls the \nshell_nlip_input_register()\n function to register a handler that the shell calls when it \nreceives newtmgr request messages.\n\n\n\n\n\n\n\n\nCreate a sim target to check out these commands available in shell.\n\n\nuser@~/dev/larva$ newt target create blinky_sim\nCreating target blinky_sim\nTarget blinky_sim successfully created!\nuser@~/dev/larva$ newt target set blinky_sim name=blinky_sim\nTarget blinky_sim successfully set name to blinky_sim\nuser@~/dev/larva$ newt target set blinky_sim arch=sim\nTarget blinky_sim successfully set arch to sim\nuser@~/dev/larva$ newt target set blinky_sim project=blinky\nTarget blinky_sim successfully set project to blinky\nuser@~/dev/larva$ newt target set blinky_sim bsp=hw/b
 sp/native\nTarget blinky_sim successfully set bsp to hw/bsp/native\nuser@~/dev/larva$ newt target set blinky_sim compiler_def=debug\nTarget blinky_sim successfully set compiler_def to debug\nuser@~/dev/larva$ newt target set blinky_sim compiler=sim\nTarget blinky_sim successfully set compiler to sim\nuser@~/dev/larva$ newt target show\nblinky_sim\n    arch: sim\n    bsp: hw/bsp/native\n    compiler: sim\n    compiler_def: debug\n    name: blinky_sim\n    project: blinky\nuser@~/dev/larva$ newt target build blinky_sim\nBuilding target blinky_sim (project = blinky)\nCompiling case.c\nCompiling suite.c\nCompiling testutil.c\n..\n..\nBuilding project blinky\nLinking blinky.elf\nSuccessfully run!\n\nuser@~/dev/larva$ ./project/blinky/bin/blinky_sim/blinky.elf\nuart0 at /dev/ttys005\n\n\n\n\n\nOpen up a new terminal to run minicom, a text-based serial port control and terminal emulation program. Set device name to the serial port of the target. \n\n\nuser@~$ minicom -D /dev/ttys005\nWelco
 me to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:14:21.\nPort /dev/ttys005, 11:32:17\n\nPress Meta-Z for help on special keys\n\nlog \n174578:[0] bla\n174578:[0] bab\n\ntasks\n217809:6 tasks: \n217809:  shell (prio: 3, nw: 0, flags: 0x0, ssize: 0, cswcnt: 59, tot_run_time: 0ms)\n217840:  idle (prio: 255, nw: 0, flags: 0x0, ssize: 0, cswcnt: 18763, tot_run_time: 217809ms)\n217878:  uart_poller (prio: 0, nw: 217819, flags: 0x0, ssize: 0, cswcnt: 18667, tot_run_time: 0ms)\n217923:  task1 (prio: 1, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n217953:  os_sanity (prio: 254, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n218010:  task2 (prio: 2, nw: 217709, flags: 0x3, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n\n\nprompt\nUsage: prompt [set|show] [prompt_char]\nprompt set \n\nPrompt set to: \n\n229370: \n\n\n\n\n\n\nData structures\n\n\nThis data structure is used in holding information about registered command handlers.\n\n\nstruct\n 
 \nshell_cmd\n {\n    \nchar\n \n*sc_cmd\n;\n    \nshell_cmd_func_t\n \nsc_cmd_func\n;\n    \nSTAILQ_ENTRY\n(\nshell_cmd\n) \nsc_next\n;\n};\n\n\n\n\n\n\n\n\n\n\n\nElement\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nsc_cmd\n\n\nCharacter string of the command\n\n\n\n\n\n\nsc_cmd_func\n\n\nPointer to the command handler\n\n\n\n\n\n\nsc_next\n\n\nBookkeeping linkage internal for shell\n\n\n\n\n\n\n\n\nList of Functions\n\n\n\n\nThe functions available in this OS feature are:\n\n\n\n\n\n\n\n\nFunction\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nshell_cmd_register\n\n\nRegisters a handler for incoming console commands.\n\n\n\n\n\n\nshell_nlip_input_register\n\n\nRegisters a handler for incoming newtmgr messages.\n\n\n\n\n\n\nshell_nlip_output\n\n\nQueue outgoing newtmgr message for transmission.\n\n\n\n\n\n\nshell_evq_set\n\n\nSpecifies a dedicated event queue for shell events.", 
+            "text": "Shell\n\n\nThe shell runs above the console and provides two functionalities:\n\n\n\n\nProcesses console input. \n\n\nImplements the \nnewtmgr\n line protocol over serial transport. \n\n\n\n\nThe \nsys/shell\n package implements the shell.  The shell uses the OS default event queue \nfor shell events and runs in the context of the main task. An application can, optionally, \nspecify a dedicated event queue for the shell to use.\n\n\nDescription\n\n\n\n\n\n\nThe shell's first job is to direct incoming commands to other subsystems. It parses the incoming character string \ninto tokens and uses the first token to determine the subsystem command handler to call to process the command.\n\n\n\n\n\n\nSubsystems register their command handlers using the \nshell_cmd_register()\n \n  function.  When shell calls the command handler, it passes the other tokens as arguments.\n\n\n\n\n\n\nA few commands are currently available in the shell - \ntasks\n, \nlog\n, \necho\n, \nda
 te\n and \nprompt\n.\n\n\n\n\n\n\n\n\n\n\nThe shell's second job is to handle packet framing, encoding, and decoding of newtmgr protocol messages that are\nsent over the console.  The Newtmgr serial transport package (\nmgmt/newtmgr/transport/newtmgr_shell\n) \ncalls the \nshell_nlip_input_register()\n function to register a handler that the shell calls when it \nreceives newtmgr request messages.\n\n\n\n\n\n\n\n\nCreate a sim target to check out these commands available in shell.\n\n\nuser@~/dev$ newt target create blinky_sim\nCreating target blinky_sim\nTarget blinky_sim successfully created!\nuser@~/dev$ newt target set blinky_sim name=blinky_sim\nTarget blinky_sim successfully set name to blinky_sim\nuser@~/dev$ newt target set blinky_sim arch=sim\nTarget blinky_sim successfully set arch to sim\nuser@~/dev$ newt target set blinky_sim project=blinky\nTarget blinky_sim successfully set project to blinky\nuser@~/dev$ newt target set blinky_sim bsp=hw/bsp/native\nTarget blinky_sim s
 uccessfully set bsp to hw/bsp/native\nuser@~/dev$ newt target set blinky_sim compiler_def=debug\nTarget blinky_sim successfully set compiler_def to debug\nuser@~/dev$ newt target set blinky_sim compiler=sim\nTarget blinky_sim successfully set compiler to sim\nuser@~/dev$ newt target show\nblinky_sim\n    arch: sim\n    bsp: hw/bsp/native\n    compiler: sim\n    compiler_def: debug\n    name: blinky_sim\n    project: blinky\nuser@~/dev$ newt target build blinky_sim\nBuilding target blinky_sim (project = blinky)\nCompiling case.c\nCompiling suite.c\nCompiling testutil.c\n..\n..\nBuilding project blinky\nLinking blinky.elf\nSuccessfully run!\n\nuser@~/dev$ ./project/blinky/bin/blinky_sim/blinky.elf\nuart0 at /dev/ttys005\n\n\n\n\n\nOpen up a new terminal to run minicom, a text-based serial port control and terminal emulation program. Set device name to the serial port of the target. \n\n\nuser@~$ minicom -D /dev/ttys005\nWelcome to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:
 14:21.\nPort /dev/ttys005, 11:32:17\n\nPress Meta-Z for help on special keys\n\nlog \n174578:[0] bla\n174578:[0] bab\n\ntasks\n217809:6 tasks: \n217809:  shell (prio: 3, nw: 0, flags: 0x0, ssize: 0, cswcnt: 59, tot_run_time: 0ms)\n217840:  idle (prio: 255, nw: 0, flags: 0x0, ssize: 0, cswcnt: 18763, tot_run_time: 217809ms)\n217878:  uart_poller (prio: 0, nw: 217819, flags: 0x0, ssize: 0, cswcnt: 18667, tot_run_time: 0ms)\n217923:  task1 (prio: 1, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n217953:  os_sanity (prio: 254, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n218010:  task2 (prio: 2, nw: 217709, flags: 0x3, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n\n\nprompt\nUsage: prompt [set|show] [prompt_char]\nprompt set \n\nPrompt set to: \n\n229370: \n\n\n\n\n\n\nData structures\n\n\nThis data structure is used in holding information about registered command handlers.\n\n\nstruct\n \nshell_cmd\n {\n    \nchar\n \n*sc_cmd\n;\n    \nshell_cmd_
 func_t\n \nsc_cmd_func\n;\n    \nSTAILQ_ENTRY\n(\nshell_cmd\n) \nsc_next\n;\n};\n\n\n\n\n\n\n\n\n\n\n\nElement\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nsc_cmd\n\n\nCharacter string of the command\n\n\n\n\n\n\nsc_cmd_func\n\n\nPointer to the command handler\n\n\n\n\n\n\nsc_next\n\n\nBookkeeping linkage internal for shell\n\n\n\n\n\n\n\n\nList of Functions\n\n\n\n\nThe functions available in this OS feature are:\n\n\n\n\n\n\n\n\nFunction\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nshell_cmd_register\n\n\nRegisters a handler for incoming console commands.\n\n\n\n\n\n\nshell_nlip_input_register\n\n\nRegisters a handler for incoming newtmgr messages.\n\n\n\n\n\n\nshell_nlip_output\n\n\nQueue outgoing newtmgr message for transmission.\n\n\n\n\n\n\nshell_evq_set\n\n\nSpecifies a dedicated event queue for shell events.", 
             "title": "toc"
         }, 
         {
@@ -5112,7 +5112,7 @@
         }, 
         {
             "location": "/os/modules/shell/shell/#description", 
-            "text": "The shell's first job is to direct incoming commands to other subsystems. It parses the incoming character string \ninto tokens and uses the first token to determine the subsystem command handler to call to process the command.    Subsystems register their command handlers using the  shell_cmd_register()  \n  function.  When shell calls the command handler, it passes the other tokens as arguments.    A few commands are currently available in the shell -  tasks ,  log ,  echo ,  date  and  prompt .      The shell's second job is to handle packet framing, encoding, and decoding of newtmgr protocol messages that are\nsent over the console.  The Newtmgr serial transport package ( mgmt/newtmgr/transport/newtmgr_shell ) \ncalls the  shell_nlip_input_register()  function to register a handler that the shell calls when it \nreceives newtmgr request messages.     Create a sim target to check out these commands available in shell.  user@~/dev/larva$ newt target create bli
 nky_sim\nCreating target blinky_sim\nTarget blinky_sim successfully created!\nuser@~/dev/larva$ newt target set blinky_sim name=blinky_sim\nTarget blinky_sim successfully set name to blinky_sim\nuser@~/dev/larva$ newt target set blinky_sim arch=sim\nTarget blinky_sim successfully set arch to sim\nuser@~/dev/larva$ newt target set blinky_sim project=blinky\nTarget blinky_sim successfully set project to blinky\nuser@~/dev/larva$ newt target set blinky_sim bsp=hw/bsp/native\nTarget blinky_sim successfully set bsp to hw/bsp/native\nuser@~/dev/larva$ newt target set blinky_sim compiler_def=debug\nTarget blinky_sim successfully set compiler_def to debug\nuser@~/dev/larva$ newt target set blinky_sim compiler=sim\nTarget blinky_sim successfully set compiler to sim\nuser@~/dev/larva$ newt target show\nblinky_sim\n    arch: sim\n    bsp: hw/bsp/native\n    compiler: sim\n    compiler_def: debug\n    name: blinky_sim\n    project: blinky\nuser@~/dev/larva$ newt target build blinky_sim\nBuildin
 g target blinky_sim (project = blinky)\nCompiling case.c\nCompiling suite.c\nCompiling testutil.c\n..\n..\nBuilding project blinky\nLinking blinky.elf\nSuccessfully run!\n\nuser@~/dev/larva$ ./project/blinky/bin/blinky_sim/blinky.elf\nuart0 at /dev/ttys005  Open up a new terminal to run minicom, a text-based serial port control and terminal emulation program. Set device name to the serial port of the target.   user@~$ minicom -D /dev/ttys005\nWelcome to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:14:21.\nPort /dev/ttys005, 11:32:17\n\nPress Meta-Z for help on special keys\n\nlog \n174578:[0] bla\n174578:[0] bab\n\ntasks\n217809:6 tasks: \n217809:  shell (prio: 3, nw: 0, flags: 0x0, ssize: 0, cswcnt: 59, tot_run_time: 0ms)\n217840:  idle (prio: 255, nw: 0, flags: 0x0, ssize: 0, cswcnt: 18763, tot_run_time: 217809ms)\n217878:  uart_poller (prio: 0, nw: 217819, flags: 0x0, ssize: 0, cswcnt: 18667, tot_run_time: 0ms)\n217923:  task1 (prio: 1, nw: 218710, flags: 0x0, ssize: 0, 
 cswcnt: 218, tot_run_time: 0ms)\n217953:  os_sanity (prio: 254, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n218010:  task2 (prio: 2, nw: 217709, flags: 0x3, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n\n\nprompt\nUsage: prompt [set|show] [prompt_char]\nprompt set  \nPrompt set to:  \n229370:", 
+            "text": "The shell's first job is to direct incoming commands to other subsystems. It parses the incoming character string \ninto tokens and uses the first token to determine the subsystem command handler to call to process the command.    Subsystems register their command handlers using the  shell_cmd_register()  \n  function.  When shell calls the command handler, it passes the other tokens as arguments.    A few commands are currently available in the shell -  tasks ,  log ,  echo ,  date  and  prompt .      The shell's second job is to handle packet framing, encoding, and decoding of newtmgr protocol messages that are\nsent over the console.  The Newtmgr serial transport package ( mgmt/newtmgr/transport/newtmgr_shell ) \ncalls the  shell_nlip_input_register()  function to register a handler that the shell calls when it \nreceives newtmgr request messages.     Create a sim target to check out these commands available in shell.  user@~/dev$ newt target create blinky_si
 m\nCreating target blinky_sim\nTarget blinky_sim successfully created!\nuser@~/dev$ newt target set blinky_sim name=blinky_sim\nTarget blinky_sim successfully set name to blinky_sim\nuser@~/dev$ newt target set blinky_sim arch=sim\nTarget blinky_sim successfully set arch to sim\nuser@~/dev$ newt target set blinky_sim project=blinky\nTarget blinky_sim successfully set project to blinky\nuser@~/dev$ newt target set blinky_sim bsp=hw/bsp/native\nTarget blinky_sim successfully set bsp to hw/bsp/native\nuser@~/dev$ newt target set blinky_sim compiler_def=debug\nTarget blinky_sim successfully set compiler_def to debug\nuser@~/dev$ newt target set blinky_sim compiler=sim\nTarget blinky_sim successfully set compiler to sim\nuser@~/dev$ newt target show\nblinky_sim\n    arch: sim\n    bsp: hw/bsp/native\n    compiler: sim\n    compiler_def: debug\n    name: blinky_sim\n    project: blinky\nuser@~/dev$ newt target build blinky_sim\nBuilding target blinky_sim (project = blinky)\nCompiling case
 .c\nCompiling suite.c\nCompiling testutil.c\n..\n..\nBuilding project blinky\nLinking blinky.elf\nSuccessfully run!\n\nuser@~/dev$ ./project/blinky/bin/blinky_sim/blinky.elf\nuart0 at /dev/ttys005  Open up a new terminal to run minicom, a text-based serial port control and terminal emulation program. Set device name to the serial port of the target.   user@~$ minicom -D /dev/ttys005\nWelcome to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:14:21.\nPort /dev/ttys005, 11:32:17\n\nPress Meta-Z for help on special keys\n\nlog \n174578:[0] bla\n174578:[0] bab\n\ntasks\n217809:6 tasks: \n217809:  shell (prio: 3, nw: 0, flags: 0x0, ssize: 0, cswcnt: 59, tot_run_time: 0ms)\n217840:  idle (prio: 255, nw: 0, flags: 0x0, ssize: 0, cswcnt: 18763, tot_run_time: 217809ms)\n217878:  uart_poller (prio: 0, nw: 217819, flags: 0x0, ssize: 0, cswcnt: 18667, tot_run_time: 0ms)\n217923:  task1 (prio: 1, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n217953:  os_sanity (prio: 2
 54, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n218010:  task2 (prio: 2, nw: 217709, flags: 0x3, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n\n\nprompt\nUsage: prompt [set|show] [prompt_char]\nprompt set  \nPrompt set to:  \n229370:", 
             "title": "Description"
         }, 
         {
@@ -5322,7 +5322,7 @@
         }, 
         {
             "location": "/os/modules/bootloader/bootloader/", 
-            "text": "Bootloader\n\n\nThe \"bootloader\" is the code that loads the Mynewt OS image into memory and conducts some checks before allowing the OS to be run. It manages images for the embedded system and upgrades of those images using protocols over various interfaces (e.g. serial, BLE etc.). Typically, systems with bootloaders have at least two program images coexisting on the same microcontroller, and hence must include branch code that performs a check to see if an attempt to update software is already underway and manage the progress of the process.\n\n\nThe bootloader in the Apache Mynewt project verifies the cryptographic signature of the firmware image before running it. It maintains a detailed status log for each stage of the boot process. For verification of the authenticity of the OS image, it:\n\n\n\n\nCalculates hash of the image.\n\n\nUses public key to uncover hash value from included signature. \n\n\nCompares the calculated and uncovered hashes for a match
 .\n\n\n\n\nThe \"secure bootloader\" should be placed in protected memory on a given microcontroller.\n\n\nThe Mynewt bootloader comprises two packages:\n\n\n\n\nThe bootutil library (boot/bootutil)\n\n\nThe boot application (apps/boot)\n\n\n\n\nThe Mynewt code is thus structured so that the generic bootutil library performs most of the functions of a boot loader. The final step of actually jumping to the main image is kept out of the bootutil library.  This last step should instead be implemented in an\narchitecture-specific project.  Boot loader functionality is separated in this\nmanner for the following two reasons:\n\n\n\n\nBy keeping architecture-dependent code separate, the bootutil library can be\n   reused among several boot loaders.\n\n\nBy excluding the last boot step from the library, the bootloader can be unit tested since a library can be unit tested but an applicant can't.\n\n\n\n\nLimitations\n\n\nThe boot loader currently only supports images with the following\ncha
 racteristics:\n\n\n\n\nBuilt to run from flash.\n\n\nBuild to run from a fixed location (i.e., position-independent).\n\n\n\n\nImage Format\n\n\nThe following definitions describe the image header format.\n\n\n#define IMAGE_MAGIC                 0x96f3b83c\n\n\n#define IMAGE_MAGIC_NONE            0xffffffff\n\n\n\nstruct\n \nimage_version\n {\n    \nuint8_t\n \niv_major\n;\n    \nuint8_t\n \niv_minor\n;\n    \nuint16_t\n \niv_revision\n;\n    \nuint32_t\n \niv_build_num\n;\n};\n\n\n/** Image header.  All fields are in little endian byte order. */\n\n\nstruct\n \nimage_header\n {\n    \nuint32_t\n \nih_magic\n;\n    \nuint16_t\n \nih_tlv_size\n; \n/* Trailing TLVs */\n\n    \nuint8_t\n  \nih_key_id\n;\n    \nuint8_t\n  \n_pad1\n;\n    \nuint16_t\n \nih_hdr_s\n \nbok@bok\n.\nnet\n\n\n35\nd33\n\n\n \nericmanganaro@gmail\n.\ncom\n\n\n42\nd39\n\n\n \ntam@proxy\n.\nco\n\n\n55\nd51\n\n\n \nnathan@natb1\n.\ncom\n\n\n110\nd105\n\n\n \nrvs@apache\n.\norgize\n;\n    \nuint16_t\n \n_pad2\n;\n  
   \nuint32_t\n \nih_img_size\n; \n/* Does not include header. */\n\n    \nuint32_t\n \nih_flags\n;\n    \nstruct\n \nimage_version\n \nih_ver\n;\n    \nuint32_t\n \n_pad3\n;\n};\n\n\n\n\n\nThe \nih_hdr_size\n field indicates the length of the header, and therefore the\noffset of the image itself.  This field provides for backwards compatibility in\ncase of changes to the format of the image header.\n\n\nThe following are the image header flags available.\n\n\n#define IMAGE_F_PIC                   0x00000001\n\n\n#define IMAGE_F_SHA256                0x00000002    \n/* Image contains hash TLV */\n\n\n#define IMAGE_F_PKCS15_RSA2048_SHA256 0x00000004 \n/* PKCS15 w/RSA and SHA */\n\n\n#define IMAGE_F_ECDSA224_SHA256       0x00000008  \n/* ECDSA256 over SHA256 */\n\n\n#define IMAGE_F_NON_BOOTABLE          0x00000010\n\n\n#define IMAGE_HEADER_SIZE           32\n\n\n\n\n\n\nOptional type-length-value records (TLVs) containing image metadata are placed\nafter the end of the image. For examp
 le, security data gets added as a footer at the end of the image.\n\n\n/** Image trailer TLV format. All fields in little endian. */\n\n\nstruct\n \nimage_tlv\n {\n    \nuint8_t\n  \nit_type\n;   \n/* IMAGE_TLV_[...]. */\n\n    \nuint8_t\n  \n_pad\n;\n    \nuint16_t\n \nit_len\n     \n/* Data length (not including TLV header). */\n\n};\n\n\n/*\n\n\n * Image trailer TLV types.\n\n\n */\n\n\n#define IMAGE_TLV_SHA256            1   \n/* SHA256 of image hdr and body */\n\n\n#define IMAGE_TLV_RSA2048           2   \n/* RSA2048 of hash output */\n\n\n#define IMAGE_TLV_ECDSA224          3   \n/* ECDSA of hash output */\n\n\n\n\n\n\nFlash Map\n\n\nA Mynewt device's flash is partitioned according to its \nflash map\n.  At a high\nlevel, the flash map maps numeric IDs to \nflash areas\n.  A flash area is a\nregion of disk with the following properties:\n\n\n1. An area can be fully erased without affecting any other areas.\n2. A write to one area does not restrict writes to other areas.\n\n\n\
 n\n\nThe boot loader uses the following flash areas:\n\n\n#define FLASH_AREA_BOOTLOADER                    0\n\n\n#define FLASH_AREA_IMAGE_0                       1\n\n\n#define FLASH_AREA_IMAGE_1                       2\n\n\n#define FLASH_AREA_IMAGE_SCRATCH                 3\n\n\n\n\n\n\nImage Slots\n\n\nA portion of the flash memory is partitioned into two image slots: a primary\nslot and a secondary slot.  The boot loader will only run an image from the\nprimary slot, so images must be built such that they can run from that fixed\nlocation in flash.  If the boot loader needs to run the image resident in the\nsecondary slot, it must swap the two images in flash prior to booting.\n\n\nIn addition to the two image slots, the boot loader requires a scratch area to\nallow for reliable image swapping.\n\n\nBoot States\n\n\nLogically, you can think of a pair of flags associated with each image slot:\npending and confirmed.  On startup, the boot loader determines the state of the\ndevice
  by inspecting each pair of flags.  These flags have the following\nmeanings:\n\n\n\n\npending: image gets tested on next reboot; absent subsequent confirm command,\n           revert to original image on second reboot.\n\n\nconfirmed: always use image unless excluded by a test image.\n\n\n\n\nIn English, when the user wants to run the secondary image, they set the\npending flag for the second slot and reboot the device.  On startup, the boot\nloader will swap the two images in flash, clear the secondary slot's pending\nflag, and run the newly-copied image in slot 0.  This is a temporary state; if\nthe device reboots again, the boot loader swaps the images back to their\noriginal slots and boots into the original image.  If the user doesn't want to\nrevert to the original state, they can make the current state permanent by\nsetting the confirmed flag in slot 0.\n\n\nSwitching to an alternate image is a two-step process (set + confirm) to\nprevent a device from becoming \"bricked\" b
 y bad firmware.  If the device\ncrashes immediately upon booting the second image, the boot loader reverts to\nthe working image, rather than repeatedly rebooting into the bad image.\n\n\nThe following set of tables illustrate the three possible states that the\ndevice can be in:\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |        |\n     confirmed |   X    |        |\n---------------+--------+--------\n\nImage 0 confirmed;               |\nNo change on reboot              |\n---------------------------------\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |   X    |\n     confirmed |   X    |        |\n---------------+--------+--------\n\nImage 0 confirmed;               |\nTest image 1 on next reboot      |\n---------------------------------\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |        |\n     confirmed |   
      |   X    |\n---------------+--------+--------\n\nTesting image 0;                 |\nRevert to image 1 on next reboot |\n---------------------------------\n\n\n\n\n\n\nBoot Vector\n\n\nAt startup, the boot loader determines which of the above three boot states a device is in by inspecting the boot vector.  The boot vector consists of two\nrecords (called \"image trailers\"), one written at the end of each image slot.\nAn image trailer has the following structure:\n\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~                       MAGIC (16 octets)                       ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~                                                               ~\n~             Swap status (128 * min-write-size * 3)            ~\n~                                                     
           ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Copy done   |     0xff padding (up to min-write-sz - 1)     ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Image OK    |     0xff padding (up to min-write-sz - 1)     ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n\n\n\nThese records are at the end of each image slot.  The offset immediately\nfollowing such a record represents the start of the next flash area.\n\n\nNote: \"min-write-size\" is a property of the flash hardware.  If the hardware\nallows individual bytes to be written at arbitrary addresses, then\nmin-write-size is 1.  If the hardware only allows writes at even addresses,\nthen min-write-size is 2, and so on.\n\n\nThe fields are defined as follows:\n\n\n\n\n\n\nMAGIC: The following 16 bytes, written in host-byte-order:\n\n\nconst uint32_t boot_img_magic[4] = {\n    0xf395c277,\n    0x7fefd260,\n    0x0f505235,\n    0x8079b62c,\n};\n\n
 \n\n\n\n\nSwap status: A series of single-byte records.  Each record corresponds to a\nflash sector in an image slot.  A swap status byte indicate the location of\nthe corresponding sector data.  During an image swap, image data is moved one\nsector at a time.  The swap status is necessary for resuming a swap operation\nif the device rebooted before a swap operation completed.\n\n\n\n\n\n\nCopy done: A single byte indicating whether the image in this slot is\ncomplete (0x01=d\n bok@bok.net\n35d33\n\n ericmanganaro@gmail.com\n42d39\n\n tam@proxy.co\n55d51\n\n nathan@natb1.com\n110d105\n\n rvs@apache.orgone; 0xff=not done).\n\n\n\n\n\n\nImage OK: A single byte indicating whether the image in this slot has been\nconfirmed as good by the user (0x01=confirmed; 0xff=not confirmed).\n\n\n\n\n\n\nThe boot vector records are structured around the limitations imposed by flash\nhardware.  As a consequence, they do not have a very intuitive design, and it\nis difficult to get a sense of the sta
 te of the device just by looking at the\nboot vector.  It is better to map all the possible vector states to the swap types (None, Test, Revert)\nvia a set of tables.  These tables are reproduced below.\nIn these tables, the \"pending\" and \"confirmed\" flags are shown for illustrative\npurposes; they are not actually present in the boot vector.\n\n\nState I\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Unset  | Unset  |\n        image-ok | Any    | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: none                        |\n-----------------------------------\n\n\n\nState II\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Any    | Good   |\n        image-ok | Any    | N/A    |\n-----------------+--------+--------\n\n         pending |        |   X    |\n      co
 nfirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: test                        |\n-----------------------------------\n\n\n\nState III\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Good   | Unset  |\n        image-ok | 0xff   | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |        |   X    |\n-----------------+--------+--------\n\n swap: revert (test image running) |\n-----------------------------------\n\n\n\nState IV\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Good   | Unset  |\n        image-ok | 0x01   | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: none (confirmed test image) |\n-----------------------------------\n\n\n\n\n\n\nHigh-level Operation\n\n\nWith the terms defin
 ed, we can now explore the boot loader's operation.  First,\na high-level overview of the boot process is presented.  Then, the following\nsections describe each step of the process in more detail.\n\n\nProcedure:\n\n\nA. Inspect swap status region; is an interrupted swap is being resumed?\n    Yes: Complete the partial swap operation; skip to step C.\n    No: Proceed to step B.\n\n\nB. Insect boot vector; is a swap requested?\n    Yes.\n        1. Is the requested image valid (integrity and security check)?\n            Yes.\n                a. Perform swap operation.\n                b. Persist completion of swap procedure to boot vector.\n                c. Proceed to step C.\n            No.\n                a. Erase invalid image.\n                b. Persist failure of swap procedure to boot vector.\n                c. Proceed to step C.\n    No: Proceed to step C.\n\n\nC. Boot into image in slot 0.\n\n\nImage Swapping\n\n\nThe boot loader swaps the contents of the two image sl
 ots for two reasons:\n    * User has issued an \"image test\" operation; the image in slot-1 should be\n      run once (state II).\n    * Test image rebooted without being confirmed; the boot loader should\n      revert to the original image currently in slot-1 (state III).\n\n\nIf the boot vector indicates that the image in the secondary slot should be\nrun, the boot loader needs to copy it to the primary slot.  The image currently\nin the primary slot also needs to be retained in flash so that it can be used\nlater.  Furthermore, both images need to be recoverable if the boot loader\nresets in the middle of the swap operation.  The two images are swapped\naccording to the following procedure:\n\n\n1. Determine how many flash sectors each image slot consists of.  This\n   number must be the same for both slots.\n2. Iterate the list of sector indices in descending order (i.e., starting\n   with the greatest index); current element = \nindex\n.\n    b. Erase scratch area.\n    c. Cop
 y slot0[index] to scratch area.\n    d. Write updated swap status (i).\n\n    e. Erase slot1[index]\n    f. Copy slot0[index] to slot1[index]\n        - If these are the last sectors (i.e., first swap being perfomed),\n          copy the full sector *except* the image trailer.\n        - Else, copy entire sector contents.\n    g. Write updated swap status (ii).\n\n    h. Erase slot0[index].\n    i. Copy scratch area slot0[index].\n    j. Write updated swap status (iii).\n\n3. Persist completion of swap procedure to slot 0 image trailer.\n\n\n\n\n\nThe additional caveats in step 2f are necessary so that the slot 1 image trailer\ncan be written by the user at a later time.  With the image trailer unwritten,\nthe user can test the image in slot 1 (i.e., transition to state II).\n\n\nThe particulars of step 3 vary depending on whether an image is being tested or\nreverted:\n    * test:\n        o Write slot0.copy_done = 1\n        (should now be in state III)\n\n\n* revert:\n    o Write
  slot0.magic = BOOT_MAGIC\n    o Write slot0.copy_done = 1\n    o Write slot0.image_ok = 1\n    (should now be in state IV)\n\n\n\n\n\nSwap Status\n\n\nThe swap status region allows the boot loader to recover in case it restarts in\nthe middle of an image swap operation.  The swap status region consists of a\nseries of single-byte records.  These records are written independently, and\ntherefore must be padded according to the minimum write size imposed by the\nflash hardware.  In the below figure, a min-write-size of 1 is assumed for\nsimplicity.  The structure of the swap status region is illustrated below.  In\nthis figure, a min-write-size of 1 is assumed for simplicity.\n\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec127,state 0 |sec127,state 1 |sec127,state 2 |sec126,state 0 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
 +-+-+-+-+-+-+-+-+-+-+\n|sec126,state 1 |sec126,state 2 |sec125,state 0 |sec125,state 1 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec125,state 2 |                                               |\n+-+-+-+-+-+-+-+-+                                               +\n~                                                               ~\n~               [Records for indices 124 through 1              ~\n~                                                               ~\n~               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~               |sec000,state 0 |sec000,state 1 |sec000,state 2 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n\n\n\nAnd now, in English...\n\n\nEach image slot is partitioned into a sequence of flash sectors.  If we were to\nenumerate the sectors in a single slot, starting at 0, we would have a list of\nsector indices.  Since there are two image slots, each sector index would\ncorrespond to a pair of sector
 s.  For example, sector index 0 corresponds to\nthe first sector in slot 0 and the first sector in slot 1.  Furthermore, we\nimpose a limit of 128 indices.  If an image slot consists of more than 128\nsectors, the flash layout is not compatible with this boot loader.  Finally,\nreverse the list of indices such that the list starts with index 127 and ends\nwith 0.  The swap status region is a representation of this reversed list.\n\n\nDuring a swap operation, each sector index transitions through four separate\nstates:\n    0. slot 0: image 0,   slot 1: image 1,   scratch: N/A\n    1. slot 0: image 0,   slot 1: N/A,       scratch: image 1 (1-\ns, erase 1)\n    2. slot 0: N/A,       slot 1: image 0,   scratch: image 1 (0-\n1, erase 0)\n    3. slot 0: image 1,   slot 1: image 0,   scratch: N/A     (s-\n0)\n\n\nEach time a sector index transitions to a new state, the boot loader writes a\nrecord to the swap status region.  Logically, the boot loader only needs one\nrecord per sector ind
 ex to keep track of the current swap state.  However, due\nto limitations imposed by flash hardware, a record cannot be overwritten when\nan index's state changes.  To solve this problem, the boot loader uses three\nrecords per sector index rather than just one.\n\n\nEach sector-state pair is represented as a set of three records.  The record\nvalues map to the above four states as follows\n\n\n        | rec0 | rec1 | rec2\n--------+------+------+------\nstate 0 | 0xff | 0xff | 0xff\nstate 1 | 0x01 | 0xff | 0xff\nstate 2 | 0x01 | 0x02 | 0xff\nstate 3 | 0x01 | 0x02 | 0x03\n\n\n\n\n\nThe swap status region can accommodate 128 sector indices.  Hence, the size of\nthe region, in bytes, is 128 * min-write-size * 3.  The number 128 is chosen\nsomewhat arbitrarily and will likely be made configurable.  The only\nrequirement for the index count is that is is great enough to account for a\nmaximum-sized image (i.e., at least as great as the total sector count in an\nimage slot).  If a device
 's image slots use less than 128 sectors, the first\nrecord that gets written will be somewhere in the middle of the region.  For\nexample, if a slot uses 64 sectors, the first sector index that gets swapped is\n63, which corresponds to the exact halfway point within the region.\n\n\nReset Recovery\n\n\nIf the boot loader resets in the middle of a swap operation, the two images may\nbe discontiguous in flash.  Bootutil recovers from this condition by using the\nboot vector to determine how the image parts are distributed in flash.\n\n\nThe first step is determine where the relevant swap status region is located.\nBecause this region is embedded within the image slots, its location in flash\nchanges during a swap operation.  The below set of tables map boot vector\ncontents to swap status location.  In these tables, the \"source\" field\nindicates where the swap status region is located.\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Go
 od       | Any        |\ncopy-done | 0x01       | N/A        |\n----------+------------+------------\n\nsource: none                        |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Good       | Any        |\ncopy-done | 0xff       | N/A        |\n----------+------------+------------\n\nsource: slot 0                      |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Any        | Good       |\ncopy-done | Any        | N/A        |\n----------+------------+------------\n\nsource: scratch                     |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Unset      | Any        |\ncopy-done | 0xff       | N/A        |\n----------+------------+------------|\nsource: varies                      |\n------------------------
 ------------+------------------------------+\nThis represents one of two cases:                                  |\no No swaps ever (no status to read, so no harm in checking).       |\no Mid-revert; status in slot 0.                                    |\n-------------------------------------------------------------------\n\n\n\n\n\n\nIf the swap status region indicates that the images are not contiguous,\nbootutil completes the swap operation that was in progress when the system was\nreset.  In other words, it applies the procedure defined in the previous\nsection, moving image 1 into slot 0 and image 0 into slot 1.  If the boot\nstatus file indicates that an image part is present in the scratch area, this\npart is copied into the correct location by starting at step e or step h in the\narea-swap procedure, depending on whether the part belongs to image 0 or image\n1.\n\n\nAfter the swap operation has been completed, the boot loader proceeds as though\nit had just been started.\n\n
 \nIntegrity Check\n\n\nAn image is checked for integrity immediately before it gets copied into the\nprimary slot.  If the boot loader doesn't perform an image swap, then it\ndoesn't perform an integrity check.\n\n\nDuring the integrity check, the boot loader verifies the following aspects of\nan image:\n    * 32-bit magic number must be correct (0x96f3b83c).\n    * Image must contain a SHA256 TLV.\n    * Calculated SHA256 must matche SHA256 TLV contents.\n    * Image \nmay\n contain a signature TLV.  If it does, its contents must be\n      verifiable using a key embedded in the boot loader.\n\n\nImage Signing and Verification\n\n\nAs indicated above, the final step of the integrity check is signature\nverification.  The boot loader can have one or more public keys embedded in it\nat build time.  During signature verification, the boot loader verifies that an\nimage was signed with a private key that corresponds to one of its public keys.\nThe image signature TLV indicates the index
  of the key that is has been signed\nwith.  The boot loader uses this index to identify the corresponding public\nkey.\n\n\nFor information on embedding public keys in the boot loader, as well as\nproducing signed images, see: boot/bootutil/signed_images.md", 
+            "text": "Bootloader\n\n\nThe \"bootloader\" is the code that loads the Mynewt OS image into memory and conducts some checks before allowing the OS to be run. It manages images for the embedded system and upgrades of those images using protocols over various interfaces (e.g. serial, BLE etc.). Typically, systems with bootloaders have at least two program images coexisting on the same microcontroller, and hence must include branch code that performs a check to see if an attempt to update software is already underway and manage the progress of the process.\n\n\nThe bootloader in the Apache Mynewt project verifies the cryptographic signature of the firmware image before running it. It maintains a detailed status log for each stage of the boot process. For verification of the authenticity of the OS image, it:\n\n\n\n\nCalculates hash of the image.\n\n\nUses public key to uncover hash value from included signature. \n\n\nCompares the calculated and uncovered hashes for a match
 .\n\n\n\n\nThe \"secure bootloader\" should be placed in protected memory on a given microcontroller.\n\n\nThe Mynewt bootloader comprises two packages:\n\n\n\n\nThe bootutil library (boot/bootutil)\n\n\nThe boot application (apps/boot)\n\n\n\n\nThe Mynewt code is thus structured so that the generic bootutil library performs most of the functions of a boot loader. The final step of actually jumping to the main image is kept out of the bootutil library.  This last step should instead be implemented in an\narchitecture-specific project.  Boot loader functionality is separated in this\nmanner for the following two reasons:\n\n\n\n\nBy keeping architecture-dependent code separate, the bootutil library can be\n   reused among several boot loaders.\n\n\nBy excluding the last boot step from the library, the bootloader can be unit tested since a library can be unit tested but an applicant can't.\n\n\n\n\nLimitations\n\n\nThe boot loader currently only supports images with the following\ncha
 racteristics:\n\n\n\n\nBuilt to run from flash.\n\n\nBuild to run from a fixed location (i.e., position-independent).\n\n\n\n\nImage Format\n\n\nThe following definitions describe the image header format.\n\n\n#define IMAGE_MAGIC                 0x96f3b83c\n\n\n#define IMAGE_MAGIC_NONE            0xffffffff\n\n\n\nstruct\n \nimage_version\n {\n    \nuint8_t\n \niv_major\n;\n    \nuint8_t\n \niv_minor\n;\n    \nuint16_t\n \niv_revision\n;\n    \nuint32_t\n \niv_build_num\n;\n};\n\n\n/** Image header.  All fields are in little endian byte order. */\n\n\nstruct\n \nimage_header\n {\n    \nuint32_t\n \nih_magic\n;\n    \nuint16_t\n \nih_tlv_size\n; \n/* Trailing TLVs */\n\n    \nuint8_t\n  \nih_key_id\n;\n    \nuint8_t\n  \n_pad1\n;\n    \nuint16_t\n \nih_hdr_s\n \nbok@bok\n.\nnet\n\n    \nuint16_t\n \n_pad2\n;\n    \nuint32_t\n \nih_img_size\n; \n/* Does not include header. */\n\n    \nuint32_t\n \nih_flags\n;\n    \nstruct\n \nimage_version\n \nih_ver\n;\n    \nuint32_t\n \n_pad3\n;\n
 };\n\n\n\n\n\nThe \nih_hdr_size\n field indicates the length of the header, and therefore the\noffset of the image itself.  This field provides for backwards compatibility in\ncase of changes to the format of the image header.\n\n\nThe following are the image header flags available.\n\n\n#define IMAGE_F_PIC                   0x00000001\n\n\n#define IMAGE_F_SHA256                0x00000002    \n/* Image contains hash TLV */\n\n\n#define IMAGE_F_PKCS15_RSA2048_SHA256 0x00000004 \n/* PKCS15 w/RSA and SHA */\n\n\n#define IMAGE_F_ECDSA224_SHA256       0x00000008  \n/* ECDSA256 over SHA256 */\n\n\n#define IMAGE_F_NON_BOOTABLE          0x00000010\n\n\n#define IMAGE_HEADER_SIZE           32\n\n\n\n\n\n\nOptional type-length-value records (TLVs) containing image metadata are placed\nafter the end of the image. For example, security data gets added as a footer at the end of the image.\n\n\n/** Image trailer TLV format. All fields in little endian. */\n\n\nstruct\n \nimage_tlv\n {\n    \nuint8
 _t\n  \nit_type\n;   \n/* IMAGE_TLV_[...]. */\n\n    \nuint8_t\n  \n_pad\n;\n    \nuint16_t\n \nit_len\n     \n/* Data length (not including TLV header). */\n\n};\n\n\n/*\n\n\n * Image trailer TLV types.\n\n\n */\n\n\n#define IMAGE_TLV_SHA256            1   \n/* SHA256 of image hdr and body */\n\n\n#define IMAGE_TLV_RSA2048           2   \n/* RSA2048 of hash output */\n\n\n#define IMAGE_TLV_ECDSA224          3   \n/* ECDSA of hash output */\n\n\n\n\n\n\nFlash Map\n\n\nA Mynewt device's flash is partitioned according to its \nflash map\n.  At a high\nlevel, the flash map maps numeric IDs to \nflash areas\n.  A flash area is a\nregion of disk with the following properties:\n\n\n1. An area can be fully erased without affecting any other areas.\n2. A write to one area does not restrict writes to other areas.\n\n\n\n\n\nThe boot loader uses the following flash areas:\n\n\n#define FLASH_AREA_BOOTLOADER                    0\n\n\n#define FLASH_AREA_IMAGE_0                       1\n\n\n#defi
 ne FLASH_AREA_IMAGE_1                       2\n\n\n#define FLASH_AREA_IMAGE_SCRATCH                 3\n\n\n\n\n\n\nImage Slots\n\n\nA portion of the flash memory is partitioned into two image slots: a primary\nslot and a secondary slot.  The boot loader will only run an image from the\nprimary slot, so images must be built such that they can run from that fixed\nlocation in flash.  If the boot loader needs to run the image resident in the\nsecondary slot, it must swap the two images in flash prior to booting.\n\n\nIn addition to the two image slots, the boot loader requires a scratch area to\nallow for reliable image swapping.\n\n\nBoot States\n\n\nLogically, you can think of a pair of flags associated with each image slot:\npending and confirmed.  On startup, the boot loader determines the state of the\ndevice by inspecting each pair of flags.  These flags have the following\nmeanings:\n\n\n\n\npending: image gets tested on next reboot; absent subsequent confirm command,\n         
   revert to original image on second reboot.\n\n\nconfirmed: always use image unless excluded by a test image.\n\n\n\n\nIn English, when the user wants to run the secondary image, they set the\npending flag for the second slot and reboot the device.  On startup, the boot\nloader will swap the two images in flash, clear the secondary slot's pending\nflag, and run the newly-copied image in slot 0.  This is a temporary state; if\nthe device reboots again, the boot loader swaps the images back to their\noriginal slots and boots into the original image.  If the user doesn't want to\nrevert to the original state, they can make the current state permanent by\nsetting the confirmed flag in slot 0.\n\n\nSwitching to an alternate image is a two-step process (set + confirm) to\nprevent a device from becoming \"bricked\" by bad firmware.  If the device\ncrashes immediately upon booting the second image, the boot loader reverts to\nthe working image, rather than repeatedly rebooting into the bad
  image.\n\n\nThe following set of tables illustrate the three possible states that the\ndevice can be in:\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |        |\n     confirmed |   X    |        |\n---------------+--------+--------\n\nImage 0 confirmed;               |\nNo change on reboot              |\n---------------------------------\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |   X    |\n     confirmed |   X    |        |\n---------------+--------+--------\n\nImage 0 confirmed;               |\nTest image 1 on next reboot      |\n---------------------------------\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |        |\n     confirmed |        |   X    |\n---------------+--------+--------\n\nTesting image 0;                 |\nRevert to image 1 on next reboot |\n---------------------------------\n\n\n\n\n\n\nBo
 ot Vector\n\n\nAt startup, the boot loader determines which of the above three boot states a device is in by inspecting the boot vector.  The boot vector consists of two\nrecords (called \"image trailers\"), one written at the end of each image slot.\nAn image trailer has the following structure:\n\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~                       MAGIC (16 octets)                       ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~                                                               ~\n~             Swap status (128 * min-write-size * 3)            ~\n~                                                               ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Copy done   |     0xff padding (up to min-write-sz - 1)     ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Image OK    |     0xff padding (up to min-write-sz - 1)     ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n\n\n\nThese records are at the end of each image slot.  The offset immediately\nfollowing such a record represents the start of the next flash area.\n\n\nNote: \"min-write-size\" is a property of the flash hardware.  If the hardware\nallows individual bytes to be written at arbitrary addresses, then\nmin-write-size is 1.  If the hardware only allows writes at even addresses,\nthen min-write-size is 2, and so on.\n\n\nThe fields are defined as follows:\n\n\n\n\n\n\nMAGIC: The following 16 bytes, written in host-byte-order:\n\n\nconst uint32_t boot_img_magic[4] = {\n    0xf395c277,\n    0x7fefd260,\n    0x0f505235,\n    0x8079b62c,\n};\n\n\n\n\n\n\nSwap status: A series of single-byte records.  Each record corresponds to a\nflash sector in an image slot.  A swap status byte indicate the location of\nthe corresp
 onding sector data.  During an image swap, image data is moved one\nsector at a time.  The swap status is necessary for resuming a swap operation\nif the device rebooted before a swap operation completed.\n\n\n\n\n\n\nCopy done: A single byte indicating whether the image in this slot is\ncomplete (0x01=d\n bok@bok.net\n35d33\n\n ericmanganaro@gmail.com\n42d39\n\n tam@proxy.co\n55d51\n\n nathan@natb1.com\n110d105\n\n rvs@apache.orgone; 0xff=not done).\n\n\n\n\n\n\nImage OK: A single byte indicating whether the image in this slot has been\nconfirmed as good by the user (0x01=confirmed; 0xff=not confirmed).\n\n\n\n\n\n\nThe boot vector records are structured around the limitations imposed by flash\nhardware.  As a consequence, they do not have a very intuitive design, and it\nis difficult to get a sense of the state of the device just by looking at the\nboot vector.  It is better to map all the possible vector states to the swap types (None, Test, Revert)\nvia a set of tables.  These t
 ables are reproduced below.\nIn these tables, the \"pending\" and \"confirmed\" flags are shown for illustrative\npurposes; they are not actually present in the boot vector.\n\n\nState I\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Unset  | Unset  |\n        image-ok | Any    | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: none                        |\n-----------------------------------\n\n\n\nState II\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Any    | Good   |\n        image-ok | Any    | N/A    |\n-----------------+--------+--------\n\n         pending |        |   X    |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: test                        |\n-----------------------------------\n\n\n\nState III\n              
    | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Good   | Unset  |\n        image-ok | 0xff   | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |        |   X    |\n-----------------+--------+--------\n\n swap: revert (test image running) |\n-----------------------------------\n\n\n\nState IV\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Good   | Unset  |\n        image-ok | 0x01   | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: none (confirmed test image) |\n-----------------------------------\n\n\n\n\n\n\nHigh-level Operation\n\n\nWith the terms defined, we can now explore the boot loader's operation.  First,\na high-level overview of the boot process is presented.  Then, the following\nsections describe each step of the p
 rocess in more detail.\n\n\nProcedure:\n\n\nA. Inspect swap status region; is an interrupted swap is being resumed?\n    Yes: Complete the partial swap operation; skip to step C.\n    No: Proceed to step B.\n\n\nB. Insect boot vector; is a swap requested?\n    Yes.\n        1. Is the requested image valid (integrity and security check)?\n            Yes.\n                a. Perform swap operation.\n                b. Persist completion of swap procedure to boot vector.\n                c. Proceed to step C.\n            No.\n                a. Erase invalid image.\n                b. Persist failure of swap procedure to boot vector.\n                c. Proceed to step C.\n    No: Proceed to step C.\n\n\nC. Boot into image in slot 0.\n\n\nImage Swapping\n\n\nThe boot loader swaps the contents of the two image slots for two reasons:\n    * User has issued an \"image test\" operation; the image in slot-1 should be\n      run once (state II).\n    * Test image rebooted without being con
 firmed; the boot loader should\n      revert to the original image currently in slot-1 (state III).\n\n\nIf the boot vector indicates that the image in the secondary slot should be\nrun, the boot loader needs to copy it to the primary slot.  The image currently\nin the primary slot also needs to be retained in flash so that it can be used\nlater.  Furthermore, both images need to be recoverable if the boot loader\nresets in the middle of the swap operation.  The two images are swapped\naccording to the following procedure:\n\n\n1. Determine how many flash sectors each image slot consists of.  This\n   number must be the same for both slots.\n2. Iterate the list of sector indices in descending order (i.e., starting\n   with the greatest index); current element = \nindex\n.\n    b. Erase scratch area.\n    c. Copy slot0[index] to scratch area.\n    d. Write updated swap status (i).\n\n    e. Erase slot1[index]\n    f. Copy slot0[index] to slot1[index]\n        - If these are the last 
 sectors (i.e., first swap being perfomed),\n          copy the full sector *except* the image trailer.\n        - Else, copy entire sector contents.\n    g. Write updated swap status (ii).\n\n    h. Erase slot0[index].\n    i. Copy scratch area slot0[index].\n    j. Write updated swap status (iii).\n\n3. Persist completion of swap procedure to slot 0 image trailer.\n\n\n\n\n\nThe additional caveats in step 2f are necessary so that the slot 1 image trailer\ncan be written by the user at a later time.  With the image trailer unwritten,\nthe user can test the image in slot 1 (i.e., transition to state II).\n\n\nThe particulars of step 3 vary depending on whether an image is being tested or\nreverted:\n    * test:\n        o Write slot0.copy_done = 1\n        (should now be in state III)\n\n\n* revert:\n    o Write slot0.magic = BOOT_MAGIC\n    o Write slot0.copy_done = 1\n    o Write slot0.image_ok = 1\n    (should now be in state IV)\n\n\n\n\n\nSwap Status\n\n\nThe swap status region 
 allows the boot loader to recover in case it restarts in\nthe middle of an image swap operation.  The swap status region consists of a\nseries of single-byte records.  These records are written independently, and\ntherefore must be padded according to the minimum write size imposed by the\nflash hardware.  In the below figure, a min-write-size of 1 is assumed for\nsimplicity.  The structure of the swap status region is illustrated below.  In\nthis figure, a min-write-size of 1 is assumed for simplicity.\n\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec127,state 0 |sec127,state 1 |sec127,state 2 |sec126,state 0 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec126,state 1 |sec126,state 2 |sec125,state 0 |sec125,state 1 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec125,state 2 | 
                                               |\n+-+-+-+-+-+-+-+-+                                               +\n~                                                               ~\n~               [Records for indices 124 through 1              ~\n~                                                               ~\n~               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~               |sec000,state 0 |sec000,state 1 |sec000,state 2 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n\n\n\nAnd now, in English...\n\n\nEach image slot is partitioned into a sequence of flash sectors.  If we were to\nenumerate the sectors in a single slot, starting at 0, we would have a list of\nsector indices.  Since there are two image slots, each sector index would\ncorrespond to a pair of sectors.  For example, sector index 0 corresponds to\nthe first sector in slot 0 and the first sector in slot 1.  Furthermore, we\nimpose a limit of 128 indices.  If an image slot c
 onsists of more than 128\nsectors, the flash layout is not compatible with this boot loader.  Finally,\nreverse the list of indices such that the list starts with index 127 and ends\nwith 0.  The swap status region is a representation of this reversed list.\n\n\nDuring a swap operation, each sector index transitions through four separate\nstates:\n    0. slot 0: image 0,   slot 1: image 1,   scratch: N/A\n    1. slot 0: image 0,   slot 1: N/A,       scratch: image 1 (1-\ns, erase 1)\n    2. slot 0: N/A,       slot 1: image 0,   scratch: image 1 (0-\n1, erase 0)\n    3. slot 0: image 1,   slot 1: image 0,   scratch: N/A     (s-\n0)\n\n\nEach time a sector index transitions to a new state, the boot loader writes a\nrecord to the swap status region.  Logically, the boot loader only needs one\nrecord per sector index to keep track of the current swap state.  However, due\nto limitations imposed by flash hardware, a record cannot be overwritten when\nan index's state changes.  To solve t
 his problem, the boot loader uses three\nrecords per sector index rather than just one.\n\n\nEach sector-state pair is represented as a set of three records.  The record\nvalues map to the above four states as follows\n\n\n        | rec0 | rec1 | rec2\n--------+------+------+------\nstate 0 | 0xff | 0xff | 0xff\nstate 1 | 0x01 | 0xff | 0xff\nstate 2 | 0x01 | 0x02 | 0xff\nstate 3 | 0x01 | 0x02 | 0x03\n\n\n\n\n\nThe swap status region can accommodate 128 sector indices.  Hence, the size of\nthe region, in bytes, is 128 * min-write-size * 3.  The number 128 is chosen\nsomewhat arbitrarily and will likely be made configurable.  The only\nrequirement for the index count is that is is great enough to account for a\nmaximum-sized image (i.e., at least as great as the total sector count in an\nimage slot).  If a device's image slots use less than 128 sectors, the first\nrecord that gets written will be somewhere in the middle of the region.  For\nexample, if a slot uses 64 sectors, the firs
 t sector index that gets swapped is\n63, which corresponds to the exact halfway point within the region.\n\n\nReset Recovery\n\n\nIf the boot loader resets in the middle of a swap operation, the two images may\nbe discontiguous in flash.  Bootutil recovers from this condition by using the\nboot vector to determine how the image parts are distributed in flash.\n\n\nThe first step is determine where the relevant swap status region is located.\nBecause this region is embedded within the image slots, its location in flash\nchanges during a swap operation.  The below set of tables map boot vector\ncontents to swap status location.  In these tables, the \"source\" field\nindicates where the swap status region is located.\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Good       | Any        |\ncopy-done | 0x01       | N/A        |\n----------+------------+------------\n\nsource: none                        |\n--------------------------------
 ----\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Good       | Any        |\ncopy-done | 0xff       | N/A        |\n----------+------------+------------\n\nsource: slot 0                      |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Any        | Good       |\ncopy-done | Any        | N/A        |\n----------+------------+------------\n\nsource: scratch                     |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Unset      | Any        |\ncopy-done | 0xff       | N/A        |\n----------+------------+------------|\nsource: varies                      |\n------------------------------------+------------------------------+\nThis represents one of two cases:                                  |\no No swaps ever (no status to read, so no harm in checking)
 .       |\no Mid-revert; status in slot 0.                                    |\n-------------------------------------------------------------------\n\n\n\n\n\n\nIf the swap status region indicates that the images are not contiguous,\nbootutil completes the swap operation that was in progress when the system was\nreset.  In other words, it applies the procedure defined in the previous\nsection, moving image 1 into slot 0 and image 0 into slot 1.  If the boot\nstatus file indicates that an image part is present in the scratch area, this\npart is copied into the correct location by starting at step e or step h in the\narea-swap procedure, depending on whether the part belongs to image 0 or image\n1.\n\n\nAfter the swap operation has been completed, the boot loader proceeds as though\nit had just been started.\n\n\nIntegrity Check\n\n\nAn image is checked for integrity immediately before it gets copied into the\nprimary slot.  If the boot loader doesn't perform an image swap, then it\n
 doesn't perform an integrity check.\n\n\nDuring the integrity check, the boot loader verifies the following aspects of\nan image:\n    * 32-bit magic number must be correct (0x96f3b83c).\n    * Image must contain a SHA256 TLV.\n    * Calculated SHA256 must matche SHA256 TLV contents.\n    * Image \nmay\n contain a signature TLV.  If it does, its contents must be\n      verifiable using a key embedded in the boot loader.\n\n\nImage Signing and Verification\n\n\nAs indicated above, the final step of the integrity check is signature\nverification.  The boot loader can have one or more public keys embedded in it\nat build time.  During signature verification, the boot loader verifies that an\nimage was signed with a private key that corresponds to one of its public keys.\nThe image signature TLV indicates the index of the key that is has been signed\nwith.  The boot loader uses this index to identify the corresponding public\nkey.\n\n\nFor information on embedding public keys in the boo
 t loader, as well as\nproducing signed images, see: boot/bootutil/signed_images.md", 
             "title": "toc"
         }, 
         {
@@ -5337,7 +5337,7 @@
         }, 
         {
             "location": "/os/modules/bootloader/bootloader/#image-format", 
-            "text": "The following definitions describe the image header format.  #define IMAGE_MAGIC                 0x96f3b83c  #define IMAGE_MAGIC_NONE            0xffffffff  struct   image_version  {\n     uint8_t   iv_major ;\n     uint8_t   iv_minor ;\n     uint16_t   iv_revision ;\n     uint32_t   iv_build_num ;\n}; /** Image header.  All fields are in little endian byte order. */  struct   image_header  {\n     uint32_t   ih_magic ;\n     uint16_t   ih_tlv_size ;  /* Trailing TLVs */ \n     uint8_t    ih_key_id ;\n     uint8_t    _pad1 ;\n     uint16_t   ih_hdr_s   bok@bok . net  35 d33    ericmanganaro@gmail . com  42 d39    tam@proxy . co  55 d51    nathan@natb1 . com  110 d105    rvs@apache . orgize ;\n     uint16_t   _pad2 ;\n     uint32_t   ih_img_size ;  /* Does not include header. */ \n     uint32_t   ih_flags ;\n     struct   image_version   ih_ver ;\n     uint32_t   _pad3 ;\n};  The  ih_hdr_size  field indicates the length of the header, and therefore the\noffset of
  the image itself.  This field provides for backwards compatibility in\ncase of changes to the format of the image header.  The following are the image header flags available.  #define IMAGE_F_PIC                   0x00000001  #define IMAGE_F_SHA256                0x00000002     /* Image contains hash TLV */  #define IMAGE_F_PKCS15_RSA2048_SHA256 0x00000004  /* PKCS15 w/RSA and SHA */  #define IMAGE_F_ECDSA224_SHA256       0x00000008   /* ECDSA256 over SHA256 */  #define IMAGE_F_NON_BOOTABLE          0x00000010  #define IMAGE_HEADER_SIZE           32   Optional type-length-value records (TLVs) containing image metadata are placed\nafter the end of the image. For example, security data gets added as a footer at the end of the image.  /** Image trailer TLV format. All fields in little endian. */  struct   image_tlv  {\n     uint8_t    it_type ;    /* IMAGE_TLV_[...]. */ \n     uint8_t    _pad ;\n     uint16_t   it_len       /* Data length (not including TLV header). */ \n}; /*   * Ima
 ge trailer TLV types.   */  #define IMAGE_TLV_SHA256            1    /* SHA256 of image hdr and body */  #define IMAGE_TLV_RSA2048           2    /* RSA2048 of hash output */  #define IMAGE_TLV_ECDSA224          3    /* ECDSA of hash output */", 
+            "text": "The following definitions describe the image header format.  #define IMAGE_MAGIC                 0x96f3b83c  #define IMAGE_MAGIC_NONE            0xffffffff  struct   image_version  {\n     uint8_t   iv_major ;\n     uint8_t   iv_minor ;\n     uint16_t   iv_revision ;\n     uint32_t   iv_build_num ;\n}; /** Image header.  All fields are in little endian byte order. */  struct   image_header  {\n     uint32_t   ih_magic ;\n     uint16_t   ih_tlv_size ;  /* Trailing TLVs */ \n     uint8_t    ih_key_id ;\n     uint8_t    _pad1 ;\n     uint16_t   ih_hdr_s   bok@bok . net \n     uint16_t   _pad2 ;\n     uint32_t   ih_img_size ;  /* Does not include header. */ \n     uint32_t   ih_flags ;\n     struct   image_version   ih_ver ;\n     uint32_t   _pad3 ;\n};  The  ih_hdr_size  field indicates the length of the header, and therefore the\noffset of the image itself.  This field provides for backwards compatibility in\ncase of changes to the format of the image header.  The
  following are the image header flags available.  

<TRUNCATED>


[4/7] incubator-mynewt-site git commit: PRs #160, #161, minor edits to various docs

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/otherfs/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/otherfs/index.html b/develop/os/modules/fs/otherfs/index.html
index 9d9f9f0..4f1fde8 100644
--- a/develop/os/modules/fs/otherfs/index.html
+++ b/develop/os/modules/fs/otherfs/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/hal/hal_gpio/hal_gpio/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/hal/hal_gpio/hal_gpio/index.html b/develop/os/modules/hal/hal_gpio/hal_gpio/index.html
index bd04746..da33237 100644
--- a/develop/os/modules/hal/hal_gpio/hal_gpio/index.html
+++ b/develop/os/modules/hal/hal_gpio/hal_gpio/index.html
@@ -681,7 +681,7 @@ within a Mynewt system.</p>
 port pins) depends on the specific variant of the stm32F4xx.  </p>
 <p>So if I want to turn on port B pin 3, that would be virtual pin  1*16 + 3 = 19.
 This translation is defined in the MCU implementation of
-<a href="https://github.com/apache/incubator-mynewt-larva/blob/master/hw/mcu/stm/stm32f4xx/src/hal_gpio.c">hal_gpio.c</a>
+<a href="https://github.com/apache/incubator-mynewt-core/blob/master/hw/mcu/stm/stm32f4xx/src/hal_gpio.c">hal_gpio.c</a>
 for the stmf32F4xx.  Each MCU will typically have a different translation method
 depending on its GPIO architecture.</p>
 <p>Now, when writing a BSP, it's common to give names to the relevant port pins that you are using.  Thus, the BSP may define a mapping between a function and a virtual port pin in the <code>bsp.h</code> header file for the BSP.  For example,</p>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/shell/shell/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/shell/shell/index.html b/develop/os/modules/shell/shell/index.html
index d5d5bfd..ea22b4c 100644
--- a/develop/os/modules/shell/shell/index.html
+++ b/develop/os/modules/shell/shell/index.html
@@ -587,22 +587,22 @@ receives newtmgr request messages.</p>
 </ul>
 <p><br></p>
 <p>Create a sim target to check out these commands available in shell.</p>
-<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">user@~/dev/larva$ newt target create blinky_sim
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">user@~/dev$ newt target create blinky_sim
 Creating target blinky_sim
 Target blinky_sim successfully created!
-user@~/dev/larva$ newt target set blinky_sim name=blinky_sim
+user@~/dev$ newt target set blinky_sim name=blinky_sim
 Target blinky_sim successfully set name to blinky_sim
-user@~/dev/larva$ newt target set blinky_sim arch=sim
+user@~/dev$ newt target set blinky_sim arch=sim
 Target blinky_sim successfully set arch to sim
-user@~/dev/larva$ newt target set blinky_sim project=blinky
+user@~/dev$ newt target set blinky_sim project=blinky
 Target blinky_sim successfully set project to blinky
-user@~/dev/larva$ newt target set blinky_sim bsp=hw/bsp/native
+user@~/dev$ newt target set blinky_sim bsp=hw/bsp/native
 Target blinky_sim successfully set bsp to hw/bsp/native
-user@~/dev/larva$ newt target set blinky_sim compiler_def=debug
+user@~/dev$ newt target set blinky_sim compiler_def=debug
 Target blinky_sim successfully set compiler_def to debug
-user@~/dev/larva$ newt target set blinky_sim compiler=sim
+user@~/dev$ newt target set blinky_sim compiler=sim
 Target blinky_sim successfully set compiler to sim
-user@~/dev/larva$ newt target show
+user@~/dev$ newt target show
 blinky_sim
     arch: sim
     bsp: hw/bsp/native
@@ -610,7 +610,7 @@ blinky_sim
     compiler_def: debug
     name: blinky_sim
     project: blinky
-user@~/dev/larva$ newt target build blinky_sim
+user@~/dev$ newt target build blinky_sim
 Building target blinky_sim (project = blinky)
 Compiling case.c
 Compiling suite.c
@@ -621,7 +621,7 @@ Building project blinky
 Linking blinky.elf
 Successfully run!
 
-user@~/dev/larva$ ./project/blinky/bin/blinky_sim/blinky.elf
+user@~/dev$ ./project/blinky/bin/blinky_sim/blinky.elf
 uart0 at /dev/ttys005
 </pre></div>
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/testutil/testutil/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/testutil/testutil/index.html b/develop/os/modules/testutil/testutil/index.html
index 8230bc3..ba14da6 100644
--- a/develop/os/modules/testutil/testutil/index.html
+++ b/develop/os/modules/testutil/testutil/index.html
@@ -669,9 +669,9 @@ This should be populated before <code>tu_init()</code> is called.</p>
 <ul class="nav nav-pills" style="margin-bottom: 10px">
     <li>
     
-    <a href=../../drivers/driver/>
+    <a href=../../../../network/ble/ble_intro/>
         <span class="fa fa-arrow-left"></span>
-        Previous: Drivers
+        Previous: nimBLE
     </a>
     
     </li>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/tutorials/project-target-slinky/index.html
----------------------------------------------------------------------
diff --git a/develop/os/tutorials/project-target-slinky/index.html b/develop/os/tutorials/project-target-slinky/index.html
index e7e2807..ccce39e 100644
--- a/develop/os/tutorials/project-target-slinky/index.html
+++ b/develop/os/tutorials/project-target-slinky/index.html
@@ -643,7 +643,7 @@ $ newt load stm32_slinky
 <li>You now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as the very imaginative <code>olimex01</code>.</li>
 </ul>
 <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">        $ pwd
-        /Users/&lt;user&gt;/dev/larva/project/slinky
+        /Users/&lt;user&gt;/dev/project/slinky
         $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ
         Connection profile olimex01 successfully added
         $ newtmgr conn show

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/sitemap.xml
----------------------------------------------------------------------
diff --git a/develop/sitemap.xml b/develop/sitemap.xml
index 0ccc1fb..608248e 100644
--- a/develop/sitemap.xml
+++ b/develop/sitemap.xml
@@ -4,7 +4,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -13,7 +13,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/pages/ble/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -22,7 +22,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/quick-start/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -30,7 +30,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/about/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -38,7 +38,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/talks/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -46,7 +46,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/download/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -54,7 +54,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/community/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -62,7 +62,7 @@
     
     <url>
      <loc>http://mynewt.apache.org/events/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
     
@@ -71,7 +71,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/os/introduction/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -83,7 +83,7 @@
         
     <url>
      <loc>http://mynewt.apache.org/os/get_started/vocabulary/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
@@ -123,13 +123,13 @@
         
     <url>
      <loc>http://mynewt.apache.org/faq/how_to_edit_docs/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         
     <url>
      <loc>http://mynewt.apache.org/faq/answers/</loc>
-     <lastmod>2017-03-02</lastmod>
+     <lastmod>2017-03-07</lastmod>
      <changefreq>daily</changefreq>
     </url>
         


[3/7] incubator-mynewt-site git commit: PRs #160, #161, minor edits to various docs

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/latest/mkdocs/search_index.json
----------------------------------------------------------------------
diff --git a/latest/mkdocs/search_index.json b/latest/mkdocs/search_index.json
index 84d2e36..c6dfaad 100644
--- a/latest/mkdocs/search_index.json
+++ b/latest/mkdocs/search_index.json
@@ -1442,7 +1442,7 @@
         }, 
         {
             "location": "/os/tutorials/project-target-slinky/", 
-            "text": "Project Slinky using STM32 board\n\n\n\n\nThe goal of the project is to enable and demonstrate remote communications with the Mynewt OS via newt manager (newtmgr) by leveraging a sample app \"Slinky\" included under the /apps directory in the repository. In this project we will define a target for the STM32-E407 board and assign the app \"Slinky\" to it.\n\n\nIf you have an existing project using a target that does not use the Slinky app and you wish to add newtmgt functonality to it, check out the tutorial titled \nEnable newtmgr in any app\n.\n\n\n\n\nWhat you need\n\n\n\n\nSTM32-E407 development board from Olimex. You can order it from \nhttp://www.mouser.com\n, \nhttp://www.digikey.com\n, and other places.\n\n\nARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)\n\n\nUSB A-B type cable to connect the debugger to your personal computer\n\n\nA USB to TTL Serial Cable with female 
 wiring harness. An example is \nhttp://www.amazon.com/JBtek\u00ae-WINDOWS-Supported-Raspberry-Programming/dp/B00QT7LQ88/ref=lp_464404_1_9?s=pc\nie=UTF8\nqid=1454631303\nsr=1-9\n\n\nPersonal Computer\n\n\n\n\nThe instructions assume the user is using a Bourne-compatible shell (e.g. bash or zsh) on your computer. The given instructions have been tested with the following releases of operating systems:\n\n\n\n\nMac: OS X Yosemite Version 10.10.5\n\n\n\n\nOverview of steps\n\n\n\n\nInstall dependencies\n\n\nDefine a target using the newt tool\n\n\nBuild executables for the targets using the newt tool\n\n\nSet up serial connection with the targets\n\n\nCreate a connection profile using the newtmgr tool\n\n\nUse the newtmgr tool to communicate with the targets\n\n\n\n\nInstall newt\n\n\nIf you have not already installed \nnewt\n, see the\n\nnewt installation instructions\n and ensure newt is installed an in your path.\n\n\nInstall newtmgr\n\n\nIf you have not already installed \nnewtmgr\n
 , see the\n\nnewtmgr installation instructions\n and ensure newtmgr is installed an in your path.\n\n\nCreate a new project\n\n\nInstructions for creating a project are located in the \nBasic Setup\n section of the \nMynewt Documentation\n.\n\n\nIf you already completed \nSim Slinky\n you can skip this step.\n\n\nWe will list only the steps here for brevity.  We will name the project\n\nslinky\n.\n\n\n$ newt new slinky\nDownloading project skeleton from apache/incubator-mynewt-blinky...\n...\nInstalling skeleton in slink...\nProject slink successfully created\n$ cd slinky\n$newt install -v\nDownloading repository description for apache-mynewt-core... success!\n...\nRepos successfully installed\n\n\n\n\n\n\n\nSet up your target builds\n\n\nCreate a target for \nstm32_slinky\n using the native BSP. The Newt tool output is suppressed below for brevity.\n\n\n$ newt target create stm32_slinky\n$ newt target set stm32_slinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n$ new
 t target set stm32_slinky build_profile=debug\n$ newt target set stm32_slinky app=@apache-mynewt-core/apps/slinky\n\n\n\n\n\nCreate a second target for \nstm32_bootloader\n to build a bootloader to boot\nthe \nstm32_slinky\n image.  The tool output is suppressed below for brevity.\n\n\n$ newt target create stm32_bootloader\n$ newt target set stm32_bootloader bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n$ newt target set stm32_bootloader build_profile=optimized\n$ newt target set stm32_bootloader target.app=@apache-mynewt-core/apps/boot\n\n\n\n\n\n\n\nBuild Targets\n\n\n$ newt build stm32_slinky\nCompiling main.c\n...\nLinking slinky.elf\nApp successfully built: ~/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.elf\n\n\n\n\n\nnewt build stm32_bootloader\nCompiling crc16.c\n...\nLinking boot.elf\nApp successfully built: ~/slinky/bin/stm32_bootloader/apps/boot/boot.elf\n\n\n\n\n\nFor the main image, you need to create an image using newt create-image.\nGive this image some
  arbitrary version number \"1.2.3\".\n\n\n$ newt create-image stm32_slinky 1.2.3\nApp image successfully generated: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.img\nBuild manifest: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/manifest.json\n\n\n\n\n\n\n\nUsing newtmgr with a remote target\n\n\n\n\n\n\nFirst make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.\n\n\nNext go the to project directory and download the slinky project image to the flash of the Olimex board.\n\n\n\n\n\n\n$ newt load stm32_bootloader\n$ newt load stm32_slinky\n\n\n\n\n\nYou can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.\n\n\n\n\n\n\n\n\nNow you have to set up the serial connection from your computer to the Olimex board. Locate the PC6/USART6_TX (pin#3), PC7/USART6_RX (pin#4), and GND (pin#2) of the UEXT connector on the Olimex board.
  More information on the UEXT connector can be found at \nhttps://www.olimex.com/Products/Modules/UEXT/\n. The schematic of the board can be found at \nhttps://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf\n for reference.\n\n\n\n\n\n\nConnect the female RX pin of the USB-TTL serial cable to the TX of the UEXT connector on the board.\n\n\nConnect the female TX pin of the USB-TTL serial cable to the RX of the UEXT connector on the board.\n\n\nConnect the GND pin of the USB-TTL serial cable to the GND of the UEXT connector on the board.\n\n\n\n\n\n\n\n\n\n\n\n\nLocate the serial connection established in the /dev directory of your computer. It should be of the type \ntty.usbserial-\nsome identifier\n.\n\n\n\n\n        $ ls /dev/tty.usbserial-AJ03HAQQ\n        /dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\n\n\nYou now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as t
 he very imaginative \nolimex01\n.\n\n\n\n\n        $ pwd\n        /Users/\nuser\n/dev/larva/project/slinky\n        $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ\n        Connection profile olimex01 successfully added\n        $ newtmgr conn show\n        Connection profiles:\n          sim1: type=serial, connstring=\n/dev/ttys007\n\n          olimex01: type=serial, connstring=\n/dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\n\n\n\nNow go ahead and query the Olimex board to get responses back. The simplest command is the \necho\n command to ask it to respond with the text you send it.\n\n\n\n\n    $ newtmgr echo -c olimex01 hello\n    {\nr\n: \nhello\n}\n    $ newtmgr image -c olimex01 list\n    Images:\n        0 : 1.2.3\n    $ newtmgr -c olimex01 taskstats\n    Return Code = 0\n      newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)\n      task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 la
 st_checkin=0 next_checkin=0)\n      task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)\n      idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)\n      shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)", 
+            "text": "Project Slinky using STM32 board\n\n\n\n\nThe goal of the project is to enable and demonstrate remote communications with the Mynewt OS via newt manager (newtmgr) by leveraging a sample app \"Slinky\" included under the /apps directory in the repository. In this project we will define a target for the STM32-E407 board and assign the app \"Slinky\" to it.\n\n\nIf you have an existing project using a target that does not use the Slinky app and you wish to add newtmgt functonality to it, check out the tutorial titled \nEnable newtmgr in any app\n.\n\n\n\n\nWhat you need\n\n\n\n\nSTM32-E407 development board from Olimex. You can order it from \nhttp://www.mouser.com\n, \nhttp://www.digikey.com\n, and other places.\n\n\nARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)\n\n\nUSB A-B type cable to connect the debugger to your personal computer\n\n\nA USB to TTL Serial Cable with female 
 wiring harness. An example is \nhttp://www.amazon.com/JBtek\u00ae-WINDOWS-Supported-Raspberry-Programming/dp/B00QT7LQ88/ref=lp_464404_1_9?s=pc\nie=UTF8\nqid=1454631303\nsr=1-9\n\n\nPersonal Computer\n\n\n\n\nThe instructions assume the user is using a Bourne-compatible shell (e.g. bash or zsh) on your computer. The given instructions have been tested with the following releases of operating systems:\n\n\n\n\nMac: OS X Yosemite Version 10.10.5\n\n\n\n\nOverview of steps\n\n\n\n\nInstall dependencies\n\n\nDefine a target using the newt tool\n\n\nBuild executables for the targets using the newt tool\n\n\nSet up serial connection with the targets\n\n\nCreate a connection profile using the newtmgr tool\n\n\nUse the newtmgr tool to communicate with the targets\n\n\n\n\nInstall newt\n\n\nIf you have not already installed \nnewt\n, see the\n\nnewt installation instructions\n and ensure newt is installed an in your path.\n\n\nInstall newtmgr\n\n\nIf you have not already installed \nnewtmgr\n
 , see the\n\nnewtmgr installation instructions\n and ensure newtmgr is installed an in your path.\n\n\nCreate a new project\n\n\nInstructions for creating a project are located in the \nBasic Setup\n section of the \nMynewt Documentation\n.\n\n\nIf you already completed \nSim Slinky\n you can skip this step.\n\n\nWe will list only the steps here for brevity.  We will name the project\n\nslinky\n.\n\n\n$ newt new slinky\nDownloading project skeleton from apache/incubator-mynewt-blinky...\n...\nInstalling skeleton in slink...\nProject slink successfully created\n$ cd slinky\n$newt install -v\nDownloading repository description for apache-mynewt-core... success!\n...\nRepos successfully installed\n\n\n\n\n\n\n\nSet up your target builds\n\n\nCreate a target for \nstm32_slinky\n using the native BSP. The Newt tool output is suppressed below for brevity.\n\n\n$ newt target create stm32_slinky\n$ newt target set stm32_slinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n$ new
 t target set stm32_slinky build_profile=debug\n$ newt target set stm32_slinky app=@apache-mynewt-core/apps/slinky\n\n\n\n\n\nCreate a second target for \nstm32_bootloader\n to build a bootloader to boot\nthe \nstm32_slinky\n image.  The tool output is suppressed below for brevity.\n\n\n$ newt target create stm32_bootloader\n$ newt target set stm32_bootloader bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard\n$ newt target set stm32_bootloader build_profile=optimized\n$ newt target set stm32_bootloader target.app=@apache-mynewt-core/apps/boot\n\n\n\n\n\n\n\nBuild Targets\n\n\n$ newt build stm32_slinky\nCompiling main.c\n...\nLinking slinky.elf\nApp successfully built: ~/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.elf\n\n\n\n\n\nnewt build stm32_bootloader\nCompiling crc16.c\n...\nLinking boot.elf\nApp successfully built: ~/slinky/bin/stm32_bootloader/apps/boot/boot.elf\n\n\n\n\n\nFor the main image, you need to create an image using newt create-image.\nGive this image some
  arbitrary version number \"1.2.3\".\n\n\n$ newt create-image stm32_slinky 1.2.3\nApp image successfully generated: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.img\nBuild manifest: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/manifest.json\n\n\n\n\n\n\n\nUsing newtmgr with a remote target\n\n\n\n\n\n\nFirst make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.\n\n\nNext go the to project directory and download the slinky project image to the flash of the Olimex board.\n\n\n\n\n\n\n$ newt load stm32_bootloader\n$ newt load stm32_slinky\n\n\n\n\n\nYou can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.\n\n\n\n\n\n\n\n\nNow you have to set up the serial connection from your computer to the Olimex board. Locate the PC6/USART6_TX (pin#3), PC7/USART6_RX (pin#4), and GND (pin#2) of the UEXT connector on the Olimex board.
  More information on the UEXT connector can be found at \nhttps://www.olimex.com/Products/Modules/UEXT/\n. The schematic of the board can be found at \nhttps://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf\n for reference.\n\n\n\n\n\n\nConnect the female RX pin of the USB-TTL serial cable to the TX of the UEXT connector on the board.\n\n\nConnect the female TX pin of the USB-TTL serial cable to the RX of the UEXT connector on the board.\n\n\nConnect the GND pin of the USB-TTL serial cable to the GND of the UEXT connector on the board.\n\n\n\n\n\n\n\n\n\n\n\n\nLocate the serial connection established in the /dev directory of your computer. It should be of the type \ntty.usbserial-\nsome identifier\n.\n\n\n\n\n        $ ls /dev/tty.usbserial-AJ03HAQQ\n        /dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\n\n\nYou now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as t
 he very imaginative \nolimex01\n.\n\n\n\n\n        $ pwd\n        /Users/\nuser\n/dev/project/slinky\n        $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ\n        Connection profile olimex01 successfully added\n        $ newtmgr conn show\n        Connection profiles:\n          sim1: type=serial, connstring=\n/dev/ttys007\n\n          olimex01: type=serial, connstring=\n/dev/tty.usbserial-AJ03HAQQ\n\n\n\n\n\n\n\n\n\n\nNow go ahead and query the Olimex board to get responses back. The simplest command is the \necho\n command to ask it to respond with the text you send it.\n\n\n\n\n    $ newtmgr echo -c olimex01 hello\n    {\nr\n: \nhello\n}\n    $ newtmgr image -c olimex01 list\n    Images:\n        0 : 1.2.3\n    $ newtmgr -c olimex01 taskstats\n    Return Code = 0\n      newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)\n      task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 last_che
 ckin=0 next_checkin=0)\n      task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)\n      idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)\n      shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)", 
             "title": "Slinky on STM32 board"
         }, 
         {
@@ -1487,7 +1487,7 @@
         }, 
         {
             "location": "/os/tutorials/project-target-slinky/#using-newtmgr-with-a-remote-target", 
-            "text": "First make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.  Next go the to project directory and download the slinky project image to the flash of the Olimex board.    $ newt load stm32_bootloader\n$ newt load stm32_slinky  You can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.     Now you have to set up the serial connection from your computer to the Olimex board. Locate the PC6/USART6_TX (pin#3), PC7/USART6_RX (pin#4), and GND (pin#2) of the UEXT connector on the Olimex board. More information on the UEXT connector can be found at  https://www.olimex.com/Products/Modules/UEXT/ . The schematic of the board can be found at  https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf  for reference.    Connect the female RX pin of the USB-TTL serial cable to the TX of the UEXT connector on the board.  Connect the
  female TX pin of the USB-TTL serial cable to the RX of the UEXT connector on the board.  Connect the GND pin of the USB-TTL serial cable to the GND of the UEXT connector on the board.       Locate the serial connection established in the /dev directory of your computer. It should be of the type  tty.usbserial- some identifier .           $ ls /dev/tty.usbserial-AJ03HAQQ\n        /dev/tty.usbserial-AJ03HAQQ    You now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as the very imaginative  olimex01 .           $ pwd\n        /Users/ user /dev/larva/project/slinky\n        $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ\n        Connection profile olimex01 successfully added\n        $ newtmgr conn show\n        Connection profiles:\n          sim1: type=serial, connstring= /dev/ttys007 \n          olimex01: type=serial, connstring= /dev/tty.usbserial-AJ03HA
 QQ     Now go ahead and query the Olimex board to get responses back. The simplest command is the  echo  command to ask it to respond with the text you send it.       $ newtmgr echo -c olimex01 hello\n    { r :  hello }\n    $ newtmgr image -c olimex01 list\n    Images:\n        0 : 1.2.3\n    $ newtmgr -c olimex01 taskstats\n    Return Code = 0\n      newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)\n      task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 last_checkin=0 next_checkin=0)\n      task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)\n      idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)\n      shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)", 
+            "text": "First make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.  Next go the to project directory and download the slinky project image to the flash of the Olimex board.    $ newt load stm32_bootloader\n$ newt load stm32_slinky  You can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.     Now you have to set up the serial connection from your computer to the Olimex board. Locate the PC6/USART6_TX (pin#3), PC7/USART6_RX (pin#4), and GND (pin#2) of the UEXT connector on the Olimex board. More information on the UEXT connector can be found at  https://www.olimex.com/Products/Modules/UEXT/ . The schematic of the board can be found at  https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf  for reference.    Connect the female RX pin of the USB-TTL serial cable to the TX of the UEXT connector on the board.  Connect the
  female TX pin of the USB-TTL serial cable to the RX of the UEXT connector on the board.  Connect the GND pin of the USB-TTL serial cable to the GND of the UEXT connector on the board.       Locate the serial connection established in the /dev directory of your computer. It should be of the type  tty.usbserial- some identifier .           $ ls /dev/tty.usbserial-AJ03HAQQ\n        /dev/tty.usbserial-AJ03HAQQ    You now have to define a connection profile using newtmgr. You can give it any name you want. The example below shows the connection profile being named as the very imaginative  olimex01 .           $ pwd\n        /Users/ user /dev/project/slinky\n        $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ\n        Connection profile olimex01 successfully added\n        $ newtmgr conn show\n        Connection profiles:\n          sim1: type=serial, connstring= /dev/ttys007 \n          olimex01: type=serial, connstring= /dev/tty.usbserial-AJ03HAQQ    
  Now go ahead and query the Olimex board to get responses back. The simplest command is the  echo  command to ask it to respond with the text you send it.       $ newtmgr echo -c olimex01 hello\n    { r :  hello }\n    $ newtmgr image -c olimex01 list\n    Images:\n        0 : 1.2.3\n    $ newtmgr -c olimex01 taskstats\n    Return Code = 0\n      newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)\n      task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 last_checkin=0 next_checkin=0)\n      task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)\n      idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)\n      shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)", 
             "title": "Using newtmgr with a remote target"
         }, 
         {
@@ -5102,7 +5102,7 @@
         }, 
         {
             "location": "/os/modules/shell/shell/", 
-            "text": "Shell\n\n\nThe shell runs above the console and provides two functionalities:\n\n\n\n\nProcesses console input. \n\n\nImplements the \nnewtmgr\n line protocol over serial transport. \n\n\n\n\nThe \nsys/shell\n package implements the shell.  The shell uses the OS default event queue \nfor shell events and runs in the context of the main task. An application can, optionally, \nspecify a dedicated event queue for the shell to use.\n\n\nDescription\n\n\n\n\n\n\nThe shell's first job is to direct incoming commands to other subsystems. It parses the incoming character string \ninto tokens and uses the first token to determine the subsystem command handler to call to process the command.\n\n\n\n\n\n\nSubsystems register their command handlers using the \nshell_cmd_register()\n \n  function.  When shell calls the command handler, it passes the other tokens as arguments.\n\n\n\n\n\n\nA few commands are currently available in the shell - \ntasks\n, \nlog\n, \necho\n, \nda
 te\n and \nprompt\n.\n\n\n\n\n\n\n\n\n\n\nThe shell's second job is to handle packet framing, encoding, and decoding of newtmgr protocol messages that are\nsent over the console.  The Newtmgr serial transport package (\nmgmt/newtmgr/transport/newtmgr_shell\n) \ncalls the \nshell_nlip_input_register()\n function to register a handler that the shell calls when it \nreceives newtmgr request messages.\n\n\n\n\n\n\n\n\nCreate a sim target to check out these commands available in shell.\n\n\nuser@~/dev/larva$ newt target create blinky_sim\nCreating target blinky_sim\nTarget blinky_sim successfully created!\nuser@~/dev/larva$ newt target set blinky_sim name=blinky_sim\nTarget blinky_sim successfully set name to blinky_sim\nuser@~/dev/larva$ newt target set blinky_sim arch=sim\nTarget blinky_sim successfully set arch to sim\nuser@~/dev/larva$ newt target set blinky_sim project=blinky\nTarget blinky_sim successfully set project to blinky\nuser@~/dev/larva$ newt target set blinky_sim bsp=hw/b
 sp/native\nTarget blinky_sim successfully set bsp to hw/bsp/native\nuser@~/dev/larva$ newt target set blinky_sim compiler_def=debug\nTarget blinky_sim successfully set compiler_def to debug\nuser@~/dev/larva$ newt target set blinky_sim compiler=sim\nTarget blinky_sim successfully set compiler to sim\nuser@~/dev/larva$ newt target show\nblinky_sim\n    arch: sim\n    bsp: hw/bsp/native\n    compiler: sim\n    compiler_def: debug\n    name: blinky_sim\n    project: blinky\nuser@~/dev/larva$ newt target build blinky_sim\nBuilding target blinky_sim (project = blinky)\nCompiling case.c\nCompiling suite.c\nCompiling testutil.c\n..\n..\nBuilding project blinky\nLinking blinky.elf\nSuccessfully run!\n\nuser@~/dev/larva$ ./project/blinky/bin/blinky_sim/blinky.elf\nuart0 at /dev/ttys005\n\n\n\n\n\nOpen up a new terminal to run minicom, a text-based serial port control and terminal emulation program. Set device name to the serial port of the target. \n\n\nuser@~$ minicom -D /dev/ttys005\nWelco
 me to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:14:21.\nPort /dev/ttys005, 11:32:17\n\nPress Meta-Z for help on special keys\n\nlog \n174578:[0] bla\n174578:[0] bab\n\ntasks\n217809:6 tasks: \n217809:  shell (prio: 3, nw: 0, flags: 0x0, ssize: 0, cswcnt: 59, tot_run_time: 0ms)\n217840:  idle (prio: 255, nw: 0, flags: 0x0, ssize: 0, cswcnt: 18763, tot_run_time: 217809ms)\n217878:  uart_poller (prio: 0, nw: 217819, flags: 0x0, ssize: 0, cswcnt: 18667, tot_run_time: 0ms)\n217923:  task1 (prio: 1, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n217953:  os_sanity (prio: 254, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n218010:  task2 (prio: 2, nw: 217709, flags: 0x3, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n\n\nprompt\nUsage: prompt [set|show] [prompt_char]\nprompt set \n\nPrompt set to: \n\n229370: \n\n\n\n\n\n\nData structures\n\n\nThis data structure is used in holding information about registered command handlers.\n\n\nstruct\n 
 \nshell_cmd\n {\n    \nchar\n \n*sc_cmd\n;\n    \nshell_cmd_func_t\n \nsc_cmd_func\n;\n    \nSTAILQ_ENTRY\n(\nshell_cmd\n) \nsc_next\n;\n};\n\n\n\n\n\n\n\n\n\n\n\nElement\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nsc_cmd\n\n\nCharacter string of the command\n\n\n\n\n\n\nsc_cmd_func\n\n\nPointer to the command handler\n\n\n\n\n\n\nsc_next\n\n\nBookkeeping linkage internal for shell\n\n\n\n\n\n\n\n\nList of Functions\n\n\n\n\nThe functions available in this OS feature are:\n\n\n\n\n\n\n\n\nFunction\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nshell_cmd_register\n\n\nRegisters a handler for incoming console commands.\n\n\n\n\n\n\nshell_nlip_input_register\n\n\nRegisters a handler for incoming newtmgr messages.\n\n\n\n\n\n\nshell_nlip_output\n\n\nQueue outgoing newtmgr message for transmission.\n\n\n\n\n\n\nshell_evq_set\n\n\nSpecifies a dedicated event queue for shell events.", 
+            "text": "Shell\n\n\nThe shell runs above the console and provides two functionalities:\n\n\n\n\nProcesses console input. \n\n\nImplements the \nnewtmgr\n line protocol over serial transport. \n\n\n\n\nThe \nsys/shell\n package implements the shell.  The shell uses the OS default event queue \nfor shell events and runs in the context of the main task. An application can, optionally, \nspecify a dedicated event queue for the shell to use.\n\n\nDescription\n\n\n\n\n\n\nThe shell's first job is to direct incoming commands to other subsystems. It parses the incoming character string \ninto tokens and uses the first token to determine the subsystem command handler to call to process the command.\n\n\n\n\n\n\nSubsystems register their command handlers using the \nshell_cmd_register()\n \n  function.  When shell calls the command handler, it passes the other tokens as arguments.\n\n\n\n\n\n\nA few commands are currently available in the shell - \ntasks\n, \nlog\n, \necho\n, \nda
 te\n and \nprompt\n.\n\n\n\n\n\n\n\n\n\n\nThe shell's second job is to handle packet framing, encoding, and decoding of newtmgr protocol messages that are\nsent over the console.  The Newtmgr serial transport package (\nmgmt/newtmgr/transport/newtmgr_shell\n) \ncalls the \nshell_nlip_input_register()\n function to register a handler that the shell calls when it \nreceives newtmgr request messages.\n\n\n\n\n\n\n\n\nCreate a sim target to check out these commands available in shell.\n\n\nuser@~/dev$ newt target create blinky_sim\nCreating target blinky_sim\nTarget blinky_sim successfully created!\nuser@~/dev$ newt target set blinky_sim name=blinky_sim\nTarget blinky_sim successfully set name to blinky_sim\nuser@~/dev$ newt target set blinky_sim arch=sim\nTarget blinky_sim successfully set arch to sim\nuser@~/dev$ newt target set blinky_sim project=blinky\nTarget blinky_sim successfully set project to blinky\nuser@~/dev$ newt target set blinky_sim bsp=hw/bsp/native\nTarget blinky_sim s
 uccessfully set bsp to hw/bsp/native\nuser@~/dev$ newt target set blinky_sim compiler_def=debug\nTarget blinky_sim successfully set compiler_def to debug\nuser@~/dev$ newt target set blinky_sim compiler=sim\nTarget blinky_sim successfully set compiler to sim\nuser@~/dev$ newt target show\nblinky_sim\n    arch: sim\n    bsp: hw/bsp/native\n    compiler: sim\n    compiler_def: debug\n    name: blinky_sim\n    project: blinky\nuser@~/dev$ newt target build blinky_sim\nBuilding target blinky_sim (project = blinky)\nCompiling case.c\nCompiling suite.c\nCompiling testutil.c\n..\n..\nBuilding project blinky\nLinking blinky.elf\nSuccessfully run!\n\nuser@~/dev$ ./project/blinky/bin/blinky_sim/blinky.elf\nuart0 at /dev/ttys005\n\n\n\n\n\nOpen up a new terminal to run minicom, a text-based serial port control and terminal emulation program. Set device name to the serial port of the target. \n\n\nuser@~$ minicom -D /dev/ttys005\nWelcome to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:
 14:21.\nPort /dev/ttys005, 11:32:17\n\nPress Meta-Z for help on special keys\n\nlog \n174578:[0] bla\n174578:[0] bab\n\ntasks\n217809:6 tasks: \n217809:  shell (prio: 3, nw: 0, flags: 0x0, ssize: 0, cswcnt: 59, tot_run_time: 0ms)\n217840:  idle (prio: 255, nw: 0, flags: 0x0, ssize: 0, cswcnt: 18763, tot_run_time: 217809ms)\n217878:  uart_poller (prio: 0, nw: 217819, flags: 0x0, ssize: 0, cswcnt: 18667, tot_run_time: 0ms)\n217923:  task1 (prio: 1, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n217953:  os_sanity (prio: 254, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n218010:  task2 (prio: 2, nw: 217709, flags: 0x3, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n\n\nprompt\nUsage: prompt [set|show] [prompt_char]\nprompt set \n\nPrompt set to: \n\n229370: \n\n\n\n\n\n\nData structures\n\n\nThis data structure is used in holding information about registered command handlers.\n\n\nstruct\n \nshell_cmd\n {\n    \nchar\n \n*sc_cmd\n;\n    \nshell_cmd_
 func_t\n \nsc_cmd_func\n;\n    \nSTAILQ_ENTRY\n(\nshell_cmd\n) \nsc_next\n;\n};\n\n\n\n\n\n\n\n\n\n\n\nElement\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nsc_cmd\n\n\nCharacter string of the command\n\n\n\n\n\n\nsc_cmd_func\n\n\nPointer to the command handler\n\n\n\n\n\n\nsc_next\n\n\nBookkeeping linkage internal for shell\n\n\n\n\n\n\n\n\nList of Functions\n\n\n\n\nThe functions available in this OS feature are:\n\n\n\n\n\n\n\n\nFunction\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nshell_cmd_register\n\n\nRegisters a handler for incoming console commands.\n\n\n\n\n\n\nshell_nlip_input_register\n\n\nRegisters a handler for incoming newtmgr messages.\n\n\n\n\n\n\nshell_nlip_output\n\n\nQueue outgoing newtmgr message for transmission.\n\n\n\n\n\n\nshell_evq_set\n\n\nSpecifies a dedicated event queue for shell events.", 
             "title": "toc"
         }, 
         {
@@ -5112,7 +5112,7 @@
         }, 
         {
             "location": "/os/modules/shell/shell/#description", 
-            "text": "The shell's first job is to direct incoming commands to other subsystems. It parses the incoming character string \ninto tokens and uses the first token to determine the subsystem command handler to call to process the command.    Subsystems register their command handlers using the  shell_cmd_register()  \n  function.  When shell calls the command handler, it passes the other tokens as arguments.    A few commands are currently available in the shell -  tasks ,  log ,  echo ,  date  and  prompt .      The shell's second job is to handle packet framing, encoding, and decoding of newtmgr protocol messages that are\nsent over the console.  The Newtmgr serial transport package ( mgmt/newtmgr/transport/newtmgr_shell ) \ncalls the  shell_nlip_input_register()  function to register a handler that the shell calls when it \nreceives newtmgr request messages.     Create a sim target to check out these commands available in shell.  user@~/dev/larva$ newt target create bli
 nky_sim\nCreating target blinky_sim\nTarget blinky_sim successfully created!\nuser@~/dev/larva$ newt target set blinky_sim name=blinky_sim\nTarget blinky_sim successfully set name to blinky_sim\nuser@~/dev/larva$ newt target set blinky_sim arch=sim\nTarget blinky_sim successfully set arch to sim\nuser@~/dev/larva$ newt target set blinky_sim project=blinky\nTarget blinky_sim successfully set project to blinky\nuser@~/dev/larva$ newt target set blinky_sim bsp=hw/bsp/native\nTarget blinky_sim successfully set bsp to hw/bsp/native\nuser@~/dev/larva$ newt target set blinky_sim compiler_def=debug\nTarget blinky_sim successfully set compiler_def to debug\nuser@~/dev/larva$ newt target set blinky_sim compiler=sim\nTarget blinky_sim successfully set compiler to sim\nuser@~/dev/larva$ newt target show\nblinky_sim\n    arch: sim\n    bsp: hw/bsp/native\n    compiler: sim\n    compiler_def: debug\n    name: blinky_sim\n    project: blinky\nuser@~/dev/larva$ newt target build blinky_sim\nBuildin
 g target blinky_sim (project = blinky)\nCompiling case.c\nCompiling suite.c\nCompiling testutil.c\n..\n..\nBuilding project blinky\nLinking blinky.elf\nSuccessfully run!\n\nuser@~/dev/larva$ ./project/blinky/bin/blinky_sim/blinky.elf\nuart0 at /dev/ttys005  Open up a new terminal to run minicom, a text-based serial port control and terminal emulation program. Set device name to the serial port of the target.   user@~$ minicom -D /dev/ttys005\nWelcome to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:14:21.\nPort /dev/ttys005, 11:32:17\n\nPress Meta-Z for help on special keys\n\nlog \n174578:[0] bla\n174578:[0] bab\n\ntasks\n217809:6 tasks: \n217809:  shell (prio: 3, nw: 0, flags: 0x0, ssize: 0, cswcnt: 59, tot_run_time: 0ms)\n217840:  idle (prio: 255, nw: 0, flags: 0x0, ssize: 0, cswcnt: 18763, tot_run_time: 217809ms)\n217878:  uart_poller (prio: 0, nw: 217819, flags: 0x0, ssize: 0, cswcnt: 18667, tot_run_time: 0ms)\n217923:  task1 (prio: 1, nw: 218710, flags: 0x0, ssize: 0, 
 cswcnt: 218, tot_run_time: 0ms)\n217953:  os_sanity (prio: 254, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n218010:  task2 (prio: 2, nw: 217709, flags: 0x3, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n\n\nprompt\nUsage: prompt [set|show] [prompt_char]\nprompt set  \nPrompt set to:  \n229370:", 
+            "text": "The shell's first job is to direct incoming commands to other subsystems. It parses the incoming character string \ninto tokens and uses the first token to determine the subsystem command handler to call to process the command.    Subsystems register their command handlers using the  shell_cmd_register()  \n  function.  When shell calls the command handler, it passes the other tokens as arguments.    A few commands are currently available in the shell -  tasks ,  log ,  echo ,  date  and  prompt .      The shell's second job is to handle packet framing, encoding, and decoding of newtmgr protocol messages that are\nsent over the console.  The Newtmgr serial transport package ( mgmt/newtmgr/transport/newtmgr_shell ) \ncalls the  shell_nlip_input_register()  function to register a handler that the shell calls when it \nreceives newtmgr request messages.     Create a sim target to check out these commands available in shell.  user@~/dev$ newt target create blinky_si
 m\nCreating target blinky_sim\nTarget blinky_sim successfully created!\nuser@~/dev$ newt target set blinky_sim name=blinky_sim\nTarget blinky_sim successfully set name to blinky_sim\nuser@~/dev$ newt target set blinky_sim arch=sim\nTarget blinky_sim successfully set arch to sim\nuser@~/dev$ newt target set blinky_sim project=blinky\nTarget blinky_sim successfully set project to blinky\nuser@~/dev$ newt target set blinky_sim bsp=hw/bsp/native\nTarget blinky_sim successfully set bsp to hw/bsp/native\nuser@~/dev$ newt target set blinky_sim compiler_def=debug\nTarget blinky_sim successfully set compiler_def to debug\nuser@~/dev$ newt target set blinky_sim compiler=sim\nTarget blinky_sim successfully set compiler to sim\nuser@~/dev$ newt target show\nblinky_sim\n    arch: sim\n    bsp: hw/bsp/native\n    compiler: sim\n    compiler_def: debug\n    name: blinky_sim\n    project: blinky\nuser@~/dev$ newt target build blinky_sim\nBuilding target blinky_sim (project = blinky)\nCompiling case
 .c\nCompiling suite.c\nCompiling testutil.c\n..\n..\nBuilding project blinky\nLinking blinky.elf\nSuccessfully run!\n\nuser@~/dev$ ./project/blinky/bin/blinky_sim/blinky.elf\nuart0 at /dev/ttys005  Open up a new terminal to run minicom, a text-based serial port control and terminal emulation program. Set device name to the serial port of the target.   user@~$ minicom -D /dev/ttys005\nWelcome to minicom 2.7\n\nOPTIONS: \nCompiled on Nov 24 2015, 16:14:21.\nPort /dev/ttys005, 11:32:17\n\nPress Meta-Z for help on special keys\n\nlog \n174578:[0] bla\n174578:[0] bab\n\ntasks\n217809:6 tasks: \n217809:  shell (prio: 3, nw: 0, flags: 0x0, ssize: 0, cswcnt: 59, tot_run_time: 0ms)\n217840:  idle (prio: 255, nw: 0, flags: 0x0, ssize: 0, cswcnt: 18763, tot_run_time: 217809ms)\n217878:  uart_poller (prio: 0, nw: 217819, flags: 0x0, ssize: 0, cswcnt: 18667, tot_run_time: 0ms)\n217923:  task1 (prio: 1, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n217953:  os_sanity (prio: 2
 54, nw: 218710, flags: 0x0, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n218010:  task2 (prio: 2, nw: 217709, flags: 0x3, ssize: 0, cswcnt: 218, tot_run_time: 0ms)\n\n\nprompt\nUsage: prompt [set|show] [prompt_char]\nprompt set  \nPrompt set to:  \n229370:", 
             "title": "Description"
         }, 
         {
@@ -5322,7 +5322,7 @@
         }, 
         {
             "location": "/os/modules/bootloader/bootloader/", 
-            "text": "Bootloader\n\n\nThe \"bootloader\" is the code that loads the Mynewt OS image into memory and conducts some checks before allowing the OS to be run. It manages images for the embedded system and upgrades of those images using protocols over various interfaces (e.g. serial, BLE etc.). Typically, systems with bootloaders have at least two program images coexisting on the same microcontroller, and hence must include branch code that performs a check to see if an attempt to update software is already underway and manage the progress of the process.\n\n\nThe bootloader in the Apache Mynewt project verifies the cryptographic signature of the firmware image before running it. It maintains a detailed status log for each stage of the boot process. For verification of the authenticity of the OS image, it:\n\n\n\n\nCalculates hash of the image.\n\n\nUses public key to uncover hash value from included signature. \n\n\nCompares the calculated and uncovered hashes for a match
 .\n\n\n\n\nThe \"secure bootloader\" should be placed in protected memory on a given microcontroller.\n\n\nThe Mynewt bootloader comprises two packages:\n\n\n\n\nThe bootutil library (boot/bootutil)\n\n\nThe boot application (apps/boot)\n\n\n\n\nThe Mynewt code is thus structured so that the generic bootutil library performs most of the functions of a boot loader. The final step of actually jumping to the main image is kept out of the bootutil library.  This last step should instead be implemented in an\narchitecture-specific project.  Boot loader functionality is separated in this\nmanner for the following two reasons:\n\n\n\n\nBy keeping architecture-dependent code separate, the bootutil library can be\n   reused among several boot loaders.\n\n\nBy excluding the last boot step from the library, the bootloader can be unit tested since a library can be unit tested but an applicant can't.\n\n\n\n\nLimitations\n\n\nThe boot loader currently only supports images with the following\ncha
 racteristics:\n\n\n\n\nBuilt to run from flash.\n\n\nBuild to run from a fixed location (i.e., position-independent).\n\n\n\n\nImage Format\n\n\nThe following definitions describe the image header format.\n\n\n#define IMAGE_MAGIC                 0x96f3b83c\n\n\n#define IMAGE_MAGIC_NONE            0xffffffff\n\n\n\nstruct\n \nimage_version\n {\n    \nuint8_t\n \niv_major\n;\n    \nuint8_t\n \niv_minor\n;\n    \nuint16_t\n \niv_revision\n;\n    \nuint32_t\n \niv_build_num\n;\n};\n\n\n/** Image header.  All fields are in little endian byte order. */\n\n\nstruct\n \nimage_header\n {\n    \nuint32_t\n \nih_magic\n;\n    \nuint16_t\n \nih_tlv_size\n; \n/* Trailing TLVs */\n\n    \nuint8_t\n  \nih_key_id\n;\n    \nuint8_t\n  \n_pad1\n;\n    \nuint16_t\n \nih_hdr_s\n \nbok@bok\n.\nnet\n\n\n35\nd33\n\n\n \nericmanganaro@gmail\n.\ncom\n\n\n42\nd39\n\n\n \ntam@proxy\n.\nco\n\n\n55\nd51\n\n\n \nnathan@natb1\n.\ncom\n\n\n110\nd105\n\n\n \nrvs@apache\n.\norgize\n;\n    \nuint16_t\n \n_pad2\n;\n  
   \nuint32_t\n \nih_img_size\n; \n/* Does not include header. */\n\n    \nuint32_t\n \nih_flags\n;\n    \nstruct\n \nimage_version\n \nih_ver\n;\n    \nuint32_t\n \n_pad3\n;\n};\n\n\n\n\n\nThe \nih_hdr_size\n field indicates the length of the header, and therefore the\noffset of the image itself.  This field provides for backwards compatibility in\ncase of changes to the format of the image header.\n\n\nThe following are the image header flags available.\n\n\n#define IMAGE_F_PIC                   0x00000001\n\n\n#define IMAGE_F_SHA256                0x00000002    \n/* Image contains hash TLV */\n\n\n#define IMAGE_F_PKCS15_RSA2048_SHA256 0x00000004 \n/* PKCS15 w/RSA and SHA */\n\n\n#define IMAGE_F_ECDSA224_SHA256       0x00000008  \n/* ECDSA256 over SHA256 */\n\n\n#define IMAGE_F_NON_BOOTABLE          0x00000010\n\n\n#define IMAGE_HEADER_SIZE           32\n\n\n\n\n\n\nOptional type-length-value records (TLVs) containing image metadata are placed\nafter the end of the image. For examp
 le, security data gets added as a footer at the end of the image.\n\n\n/** Image trailer TLV format. All fields in little endian. */\n\n\nstruct\n \nimage_tlv\n {\n    \nuint8_t\n  \nit_type\n;   \n/* IMAGE_TLV_[...]. */\n\n    \nuint8_t\n  \n_pad\n;\n    \nuint16_t\n \nit_len\n     \n/* Data length (not including TLV header). */\n\n};\n\n\n/*\n\n\n * Image trailer TLV types.\n\n\n */\n\n\n#define IMAGE_TLV_SHA256            1   \n/* SHA256 of image hdr and body */\n\n\n#define IMAGE_TLV_RSA2048           2   \n/* RSA2048 of hash output */\n\n\n#define IMAGE_TLV_ECDSA224          3   \n/* ECDSA of hash output */\n\n\n\n\n\n\nFlash Map\n\n\nA Mynewt device's flash is partitioned according to its \nflash map\n.  At a high\nlevel, the flash map maps numeric IDs to \nflash areas\n.  A flash area is a\nregion of disk with the following properties:\n\n\n1. An area can be fully erased without affecting any other areas.\n2. A write to one area does not restrict writes to other areas.\n\n\n\
 n\n\nThe boot loader uses the following flash areas:\n\n\n#define FLASH_AREA_BOOTLOADER                    0\n\n\n#define FLASH_AREA_IMAGE_0                       1\n\n\n#define FLASH_AREA_IMAGE_1                       2\n\n\n#define FLASH_AREA_IMAGE_SCRATCH                 3\n\n\n\n\n\n\nImage Slots\n\n\nA portion of the flash memory is partitioned into two image slots: a primary\nslot and a secondary slot.  The boot loader will only run an image from the\nprimary slot, so images must be built such that they can run from that fixed\nlocation in flash.  If the boot loader needs to run the image resident in the\nsecondary slot, it must swap the two images in flash prior to booting.\n\n\nIn addition to the two image slots, the boot loader requires a scratch area to\nallow for reliable image swapping.\n\n\nBoot States\n\n\nLogically, you can think of a pair of flags associated with each image slot:\npending and confirmed.  On startup, the boot loader determines the state of the\ndevice
  by inspecting each pair of flags.  These flags have the following\nmeanings:\n\n\n\n\npending: image gets tested on next reboot; absent subsequent confirm command,\n           revert to original image on second reboot.\n\n\nconfirmed: always use image unless excluded by a test image.\n\n\n\n\nIn English, when the user wants to run the secondary image, they set the\npending flag for the second slot and reboot the device.  On startup, the boot\nloader will swap the two images in flash, clear the secondary slot's pending\nflag, and run the newly-copied image in slot 0.  This is a temporary state; if\nthe device reboots again, the boot loader swaps the images back to their\noriginal slots and boots into the original image.  If the user doesn't want to\nrevert to the original state, they can make the current state permanent by\nsetting the confirmed flag in slot 0.\n\n\nSwitching to an alternate image is a two-step process (set + confirm) to\nprevent a device from becoming \"bricked\" b
 y bad firmware.  If the device\ncrashes immediately upon booting the second image, the boot loader reverts to\nthe working image, rather than repeatedly rebooting into the bad image.\n\n\nThe following set of tables illustrate the three possible states that the\ndevice can be in:\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |        |\n     confirmed |   X    |        |\n---------------+--------+--------\n\nImage 0 confirmed;               |\nNo change on reboot              |\n---------------------------------\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |   X    |\n     confirmed |   X    |        |\n---------------+--------+--------\n\nImage 0 confirmed;               |\nTest image 1 on next reboot      |\n---------------------------------\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |        |\n     confirmed |   
      |   X    |\n---------------+--------+--------\n\nTesting image 0;                 |\nRevert to image 1 on next reboot |\n---------------------------------\n\n\n\n\n\n\nBoot Vector\n\n\nAt startup, the boot loader determines which of the above three boot states a device is in by inspecting the boot vector.  The boot vector consists of two\nrecords (called \"image trailers\"), one written at the end of each image slot.\nAn image trailer has the following structure:\n\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~                       MAGIC (16 octets)                       ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~                                                               ~\n~             Swap status (128 * min-write-size * 3)            ~\n~                                                     
           ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Copy done   |     0xff padding (up to min-write-sz - 1)     ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Image OK    |     0xff padding (up to min-write-sz - 1)     ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n\n\n\nThese records are at the end of each image slot.  The offset immediately\nfollowing such a record represents the start of the next flash area.\n\n\nNote: \"min-write-size\" is a property of the flash hardware.  If the hardware\nallows individual bytes to be written at arbitrary addresses, then\nmin-write-size is 1.  If the hardware only allows writes at even addresses,\nthen min-write-size is 2, and so on.\n\n\nThe fields are defined as follows:\n\n\n\n\n\n\nMAGIC: The following 16 bytes, written in host-byte-order:\n\n\nconst uint32_t boot_img_magic[4] = {\n    0xf395c277,\n    0x7fefd260,\n    0x0f505235,\n    0x8079b62c,\n};\n\n
 \n\n\n\n\nSwap status: A series of single-byte records.  Each record corresponds to a\nflash sector in an image slot.  A swap status byte indicate the location of\nthe corresponding sector data.  During an image swap, image data is moved one\nsector at a time.  The swap status is necessary for resuming a swap operation\nif the device rebooted before a swap operation completed.\n\n\n\n\n\n\nCopy done: A single byte indicating whether the image in this slot is\ncomplete (0x01=d\n bok@bok.net\n35d33\n\n ericmanganaro@gmail.com\n42d39\n\n tam@proxy.co\n55d51\n\n nathan@natb1.com\n110d105\n\n rvs@apache.orgone; 0xff=not done).\n\n\n\n\n\n\nImage OK: A single byte indicating whether the image in this slot has been\nconfirmed as good by the user (0x01=confirmed; 0xff=not confirmed).\n\n\n\n\n\n\nThe boot vector records are structured around the limitations imposed by flash\nhardware.  As a consequence, they do not have a very intuitive design, and it\nis difficult to get a sense of the sta
 te of the device just by looking at the\nboot vector.  It is better to map all the possible vector states to the swap types (None, Test, Revert)\nvia a set of tables.  These tables are reproduced below.\nIn these tables, the \"pending\" and \"confirmed\" flags are shown for illustrative\npurposes; they are not actually present in the boot vector.\n\n\nState I\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Unset  | Unset  |\n        image-ok | Any    | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: none                        |\n-----------------------------------\n\n\n\nState II\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Any    | Good   |\n        image-ok | Any    | N/A    |\n-----------------+--------+--------\n\n         pending |        |   X    |\n      co
 nfirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: test                        |\n-----------------------------------\n\n\n\nState III\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Good   | Unset  |\n        image-ok | 0xff   | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |        |   X    |\n-----------------+--------+--------\n\n swap: revert (test image running) |\n-----------------------------------\n\n\n\nState IV\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Good   | Unset  |\n        image-ok | 0x01   | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: none (confirmed test image) |\n-----------------------------------\n\n\n\n\n\n\nHigh-level Operation\n\n\nWith the terms defin
 ed, we can now explore the boot loader's operation.  First,\na high-level overview of the boot process is presented.  Then, the following\nsections describe each step of the process in more detail.\n\n\nProcedure:\n\n\nA. Inspect swap status region; is an interrupted swap is being resumed?\n    Yes: Complete the partial swap operation; skip to step C.\n    No: Proceed to step B.\n\n\nB. Insect boot vector; is a swap requested?\n    Yes.\n        1. Is the requested image valid (integrity and security check)?\n            Yes.\n                a. Perform swap operation.\n                b. Persist completion of swap procedure to boot vector.\n                c. Proceed to step C.\n            No.\n                a. Erase invalid image.\n                b. Persist failure of swap procedure to boot vector.\n                c. Proceed to step C.\n    No: Proceed to step C.\n\n\nC. Boot into image in slot 0.\n\n\nImage Swapping\n\n\nThe boot loader swaps the contents of the two image sl
 ots for two reasons:\n    * User has issued an \"image test\" operation; the image in slot-1 should be\n      run once (state II).\n    * Test image rebooted without being confirmed; the boot loader should\n      revert to the original image currently in slot-1 (state III).\n\n\nIf the boot vector indicates that the image in the secondary slot should be\nrun, the boot loader needs to copy it to the primary slot.  The image currently\nin the primary slot also needs to be retained in flash so that it can be used\nlater.  Furthermore, both images need to be recoverable if the boot loader\nresets in the middle of the swap operation.  The two images are swapped\naccording to the following procedure:\n\n\n1. Determine how many flash sectors each image slot consists of.  This\n   number must be the same for both slots.\n2. Iterate the list of sector indices in descending order (i.e., starting\n   with the greatest index); current element = \nindex\n.\n    b. Erase scratch area.\n    c. Cop
 y slot0[index] to scratch area.\n    d. Write updated swap status (i).\n\n    e. Erase slot1[index]\n    f. Copy slot0[index] to slot1[index]\n        - If these are the last sectors (i.e., first swap being perfomed),\n          copy the full sector *except* the image trailer.\n        - Else, copy entire sector contents.\n    g. Write updated swap status (ii).\n\n    h. Erase slot0[index].\n    i. Copy scratch area slot0[index].\n    j. Write updated swap status (iii).\n\n3. Persist completion of swap procedure to slot 0 image trailer.\n\n\n\n\n\nThe additional caveats in step 2f are necessary so that the slot 1 image trailer\ncan be written by the user at a later time.  With the image trailer unwritten,\nthe user can test the image in slot 1 (i.e., transition to state II).\n\n\nThe particulars of step 3 vary depending on whether an image is being tested or\nreverted:\n    * test:\n        o Write slot0.copy_done = 1\n        (should now be in state III)\n\n\n* revert:\n    o Write
  slot0.magic = BOOT_MAGIC\n    o Write slot0.copy_done = 1\n    o Write slot0.image_ok = 1\n    (should now be in state IV)\n\n\n\n\n\nSwap Status\n\n\nThe swap status region allows the boot loader to recover in case it restarts in\nthe middle of an image swap operation.  The swap status region consists of a\nseries of single-byte records.  These records are written independently, and\ntherefore must be padded according to the minimum write size imposed by the\nflash hardware.  In the below figure, a min-write-size of 1 is assumed for\nsimplicity.  The structure of the swap status region is illustrated below.  In\nthis figure, a min-write-size of 1 is assumed for simplicity.\n\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec127,state 0 |sec127,state 1 |sec127,state 2 |sec126,state 0 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
 +-+-+-+-+-+-+-+-+-+-+\n|sec126,state 1 |sec126,state 2 |sec125,state 0 |sec125,state 1 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec125,state 2 |                                               |\n+-+-+-+-+-+-+-+-+                                               +\n~                                                               ~\n~               [Records for indices 124 through 1              ~\n~                                                               ~\n~               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~               |sec000,state 0 |sec000,state 1 |sec000,state 2 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n\n\n\nAnd now, in English...\n\n\nEach image slot is partitioned into a sequence of flash sectors.  If we were to\nenumerate the sectors in a single slot, starting at 0, we would have a list of\nsector indices.  Since there are two image slots, each sector index would\ncorrespond to a pair of sector
 s.  For example, sector index 0 corresponds to\nthe first sector in slot 0 and the first sector in slot 1.  Furthermore, we\nimpose a limit of 128 indices.  If an image slot consists of more than 128\nsectors, the flash layout is not compatible with this boot loader.  Finally,\nreverse the list of indices such that the list starts with index 127 and ends\nwith 0.  The swap status region is a representation of this reversed list.\n\n\nDuring a swap operation, each sector index transitions through four separate\nstates:\n    0. slot 0: image 0,   slot 1: image 1,   scratch: N/A\n    1. slot 0: image 0,   slot 1: N/A,       scratch: image 1 (1-\ns, erase 1)\n    2. slot 0: N/A,       slot 1: image 0,   scratch: image 1 (0-\n1, erase 0)\n    3. slot 0: image 1,   slot 1: image 0,   scratch: N/A     (s-\n0)\n\n\nEach time a sector index transitions to a new state, the boot loader writes a\nrecord to the swap status region.  Logically, the boot loader only needs one\nrecord per sector ind
 ex to keep track of the current swap state.  However, due\nto limitations imposed by flash hardware, a record cannot be overwritten when\nan index's state changes.  To solve this problem, the boot loader uses three\nrecords per sector index rather than just one.\n\n\nEach sector-state pair is represented as a set of three records.  The record\nvalues map to the above four states as follows\n\n\n        | rec0 | rec1 | rec2\n--------+------+------+------\nstate 0 | 0xff | 0xff | 0xff\nstate 1 | 0x01 | 0xff | 0xff\nstate 2 | 0x01 | 0x02 | 0xff\nstate 3 | 0x01 | 0x02 | 0x03\n\n\n\n\n\nThe swap status region can accommodate 128 sector indices.  Hence, the size of\nthe region, in bytes, is 128 * min-write-size * 3.  The number 128 is chosen\nsomewhat arbitrarily and will likely be made configurable.  The only\nrequirement for the index count is that is is great enough to account for a\nmaximum-sized image (i.e., at least as great as the total sector count in an\nimage slot).  If a device
 's image slots use less than 128 sectors, the first\nrecord that gets written will be somewhere in the middle of the region.  For\nexample, if a slot uses 64 sectors, the first sector index that gets swapped is\n63, which corresponds to the exact halfway point within the region.\n\n\nReset Recovery\n\n\nIf the boot loader resets in the middle of a swap operation, the two images may\nbe discontiguous in flash.  Bootutil recovers from this condition by using the\nboot vector to determine how the image parts are distributed in flash.\n\n\nThe first step is determine where the relevant swap status region is located.\nBecause this region is embedded within the image slots, its location in flash\nchanges during a swap operation.  The below set of tables map boot vector\ncontents to swap status location.  In these tables, the \"source\" field\nindicates where the swap status region is located.\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Go
 od       | Any        |\ncopy-done | 0x01       | N/A        |\n----------+------------+------------\n\nsource: none                        |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Good       | Any        |\ncopy-done | 0xff       | N/A        |\n----------+------------+------------\n\nsource: slot 0                      |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Any        | Good       |\ncopy-done | Any        | N/A        |\n----------+------------+------------\n\nsource: scratch                     |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Unset      | Any        |\ncopy-done | 0xff       | N/A        |\n----------+------------+------------|\nsource: varies                      |\n------------------------
 ------------+------------------------------+\nThis represents one of two cases:                                  |\no No swaps ever (no status to read, so no harm in checking).       |\no Mid-revert; status in slot 0.                                    |\n-------------------------------------------------------------------\n\n\n\n\n\n\nIf the swap status region indicates that the images are not contiguous,\nbootutil completes the swap operation that was in progress when the system was\nreset.  In other words, it applies the procedure defined in the previous\nsection, moving image 1 into slot 0 and image 0 into slot 1.  If the boot\nstatus file indicates that an image part is present in the scratch area, this\npart is copied into the correct location by starting at step e or step h in the\narea-swap procedure, depending on whether the part belongs to image 0 or image\n1.\n\n\nAfter the swap operation has been completed, the boot loader proceeds as though\nit had just been started.\n\n
 \nIntegrity Check\n\n\nAn image is checked for integrity immediately before it gets copied into the\nprimary slot.  If the boot loader doesn't perform an image swap, then it\ndoesn't perform an integrity check.\n\n\nDuring the integrity check, the boot loader verifies the following aspects of\nan image:\n    * 32-bit magic number must be correct (0x96f3b83c).\n    * Image must contain a SHA256 TLV.\n    * Calculated SHA256 must matche SHA256 TLV contents.\n    * Image \nmay\n contain a signature TLV.  If it does, its contents must be\n      verifiable using a key embedded in the boot loader.\n\n\nImage Signing and Verification\n\n\nAs indicated above, the final step of the integrity check is signature\nverification.  The boot loader can have one or more public keys embedded in it\nat build time.  During signature verification, the boot loader verifies that an\nimage was signed with a private key that corresponds to one of its public keys.\nThe image signature TLV indicates the index
  of the key that is has been signed\nwith.  The boot loader uses this index to identify the corresponding public\nkey.\n\n\nFor information on embedding public keys in the boot loader, as well as\nproducing signed images, see: boot/bootutil/signed_images.md", 
+            "text": "Bootloader\n\n\nThe \"bootloader\" is the code that loads the Mynewt OS image into memory and conducts some checks before allowing the OS to be run. It manages images for the embedded system and upgrades of those images using protocols over various interfaces (e.g. serial, BLE etc.). Typically, systems with bootloaders have at least two program images coexisting on the same microcontroller, and hence must include branch code that performs a check to see if an attempt to update software is already underway and manage the progress of the process.\n\n\nThe bootloader in the Apache Mynewt project verifies the cryptographic signature of the firmware image before running it. It maintains a detailed status log for each stage of the boot process. For verification of the authenticity of the OS image, it:\n\n\n\n\nCalculates hash of the image.\n\n\nUses public key to uncover hash value from included signature. \n\n\nCompares the calculated and uncovered hashes for a match
 .\n\n\n\n\nThe \"secure bootloader\" should be placed in protected memory on a given microcontroller.\n\n\nThe Mynewt bootloader comprises two packages:\n\n\n\n\nThe bootutil library (boot/bootutil)\n\n\nThe boot application (apps/boot)\n\n\n\n\nThe Mynewt code is thus structured so that the generic bootutil library performs most of the functions of a boot loader. The final step of actually jumping to the main image is kept out of the bootutil library.  This last step should instead be implemented in an\narchitecture-specific project.  Boot loader functionality is separated in this\nmanner for the following two reasons:\n\n\n\n\nBy keeping architecture-dependent code separate, the bootutil library can be\n   reused among several boot loaders.\n\n\nBy excluding the last boot step from the library, the bootloader can be unit tested since a library can be unit tested but an applicant can't.\n\n\n\n\nLimitations\n\n\nThe boot loader currently only supports images with the following\ncha
 racteristics:\n\n\n\n\nBuilt to run from flash.\n\n\nBuild to run from a fixed location (i.e., position-independent).\n\n\n\n\nImage Format\n\n\nThe following definitions describe the image header format.\n\n\n#define IMAGE_MAGIC                 0x96f3b83c\n\n\n#define IMAGE_MAGIC_NONE            0xffffffff\n\n\n\nstruct\n \nimage_version\n {\n    \nuint8_t\n \niv_major\n;\n    \nuint8_t\n \niv_minor\n;\n    \nuint16_t\n \niv_revision\n;\n    \nuint32_t\n \niv_build_num\n;\n};\n\n\n/** Image header.  All fields are in little endian byte order. */\n\n\nstruct\n \nimage_header\n {\n    \nuint32_t\n \nih_magic\n;\n    \nuint16_t\n \nih_tlv_size\n; \n/* Trailing TLVs */\n\n    \nuint8_t\n  \nih_key_id\n;\n    \nuint8_t\n  \n_pad1\n;\n    \nuint16_t\n \nih_hdr_s\n \nbok@bok\n.\nnet\n\n    \nuint16_t\n \n_pad2\n;\n    \nuint32_t\n \nih_img_size\n; \n/* Does not include header. */\n\n    \nuint32_t\n \nih_flags\n;\n    \nstruct\n \nimage_version\n \nih_ver\n;\n    \nuint32_t\n \n_pad3\n;\n
 };\n\n\n\n\n\nThe \nih_hdr_size\n field indicates the length of the header, and therefore the\noffset of the image itself.  This field provides for backwards compatibility in\ncase of changes to the format of the image header.\n\n\nThe following are the image header flags available.\n\n\n#define IMAGE_F_PIC                   0x00000001\n\n\n#define IMAGE_F_SHA256                0x00000002    \n/* Image contains hash TLV */\n\n\n#define IMAGE_F_PKCS15_RSA2048_SHA256 0x00000004 \n/* PKCS15 w/RSA and SHA */\n\n\n#define IMAGE_F_ECDSA224_SHA256       0x00000008  \n/* ECDSA256 over SHA256 */\n\n\n#define IMAGE_F_NON_BOOTABLE          0x00000010\n\n\n#define IMAGE_HEADER_SIZE           32\n\n\n\n\n\n\nOptional type-length-value records (TLVs) containing image metadata are placed\nafter the end of the image. For example, security data gets added as a footer at the end of the image.\n\n\n/** Image trailer TLV format. All fields in little endian. */\n\n\nstruct\n \nimage_tlv\n {\n    \nuint8
 _t\n  \nit_type\n;   \n/* IMAGE_TLV_[...]. */\n\n    \nuint8_t\n  \n_pad\n;\n    \nuint16_t\n \nit_len\n     \n/* Data length (not including TLV header). */\n\n};\n\n\n/*\n\n\n * Image trailer TLV types.\n\n\n */\n\n\n#define IMAGE_TLV_SHA256            1   \n/* SHA256 of image hdr and body */\n\n\n#define IMAGE_TLV_RSA2048           2   \n/* RSA2048 of hash output */\n\n\n#define IMAGE_TLV_ECDSA224          3   \n/* ECDSA of hash output */\n\n\n\n\n\n\nFlash Map\n\n\nA Mynewt device's flash is partitioned according to its \nflash map\n.  At a high\nlevel, the flash map maps numeric IDs to \nflash areas\n.  A flash area is a\nregion of disk with the following properties:\n\n\n1. An area can be fully erased without affecting any other areas.\n2. A write to one area does not restrict writes to other areas.\n\n\n\n\n\nThe boot loader uses the following flash areas:\n\n\n#define FLASH_AREA_BOOTLOADER                    0\n\n\n#define FLASH_AREA_IMAGE_0                       1\n\n\n#defi
 ne FLASH_AREA_IMAGE_1                       2\n\n\n#define FLASH_AREA_IMAGE_SCRATCH                 3\n\n\n\n\n\n\nImage Slots\n\n\nA portion of the flash memory is partitioned into two image slots: a primary\nslot and a secondary slot.  The boot loader will only run an image from the\nprimary slot, so images must be built such that they can run from that fixed\nlocation in flash.  If the boot loader needs to run the image resident in the\nsecondary slot, it must swap the two images in flash prior to booting.\n\n\nIn addition to the two image slots, the boot loader requires a scratch area to\nallow for reliable image swapping.\n\n\nBoot States\n\n\nLogically, you can think of a pair of flags associated with each image slot:\npending and confirmed.  On startup, the boot loader determines the state of the\ndevice by inspecting each pair of flags.  These flags have the following\nmeanings:\n\n\n\n\npending: image gets tested on next reboot; absent subsequent confirm command,\n         
   revert to original image on second reboot.\n\n\nconfirmed: always use image unless excluded by a test image.\n\n\n\n\nIn English, when the user wants to run the secondary image, they set the\npending flag for the second slot and reboot the device.  On startup, the boot\nloader will swap the two images in flash, clear the secondary slot's pending\nflag, and run the newly-copied image in slot 0.  This is a temporary state; if\nthe device reboots again, the boot loader swaps the images back to their\noriginal slots and boots into the original image.  If the user doesn't want to\nrevert to the original state, they can make the current state permanent by\nsetting the confirmed flag in slot 0.\n\n\nSwitching to an alternate image is a two-step process (set + confirm) to\nprevent a device from becoming \"bricked\" by bad firmware.  If the device\ncrashes immediately upon booting the second image, the boot loader reverts to\nthe working image, rather than repeatedly rebooting into the bad
  image.\n\n\nThe following set of tables illustrate the three possible states that the\ndevice can be in:\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |        |\n     confirmed |   X    |        |\n---------------+--------+--------\n\nImage 0 confirmed;               |\nNo change on reboot              |\n---------------------------------\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |   X    |\n     confirmed |   X    |        |\n---------------+--------+--------\n\nImage 0 confirmed;               |\nTest image 1 on next reboot      |\n---------------------------------\n\n\n               | slot-0 | slot-1 |\n---------------+--------+--------|\n       pending |        |        |\n     confirmed |        |   X    |\n---------------+--------+--------\n\nTesting image 0;                 |\nRevert to image 1 on next reboot |\n---------------------------------\n\n\n\n\n\n\nBo
 ot Vector\n\n\nAt startup, the boot loader determines which of the above three boot states a device is in by inspecting the boot vector.  The boot vector consists of two\nrecords (called \"image trailers\"), one written at the end of each image slot.\nAn image trailer has the following structure:\n\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~                       MAGIC (16 octets)                       ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~                                                               ~\n~             Swap status (128 * min-write-size * 3)            ~\n~                                                               ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Copy done   |     0xff padding (up to min-write-sz - 1)     ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|   Image OK    |     0xff padding (up to min-write-sz - 1)     ~\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n\n\n\nThese records are at the end of each image slot.  The offset immediately\nfollowing such a record represents the start of the next flash area.\n\n\nNote: \"min-write-size\" is a property of the flash hardware.  If the hardware\nallows individual bytes to be written at arbitrary addresses, then\nmin-write-size is 1.  If the hardware only allows writes at even addresses,\nthen min-write-size is 2, and so on.\n\n\nThe fields are defined as follows:\n\n\n\n\n\n\nMAGIC: The following 16 bytes, written in host-byte-order:\n\n\nconst uint32_t boot_img_magic[4] = {\n    0xf395c277,\n    0x7fefd260,\n    0x0f505235,\n    0x8079b62c,\n};\n\n\n\n\n\n\nSwap status: A series of single-byte records.  Each record corresponds to a\nflash sector in an image slot.  A swap status byte indicate the location of\nthe corresp
 onding sector data.  During an image swap, image data is moved one\nsector at a time.  The swap status is necessary for resuming a swap operation\nif the device rebooted before a swap operation completed.\n\n\n\n\n\n\nCopy done: A single byte indicating whether the image in this slot is\ncomplete (0x01=d\n bok@bok.net\n35d33\n\n ericmanganaro@gmail.com\n42d39\n\n tam@proxy.co\n55d51\n\n nathan@natb1.com\n110d105\n\n rvs@apache.orgone; 0xff=not done).\n\n\n\n\n\n\nImage OK: A single byte indicating whether the image in this slot has been\nconfirmed as good by the user (0x01=confirmed; 0xff=not confirmed).\n\n\n\n\n\n\nThe boot vector records are structured around the limitations imposed by flash\nhardware.  As a consequence, they do not have a very intuitive design, and it\nis difficult to get a sense of the state of the device just by looking at the\nboot vector.  It is better to map all the possible vector states to the swap types (None, Test, Revert)\nvia a set of tables.  These t
 ables are reproduced below.\nIn these tables, the \"pending\" and \"confirmed\" flags are shown for illustrative\npurposes; they are not actually present in the boot vector.\n\n\nState I\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Unset  | Unset  |\n        image-ok | Any    | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: none                        |\n-----------------------------------\n\n\n\nState II\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Any    | Good   |\n        image-ok | Any    | N/A    |\n-----------------+--------+--------\n\n         pending |        |   X    |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: test                        |\n-----------------------------------\n\n\n\nState III\n              
    | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Good   | Unset  |\n        image-ok | 0xff   | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |        |   X    |\n-----------------+--------+--------\n\n swap: revert (test image running) |\n-----------------------------------\n\n\n\nState IV\n                 | slot-0 | slot-1 |\n-----------------+--------+--------|\n           magic | Good   | Unset  |\n        image-ok | 0x01   | N/A    |\n-----------------+--------+--------\n\n         pending |        |        |\n      confirmed  |   X    |        |\n-----------------+--------+--------\n\n swap: none (confirmed test image) |\n-----------------------------------\n\n\n\n\n\n\nHigh-level Operation\n\n\nWith the terms defined, we can now explore the boot loader's operation.  First,\na high-level overview of the boot process is presented.  Then, the following\nsections describe each step of the p
 rocess in more detail.\n\n\nProcedure:\n\n\nA. Inspect swap status region; is an interrupted swap is being resumed?\n    Yes: Complete the partial swap operation; skip to step C.\n    No: Proceed to step B.\n\n\nB. Insect boot vector; is a swap requested?\n    Yes.\n        1. Is the requested image valid (integrity and security check)?\n            Yes.\n                a. Perform swap operation.\n                b. Persist completion of swap procedure to boot vector.\n                c. Proceed to step C.\n            No.\n                a. Erase invalid image.\n                b. Persist failure of swap procedure to boot vector.\n                c. Proceed to step C.\n    No: Proceed to step C.\n\n\nC. Boot into image in slot 0.\n\n\nImage Swapping\n\n\nThe boot loader swaps the contents of the two image slots for two reasons:\n    * User has issued an \"image test\" operation; the image in slot-1 should be\n      run once (state II).\n    * Test image rebooted without being con
 firmed; the boot loader should\n      revert to the original image currently in slot-1 (state III).\n\n\nIf the boot vector indicates that the image in the secondary slot should be\nrun, the boot loader needs to copy it to the primary slot.  The image currently\nin the primary slot also needs to be retained in flash so that it can be used\nlater.  Furthermore, both images need to be recoverable if the boot loader\nresets in the middle of the swap operation.  The two images are swapped\naccording to the following procedure:\n\n\n1. Determine how many flash sectors each image slot consists of.  This\n   number must be the same for both slots.\n2. Iterate the list of sector indices in descending order (i.e., starting\n   with the greatest index); current element = \nindex\n.\n    b. Erase scratch area.\n    c. Copy slot0[index] to scratch area.\n    d. Write updated swap status (i).\n\n    e. Erase slot1[index]\n    f. Copy slot0[index] to slot1[index]\n        - If these are the last 
 sectors (i.e., first swap being perfomed),\n          copy the full sector *except* the image trailer.\n        - Else, copy entire sector contents.\n    g. Write updated swap status (ii).\n\n    h. Erase slot0[index].\n    i. Copy scratch area slot0[index].\n    j. Write updated swap status (iii).\n\n3. Persist completion of swap procedure to slot 0 image trailer.\n\n\n\n\n\nThe additional caveats in step 2f are necessary so that the slot 1 image trailer\ncan be written by the user at a later time.  With the image trailer unwritten,\nthe user can test the image in slot 1 (i.e., transition to state II).\n\n\nThe particulars of step 3 vary depending on whether an image is being tested or\nreverted:\n    * test:\n        o Write slot0.copy_done = 1\n        (should now be in state III)\n\n\n* revert:\n    o Write slot0.magic = BOOT_MAGIC\n    o Write slot0.copy_done = 1\n    o Write slot0.image_ok = 1\n    (should now be in state IV)\n\n\n\n\n\nSwap Status\n\n\nThe swap status region 
 allows the boot loader to recover in case it restarts in\nthe middle of an image swap operation.  The swap status region consists of a\nseries of single-byte records.  These records are written independently, and\ntherefore must be padded according to the minimum write size imposed by the\nflash hardware.  In the below figure, a min-write-size of 1 is assumed for\nsimplicity.  The structure of the swap status region is illustrated below.  In\nthis figure, a min-write-size of 1 is assumed for simplicity.\n\n\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec127,state 0 |sec127,state 1 |sec127,state 2 |sec126,state 0 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec126,state 1 |sec126,state 2 |sec125,state 0 |sec125,state 1 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|sec125,state 2 | 
                                               |\n+-+-+-+-+-+-+-+-+                                               +\n~                                                               ~\n~               [Records for indices 124 through 1              ~\n~                                                               ~\n~               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n~               |sec000,state 0 |sec000,state 1 |sec000,state 2 |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n\n\n\nAnd now, in English...\n\n\nEach image slot is partitioned into a sequence of flash sectors.  If we were to\nenumerate the sectors in a single slot, starting at 0, we would have a list of\nsector indices.  Since there are two image slots, each sector index would\ncorrespond to a pair of sectors.  For example, sector index 0 corresponds to\nthe first sector in slot 0 and the first sector in slot 1.  Furthermore, we\nimpose a limit of 128 indices.  If an image slot c
 onsists of more than 128\nsectors, the flash layout is not compatible with this boot loader.  Finally,\nreverse the list of indices such that the list starts with index 127 and ends\nwith 0.  The swap status region is a representation of this reversed list.\n\n\nDuring a swap operation, each sector index transitions through four separate\nstates:\n    0. slot 0: image 0,   slot 1: image 1,   scratch: N/A\n    1. slot 0: image 0,   slot 1: N/A,       scratch: image 1 (1-\ns, erase 1)\n    2. slot 0: N/A,       slot 1: image 0,   scratch: image 1 (0-\n1, erase 0)\n    3. slot 0: image 1,   slot 1: image 0,   scratch: N/A     (s-\n0)\n\n\nEach time a sector index transitions to a new state, the boot loader writes a\nrecord to the swap status region.  Logically, the boot loader only needs one\nrecord per sector index to keep track of the current swap state.  However, due\nto limitations imposed by flash hardware, a record cannot be overwritten when\nan index's state changes.  To solve t
 his problem, the boot loader uses three\nrecords per sector index rather than just one.\n\n\nEach sector-state pair is represented as a set of three records.  The record\nvalues map to the above four states as follows\n\n\n        | rec0 | rec1 | rec2\n--------+------+------+------\nstate 0 | 0xff | 0xff | 0xff\nstate 1 | 0x01 | 0xff | 0xff\nstate 2 | 0x01 | 0x02 | 0xff\nstate 3 | 0x01 | 0x02 | 0x03\n\n\n\n\n\nThe swap status region can accommodate 128 sector indices.  Hence, the size of\nthe region, in bytes, is 128 * min-write-size * 3.  The number 128 is chosen\nsomewhat arbitrarily and will likely be made configurable.  The only\nrequirement for the index count is that is is great enough to account for a\nmaximum-sized image (i.e., at least as great as the total sector count in an\nimage slot).  If a device's image slots use less than 128 sectors, the first\nrecord that gets written will be somewhere in the middle of the region.  For\nexample, if a slot uses 64 sectors, the firs
 t sector index that gets swapped is\n63, which corresponds to the exact halfway point within the region.\n\n\nReset Recovery\n\n\nIf the boot loader resets in the middle of a swap operation, the two images may\nbe discontiguous in flash.  Bootutil recovers from this condition by using the\nboot vector to determine how the image parts are distributed in flash.\n\n\nThe first step is determine where the relevant swap status region is located.\nBecause this region is embedded within the image slots, its location in flash\nchanges during a swap operation.  The below set of tables map boot vector\ncontents to swap status location.  In these tables, the \"source\" field\nindicates where the swap status region is located.\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Good       | Any        |\ncopy-done | 0x01       | N/A        |\n----------+------------+------------\n\nsource: none                        |\n--------------------------------
 ----\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Good       | Any        |\ncopy-done | 0xff       | N/A        |\n----------+------------+------------\n\nsource: slot 0                      |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Any        | Good       |\ncopy-done | Any        | N/A        |\n----------+------------+------------\n\nsource: scratch                     |\n------------------------------------\n\n\n          | slot-0     | scratch    |\n----------+------------+------------|\n    magic | Unset      | Any        |\ncopy-done | 0xff       | N/A        |\n----------+------------+------------|\nsource: varies                      |\n------------------------------------+------------------------------+\nThis represents one of two cases:                                  |\no No swaps ever (no status to read, so no harm in checking)
 .       |\no Mid-revert; status in slot 0.                                    |\n-------------------------------------------------------------------\n\n\n\n\n\n\nIf the swap status region indicates that the images are not contiguous,\nbootutil completes the swap operation that was in progress when the system was\nreset.  In other words, it applies the procedure defined in the previous\nsection, moving image 1 into slot 0 and image 0 into slot 1.  If the boot\nstatus file indicates that an image part is present in the scratch area, this\npart is copied into the correct location by starting at step e or step h in the\narea-swap procedure, depending on whether the part belongs to image 0 or image\n1.\n\n\nAfter the swap operation has been completed, the boot loader proceeds as though\nit had just been started.\n\n\nIntegrity Check\n\n\nAn image is checked for integrity immediately before it gets copied into the\nprimary slot.  If the boot loader doesn't perform an image swap, then it\n
 doesn't perform an integrity check.\n\n\nDuring the integrity check, the boot loader verifies the following aspects of\nan image:\n    * 32-bit magic number must be correct (0x96f3b83c).\n    * Image must contain a SHA256 TLV.\n    * Calculated SHA256 must matche SHA256 TLV contents.\n    * Image \nmay\n contain a signature TLV.  If it does, its contents must be\n      verifiable using a key embedded in the boot loader.\n\n\nImage Signing and Verification\n\n\nAs indicated above, the final step of the integrity check is signature\nverification.  The boot loader can have one or more public keys embedded in it\nat build time.  During signature verification, the boot loader verifies that an\nimage was signed with a private key that corresponds to one of its public keys.\nThe image signature TLV indicates the index of the key that is has been signed\nwith.  The boot loader uses this index to identify the corresponding public\nkey.\n\n\nFor information on embedding public keys in the boo
 t loader, as well as\nproducing signed images, see: boot/bootutil/signed_images.md", 
             "title": "toc"
         }, 
         {
@@ -5337,7 +5337,7 @@
         }, 
         {
             "location": "/os/modules/bootloader/bootloader/#image-format", 
-            "text": "The following definitions describe the image header format.  #define IMAGE_MAGIC                 0x96f3b83c  #define IMAGE_MAGIC_NONE            0xffffffff  struct   image_version  {\n     uint8_t   iv_major ;\n     uint8_t   iv_minor ;\n     uint16_t   iv_revision ;\n     uint32_t   iv_build_num ;\n}; /** Image header.  All fields are in little endian byte order. */  struct   image_header  {\n     uint32_t   ih_magic ;\n     uint16_t   ih_tlv_size ;  /* Trailing TLVs */ \n     uint8_t    ih_key_id ;\n     uint8_t    _pad1 ;\n     uint16_t   ih_hdr_s   bok@bok . net  35 d33    ericmanganaro@gmail . com  42 d39    tam@proxy . co  55 d51    nathan@natb1 . com  110 d105    rvs@apache . orgize ;\n     uint16_t   _pad2 ;\n     uint32_t   ih_img_size ;  /* Does not include header. */ \n     uint32_t   ih_flags ;\n     struct   image_version   ih_ver ;\n     uint32_t   _pad3 ;\n};  The  ih_hdr_size  field indicates the length of the header, and therefore the\noffset of
  the image itself.  This field provides for backwards compatibility in\ncase of changes to the format of the image header.  The following are the image header flags available.  #define IMAGE_F_PIC                   0x00000001  #define IMAGE_F_SHA256                0x00000002     /* Image contains hash TLV */  #define IMAGE_F_PKCS15_RSA2048_SHA256 0x00000004  /* PKCS15 w/RSA and SHA */  #define IMAGE_F_ECDSA224_SHA256       0x00000008   /* ECDSA256 over SHA256 */  #define IMAGE_F_NON_BOOTABLE          0x00000010  #define IMAGE_HEADER_SIZE           32   Optional type-length-value records (TLVs) containing image metadata are placed\nafter the end of the image. For example, security data gets added as a footer at the end of the image.  /** Image trailer TLV format. All fields in little endian. */  struct   image_tlv  {\n     uint8_t    it_type ;    /* IMAGE_TLV_[...]. */ \n     uint8_t    _pad ;\n     uint16_t   it_len       /* Data length (not including TLV header). */ \n}; /*   * Ima
 ge trailer TLV types.   */  #define IMAGE_TLV_SHA256            1    /* SHA256 of image hdr and body */  #define IMAGE_TLV_RSA2048           2    /* RSA2048 of hash output */  #define IMAGE_TLV_ECDSA224          3    /* ECDSA of hash output */", 
+            "text": "The following definitions describe the image header format.  #define IMAGE_MAGIC                 0x96f3b83c  #define IMAGE_MAGIC_NONE            0xffffffff  struct   image_version  {\n     uint8_t   iv_major ;\n     uint8_t   iv_minor ;\n     uint16_t   iv_revision ;\n     uint32_t   iv_build_num ;\n}; /** Image header.  All fields are in little endian byte order. */  struct   image_header  {\n     uint32_t   ih_magic ;\n     uint16_t   ih_tlv_size ;  /* Trailing TLVs */ \n     uint8_t    ih_key_id ;\n     uint8_t    _pad1 ;\n     uint16_t   ih_hdr_s   bok@bok . net \n     uint16_t   _pad2 ;\n     uint32_t   ih_img_size ;  /* Does not include header. */ \n     uint32_t   ih_flags ;\n     struct   image_version   ih_ver ;\n     uint32_t   _pad3 ;\n};  The  ih_hdr_size  field indicates the length of the header, and therefore the\noffset of the image itself.  This field provides for backwards compatibility in\ncase of changes to the format of the image header.  The
  following are the image header flags available.  #defi

<TRUNCATED>


[5/7] incubator-mynewt-site git commit: PRs #160, #161, minor edits to various docs

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/bootloader/bootloader/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/bootloader/bootloader/index.html b/develop/os/modules/bootloader/bootloader/index.html
index 6e1a0bb..d30d8e4 100644
--- a/develop/os/modules/bootloader/bootloader/index.html
+++ b/develop/os/modules/bootloader/bootloader/index.html
@@ -602,14 +602,6 @@ characteristics:</p>
     <span style="color: #A90D91">uint8_t</span>  <span style="color: #000000">ih_key_id</span>;
     <span style="color: #A90D91">uint8_t</span>  <span style="color: #000000">_pad1</span>;
     <span style="color: #A90D91">uint16_t</span> <span style="color: #000000">ih_hdr_s&lt;</span> <span style="color: #000000">bok@bok</span>.<span style="color: #000000">net</span>
-<span style="color: #1C01CE">35</span><span style="color: #000000">d33</span>
-<span style="color: #000000">&lt;</span> <span style="color: #000000">ericmanganaro@gmail</span>.<span style="color: #000000">com</span>
-<span style="color: #1C01CE">42</span><span style="color: #000000">d39</span>
-<span style="color: #000000">&lt;</span> <span style="color: #000000">tam@proxy</span>.<span style="color: #000000">co</span>
-<span style="color: #1C01CE">55</span><span style="color: #000000">d51</span>
-<span style="color: #000000">&lt;</span> <span style="color: #000000">nathan@natb1</span>.<span style="color: #000000">com</span>
-<span style="color: #1C01CE">110</span><span style="color: #000000">d105</span>
-<span style="color: #000000">&lt;</span> <span style="color: #000000">rvs@apache</span>.<span style="color: #000000">orgize</span>;
     <span style="color: #A90D91">uint16_t</span> <span style="color: #000000">_pad2</span>;
     <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">ih_img_size</span>; <span style="color: #177500">/* Does not include header. */</span>
     <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">ih_flags</span>;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/drivers/driver/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/drivers/driver/index.html b/develop/os/modules/drivers/driver/index.html
index 96701da..bb0beec 100644
--- a/develop/os/modules/drivers/driver/index.html
+++ b/develop/os/modules/drivers/driver/index.html
@@ -343,6 +343,19 @@
           
               
           
+              
+                
+  
+  
+    <li><a href="
+  ../flash/
+">Supported Drivers</a>
+  
+  
+    </li>
+
+              
+          
     </ul>
   
     </li>
@@ -596,6 +609,46 @@
 <h3 id="example">Example</h3>
 <p>The Mynewt core repo includes an example of a driver using the HAL to provide extra functionality - the UART driver. It uses HAL GPIO and UART to provide multiple serial ports on the NRF52 (but allowed on other platforms too.)</p>
 <p>The gist of the driver design is that there is an API for the driver (for use by applications), and then sub-packages to that driver that implement that driver API using the HAL and BSP APIs.</p>
+<h3 id="implemented-drivers">Implemented drivers</h3>
+<p>Drivers live under <code>hw/drivers</code>. The current list of supported drivers includes:</p>
+<table>
+<thead>
+<tr>
+<th>Driver</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><a href="adc.md">adc</a></td>
+<td>TODO: ADC driver.</td>
+</tr>
+<tr>
+<td><a href="../flash/">flash</a></td>
+<td>SPI/I2C flash drivers.</td>
+</tr>
+<tr>
+<td><a href="lwip.md">lwip</a></td>
+<td>TODO: LWIP.</td>
+</tr>
+<tr>
+<td><a href="../mmc/">mmc</a></td>
+<td>MMC/SD card driver.</td>
+</tr>
+<tr>
+<td><a href="../../../../network/ble/ble_intro/">nimble</a></td>
+<td>NIMBLE.</td>
+</tr>
+<tr>
+<td><a href="sensors.md">sensors</a></td>
+<td>TODO: sensors.</td>
+</tr>
+<tr>
+<td><a href="uart.md">uart</a></td>
+<td>TODO: UART driver.</td>
+</tr>
+</tbody>
+</table>
                         
                         <div class="row">
                             
@@ -613,8 +666,8 @@
     </li>
     <li class="pull-right">
     
-    <a href=../../testutil/testutil/>
-        Next: Test Utilities
+    <a href=../flash/>
+        Next: flash
         <span class="fa fa-arrow-right"></span>
     </a>
     

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/drivers/flash/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/drivers/flash/index.html b/develop/os/modules/drivers/flash/index.html
new file mode 100644
index 0000000..9ec7b45
--- /dev/null
+++ b/develop/os/modules/drivers/flash/index.html
@@ -0,0 +1,744 @@
+<!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">
+        
+        
+        <!-- This is broken by doc revisioning.
+        <link rel="canonical" href="http://mynewt.apache.org/os/modules/drivers/flash/"> -->
+        <link rel="shortcut icon" href="../../../../img/favicon.ico">
+
+	    <title>flash - Apache Mynewt</title>
+
+        <link href="../../../../css/bootstrap-3.0.3.min.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="../../../../css/v2.css" rel="stylesheet">
+        <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
+        <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', 'auto');
+                ga('send', 'pageview');
+            </script>
+        
+    </head>
+
+
+    <body class="flash">
+
+
+        <div class="container">
+    <div class="row v2-main-banner">
+        <a class="logo-cell" href="/">
+            <img class="logo" src="/img/logo.png">
+        </a>
+        <div class="tagline-cell">
+            <h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4>
+        </div>
+        <div class="news-cell">
+            <div class="well">
+                <h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.0.0-b2</a> released (Feb 15, 2017)
+            </div>
+        </div>
+    </div>
+</div>
+
+        
+
+
+
+
+
+
+<nav id="navbar" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="150" role="navigation">
+    <div class="container">
+        <!-- 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 
+  class=""
+>
+                    <a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a>
+                </li>
+                <li 
+  class="important"
+>
+                    <a href="/quick-start/">Quick Start</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/about/">About</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/talks/">Talks</a>
+                </li>
+                <li 
+  class="active"
+>
+                    <a href="/latest/os/introduction">Documentation</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/download/">Download</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/community/">Community</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/events/">Events</a>
+                </li>
+            </ul>
+
+            <!-- Search, Navigation and Repo links -->
+            <ul class="nav navbar-nav navbar-right">
+                
+            </ul>
+        </div>
+    </div>
+</nav>
+
+        
+
+        <div class="container">
+            
+                <div class="row">
+                    <div class="col-md-3 v2-sidebar sidebar-container"><div id="docSidebar" class="hidden-print" role="complementary">
+    <div class="top">
+        <div role="search">
+            <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
+                <div class="form-group">
+                    <input type="text" name="q" class="form-control" placeholder="Search documentation" />
+                </div>
+            </form>
+        </div>
+    </div>
+    <ul class="toc-nav">
+      <li class="doc-version">
+<select class="form-control" onchange="if (this.value) window.location.href=this.value">
+    
+    <option
+      value="/develop/os/introduction"
+      selected="selected"
+    >
+      Version: develop (latest)
+    </option>
+    
+    <option
+      value="/v0_9_0/os/introduction"
+      
+    >
+      Version: 0.9.0
+    </option>
+    
+</select>
+</li>
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+          
+  
+  
+    <li ><a href="../../../introduction/">Mynewt Documentation</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../get_started/get_started/">Basic Setup</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../get_started/vocabulary/">Concepts</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../tutorials/tutorials/">Tutorials</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../os_user_guide/">OS User Guide</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/mynewt_os/">OS Core</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/porting/port_os/">Porting to your Platform</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../console/console/">Console</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../shell/shell/">Shell</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../split/split/">Split Images</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../bootloader/bootloader/">Bootloader</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  
+  
+  ../../fs/fs/fs/
+
+">File System</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../hal/hal/">Hardware Abstraction Layer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../driver/">Drivers</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ./
+">Supported Drivers</a>
+  
+  
+    <ul>
+          
+              
+                
+    <li class="active">
+      <a href="./">flash</a>
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../mmc/">mmc</a>
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../../network/ble/ble_intro/">nimBLE</a>
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../testutil/testutil/">Test Utilities</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../devmgmt/newtmgr/">Device Management with Newt Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../imgmgr/imgmgr/">Image Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../baselibc/">Baselibc library</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../elua/elua/">Embedded Lua</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../json/json/">JSON</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../fcb/fcb/">Flash Circular Buffer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../stats/stats/">Stats</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../logs/logs/">Logs</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../sysinitconfig/sysinitconfig/">System Configuration And Initialization</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ../../../../network/ble/ble_intro/
+">BLE User Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newt/newt_intro/">Newt Tool Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newtmgr/overview/">Newt Manager Guide</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+        
+      
+        
+          
+  
+  
+    <li><a href="
+  ../../../../faq/how_to_edit_docs/
+">Appendix</a>
+  
+  
+    </li>
+
+        
+      
+    </ul>
+</div></div>
+
+                    <div class="col-md-9" role="main">
+                        <div class="doc-header">
+                            <div role="navigation" aria-label="breadcrumbs navigation">
+  <ul class="wy-breadcrumbs pull-right">
+    <li><a href="/develop/os/introduction">Docs</a></li>
+    
+    
+        
+          <li>&raquo; <a href="../driver/">Drivers</a></li>
+        
+      
+        
+          <li>&raquo; Supported Drivers</li>
+        
+      
+      
+        <li>&raquo; flash</li>
+      
+    
+    
+  </ul>
+</div>
+                        </div>
+                        
+                            <h2 id="flash"><font color="#F2853F" style="font-size:24pt">flash</font></h2>
+<p>The flash driver subsystem is a work in progress which aims at supporting
+common external SPI/I2C flash/eeprom memory chips. This is equivalent
+to what Linux calls <code>MTD</code> for <code>Memory Technology Devices</code>.</p>
+<p>At the moment the only <code>flash</code> device that is already supported is the
+AT45DBxxx SPI flash family with the <code>at45db</code> driver.</p>
+<p>The flash driver aims for full compatibility with the <code>hal_flash</code> API,
+which means initialization and usage can be performed by any <code>fs</code> that
+supports the <code>hal_flash</code> interface.</p>
+<h4 id="initialization">Initialization</h4>
+<p>To be compatible with the standard <code>hal_flash</code> interface, the <code>at45db</code> driver
+embeds a <code>struct hal_flash</code> to its own <code>struct at45db_dev</code>. The whole <code>at45db_dev</code>
+struct is shown below.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">struct</span> <span style="color: #000000">at45db_dev</span> {
+    <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">hal</span>;
+    <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_spi_settings</span> <span style="color: #000000">*settings</span>;
+    <span style="color: #A90D91">int</span> <span style="color: #000000">spi_num</span>;
+    <span style="color: #A90D91">void</span> <span style="color: #000000">*spi_cfg</span>;                  <span style="color: #177500">/** Low-level MCU SPI config */</span>
+    <span style="color: #A90D91">int</span> <span style="color: #000000">ss_pin</span>;
+    <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">baudrate</span>;
+    <span style="color: #A90D91">uint16_t</span> <span style="color: #000000">page_size</span>;             <span style="color: #177500">/** Page size to be used, valid: 512 and 528 */</span>
+    <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">disable_auto_erase</span>;     <span style="color: #177500">/** Reads and writes auto-erase by default */</span>
+};
+</pre></div>
+
+
+<p>To ease with initialization a helper function <code>at45db_default_config</code> was added.
+It returns an already initialized <code>struct at45db_dev</code> leaving the user with just
+having to provide the SPI related config.</p>
+<p>To initialize the device, pass the <code>at45db_dev</code> struct to <code>at45db_init</code>.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">at45db_init</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>);
+</pre></div>
+
+
+<p>For low-level access to the device the following functions are provided:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">at45db_read</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">addr</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*buf</span>,
+                <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">len</span>);
+<span style="color: #A90D91">int</span> <span style="color: #000000">at45db_write</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">addr</span>, <span style="color: #A90D91">const</span> <span style="color: #A90D91">void</span> <span style="color: #000000">*buf</span>,
+                 <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">len</span>);
+<span style="color: #A90D91">int</span> <span style="color: #000000">at45db_erase_sector</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">sector_address</span>);
+<span style="color: #A90D91">int</span> <span style="color: #000000">at45db_sector_info</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*dev</span>, <span style="color: #A90D91">int</span> <span style="color: #000000">idx</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">*address</span>,
+                       <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">*sz</span>);
+</pre></div>
+
+
+<p>Also, <code>nffs</code> is able to run on the device due to the fact that standard <code>hal_flash</code>
+interface compatibility is provided. Due to current limitations of <code>nffs</code>, it can
+only run on <code>at45db</code> if the internal flash of the MCU is not being used.</p>
+<h4 id="dependencies">Dependencies</h4>
+<p>To include the <code>at45db</code> driver on a project, just include it as a dependency in your
+pkg.yml:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">pkg.deps:
+    - hw/drivers/flash/at45db
+</pre></div>
+
+
+<h4 id="header-file">Header file</h4>
+<p>The <code>at45db</code> SPI flash follows the standard <code>hal_flash</code> interface but requires
+that a special struct </p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include &lt;at45db/at45db.h&gt;</span>
+</pre></div>
+
+
+<h4 id="example">Example</h4>
+<p>This following examples assume that the <code>at45db</code> is being used on a STM32F4 MCU.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">int</span> <span style="color: #000000">SPI_SS_PIN</span>   <span style="color: #000000">=</span> <span style="color: #000000">MCU_GPIO_PORTA</span>(<span style="color: #1C01CE">4</span>);
+<span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">int</span> <span style="color: #000000">SPI_SCK_PIN</span>  <span style="color: #000000">=</span> <span style="color: #000000">MCU_GPIO_PORTA</span>(<span style="color: #1C01CE">5</span>);
+<span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">int</span> <span style="color: #000000">SPI_MISO_PIN</span> <span style="color: #000000">=</span> <span style="color: #000000">MCU_GPIO_PORTA</span>(<span style="color: #1C01CE">6</span>);
+<span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">int</span> <span style="color: #000000">SPI_MOSI_PIN</span> <span style="color: #000000">=</span> <span style="color: #000000">MCU_GPIO_PORTA</span>(<span style="color: #1C01CE">7</span>);
+
+<span style="color: #A90D91">struct</span> <span style="color: #000000">stm32f4_hal_spi_cfg</span> <span style="color: #000000">spi_cfg</span> <span style="color: #000000">=</span> {
+    .<span style="color: #000000">ss_pin</span>   <span style="color: #000000">=</span> <span style="color: #000000">SPI_SS_PIN</span>,
+    .<span style="color: #000000">sck_pin</span>  <span style="color: #000000">=</span> <span style="color: #000000">SPI_SCK_PIN</span>,
+    .<span style="color: #000000">miso_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">SPI_MISO_PIN</span>,
+    .<span style="color: #000000">mosi_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">SPI_MOSI_PIN</span>,
+    .<span style="color: #000000">irq_prio</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">2</span>
+};
+
+<span style="color: #A90D91">struct</span> <span style="color: #000000">at45db_dev</span> <span style="color: #000000">*my_at45db_dev</span> <span style="color: #000000">=</span> <span style="color: #A90D91">NULL</span>;
+
+<span style="color: #000000">my_at45db_dev</span> <span style="color: #000000">=</span> <span style="color: #000000">at45db_default_config</span>();
+<span style="color: #000000">my_at45db_dev-&gt;spi_num</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">0</span>;
+<span style="color: #000000">my_at45db_dev-&gt;spi_cfg</span> <span style="color: #000000">=</span> <span style="color: #000000">&amp;spi_cfg</span>;
+<span style="color: #000000">my_at45db_dev-&gt;ss_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">spi_cfg</span>.<span style="color: #000000">ss_pin</span>;
+
+<span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">at45db_init</span>((<span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*</span>) <span style="color: #000000">my_at45db_dev</span>);
+<span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span>) {
+    <span style="color: #177500">/* XXX: error handling */</span>
+}
+</pre></div>
+
+
+<p>The enable <code>nffs</code> to run on the <code>at45db</code>, the <code>flash_id</code> 0 needs to map to
+provide a mapping from 0 to this struct.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">hal_flash</span> <span style="color: #000000">*</span>
+<span style="color: #000000">hal_bsp_flash_dev</span>(<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">id</span>)
+{
+    <span style="color: #A90D91">if</span> (<span style="color: #000000">id</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) {
+        <span style="color: #A90D91">return</span> <span style="color: #A90D91">NULL</span>;
+    }
+    <span style="color: #A90D91">return</span> <span style="color: #000000">&amp;my_at45db_dev</span>;
+}
+</pre></div>
+                        
+                        <div class="row">
+                            
+
+
+
+<ul class="nav nav-pills" style="margin-bottom: 10px">
+    <li>
+    
+    <a href=../driver/>
+        <span class="fa fa-arrow-left"></span>
+        Previous: Drivers
+    </a>
+    
+    </li>
+    <li class="pull-right">
+    
+    <a href=../mmc/>
+        Next: mmc
+        <span class="fa fa-arrow-right"></span>
+    </a>
+    
+    </li>
+</ul>
+                        </div>
+                        <footer class="row">
+    <div class="col-xs-12">
+        
+            <p class="copyright">Apache Mynewt (incubating) is available under Apache License, version 2.0.</p>
+        
+    </div>
+    <div class="col-xs-12">
+        <div class="logos">
+            <img src="/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
+            <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>
+            <img src="/img/egg-logo2.png" alt="Apache Incubator" title="Apache Incubator">
+        </div>
+    </div>
+</footer>
+                    </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/86a27381/develop/os/modules/drivers/mmc/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/drivers/mmc/index.html b/develop/os/modules/drivers/mmc/index.html
new file mode 100644
index 0000000..b3d5fcf
--- /dev/null
+++ b/develop/os/modules/drivers/mmc/index.html
@@ -0,0 +1,761 @@
+<!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">
+        
+        
+        <!-- This is broken by doc revisioning.
+        <link rel="canonical" href="http://mynewt.apache.org/os/modules/drivers/mmc/"> -->
+        <link rel="shortcut icon" href="../../../../img/favicon.ico">
+
+	    <title>mmc - Apache Mynewt</title>
+
+        <link href="../../../../css/bootstrap-3.0.3.min.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="../../../../css/v2.css" rel="stylesheet">
+        <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
+        <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', 'auto');
+                ga('send', 'pageview');
+            </script>
+        
+    </head>
+
+
+    <body class="mmc">
+
+
+        <div class="container">
+    <div class="row v2-main-banner">
+        <a class="logo-cell" href="/">
+            <img class="logo" src="/img/logo.png">
+        </a>
+        <div class="tagline-cell">
+            <h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4>
+        </div>
+        <div class="news-cell">
+            <div class="well">
+                <h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.0.0-b2</a> released (Feb 15, 2017)
+            </div>
+        </div>
+    </div>
+</div>
+
+        
+
+
+
+
+
+
+<nav id="navbar" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="150" role="navigation">
+    <div class="container">
+        <!-- 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 
+  class=""
+>
+                    <a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a>
+                </li>
+                <li 
+  class="important"
+>
+                    <a href="/quick-start/">Quick Start</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/about/">About</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/talks/">Talks</a>
+                </li>
+                <li 
+  class="active"
+>
+                    <a href="/latest/os/introduction">Documentation</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/download/">Download</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/community/">Community</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/events/">Events</a>
+                </li>
+            </ul>
+
+            <!-- Search, Navigation and Repo links -->
+            <ul class="nav navbar-nav navbar-right">
+                
+            </ul>
+        </div>
+    </div>
+</nav>
+
+        
+
+        <div class="container">
+            
+                <div class="row">
+                    <div class="col-md-3 v2-sidebar sidebar-container"><div id="docSidebar" class="hidden-print" role="complementary">
+    <div class="top">
+        <div role="search">
+            <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
+                <div class="form-group">
+                    <input type="text" name="q" class="form-control" placeholder="Search documentation" />
+                </div>
+            </form>
+        </div>
+    </div>
+    <ul class="toc-nav">
+      <li class="doc-version">
+<select class="form-control" onchange="if (this.value) window.location.href=this.value">
+    
+    <option
+      value="/develop/os/introduction"
+      selected="selected"
+    >
+      Version: develop (latest)
+    </option>
+    
+    <option
+      value="/v0_9_0/os/introduction"
+      
+    >
+      Version: 0.9.0
+    </option>
+    
+</select>
+</li>
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+          
+  
+  
+    <li ><a href="../../../introduction/">Mynewt Documentation</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../get_started/get_started/">Basic Setup</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../get_started/vocabulary/">Concepts</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../tutorials/tutorials/">Tutorials</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../os_user_guide/">OS User Guide</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/mynewt_os/">OS Core</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/porting/port_os/">Porting to your Platform</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../console/console/">Console</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../shell/shell/">Shell</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../split/split/">Split Images</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../bootloader/bootloader/">Bootloader</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  
+  
+  ../../fs/fs/fs/
+
+">File System</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../hal/hal/">Hardware Abstraction Layer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../driver/">Drivers</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ../flash/
+">Supported Drivers</a>
+  
+  
+    <ul>
+          
+              
+                
+    <li >
+      <a href="../flash/">flash</a>
+    </li>
+
+              
+          
+              
+                
+    <li class="active">
+      <a href="./">mmc</a>
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../../network/ble/ble_intro/">nimBLE</a>
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../testutil/testutil/">Test Utilities</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../devmgmt/newtmgr/">Device Management with Newt Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../imgmgr/imgmgr/">Image Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../baselibc/">Baselibc library</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../elua/elua/">Embedded Lua</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../json/json/">JSON</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../fcb/fcb/">Flash Circular Buffer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../stats/stats/">Stats</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../logs/logs/">Logs</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../sysinitconfig/sysinitconfig/">System Configuration And Initialization</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ../../../../network/ble/ble_intro/
+">BLE User Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newt/newt_intro/">Newt Tool Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newtmgr/overview/">Newt Manager Guide</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+        
+      
+        
+          
+  
+  
+    <li><a href="
+  ../../../../faq/how_to_edit_docs/
+">Appendix</a>
+  
+  
+    </li>
+
+        
+      
+    </ul>
+</div></div>
+
+                    <div class="col-md-9" role="main">
+                        <div class="doc-header">
+                            <div role="navigation" aria-label="breadcrumbs navigation">
+  <ul class="wy-breadcrumbs pull-right">
+    <li><a href="/develop/os/introduction">Docs</a></li>
+    
+    
+        
+          <li>&raquo; <a href="../driver/">Drivers</a></li>
+        
+      
+        
+          <li>&raquo; <a href="../flash/">Supported Drivers</a></li>
+        
+      
+      
+        <li>&raquo; mmc</li>
+      
+    
+    
+  </ul>
+</div>
+                        </div>
+                        
+                            <h2 id="mmc"><font color="#F2853F" style="font-size:24pt">mmc</font></h2>
+<p>The MMC driver provides support for SPI based MMC/SDcard interfaces. It exports
+a <code>disk_ops</code> struct that can be used by any FS. Currently only <code>fatfs</code> can run
+over MMC.</p>
+<h4 id="initialization">Initialization</h4>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">mmc_init</span>(<span style="color: #A90D91">int</span> <span style="color: #000000">spi_num</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*spi_cfg</span>, <span style="color: #A90D91">int</span> <span style="color: #000000">ss_pin</span>)
+</pre></div>
+
+
+<p>Initializes the mmc driver to be used by a FS.</p>
+<p>MMC uses the <code>hal_gpio</code> interface to access the SPI <code>ss_pin</code> and the <code>hal_spi</code>
+interface for the communication with the card. <code>spi_cfg</code> must be a hw dependent
+structure used by <code>hal_spi_init</code> to initialize the SPI subsystem.</p>
+<h4 id="dependencies">Dependencies</h4>
+<p>To include the <code>mmc</code> driver on a project, just include it as a dependency in your
+pkg.yml:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">pkg.deps:
+    - hw/drivers/mmc
+</pre></div>
+
+
+<h4 id="returned-values">Returned values</h4>
+<p>MMC functions return one of the following status codes:</p>
+<table>
+<thead>
+<tr>
+<th>Return code</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>MMC_OK</td>
+<td>Success.</td>
+</tr>
+<tr>
+<td>MMC_CARD_ERROR</td>
+<td>General failure on the card.</td>
+</tr>
+<tr>
+<td>MMC_READ_ERROR</td>
+<td>Error reading from the card.</td>
+</tr>
+<tr>
+<td>MMC_WRITE_ERROR</td>
+<td>Error writing to the card.</td>
+</tr>
+<tr>
+<td>MMC_TIMEOUT</td>
+<td>Timed out waiting for the execution of a command.</td>
+</tr>
+<tr>
+<td>MMC_PARAM_ERROR</td>
+<td>An invalid parameter was given to a function.</td>
+</tr>
+<tr>
+<td>MMC_CRC_ERROR</td>
+<td>CRC error reading card.</td>
+</tr>
+<tr>
+<td>MMC_DEVICE_ERROR</td>
+<td>Tried to use an invalid device.</td>
+</tr>
+<tr>
+<td>MMC_RESPONSE_ERROR</td>
+<td>A command received an invalid response.</td>
+</tr>
+<tr>
+<td>MMC_VOLTAGE_ERROR</td>
+<td>The interface doesn't support the requested voltage.</td>
+</tr>
+<tr>
+<td>MMC_INVALID_COMMAND</td>
+<td>The interface haven't accepted some command.</td>
+</tr>
+<tr>
+<td>MMC_ERASE_ERROR</td>
+<td>Error erasing the current card.</td>
+</tr>
+<tr>
+<td>MMC_ADDR_ERROR</td>
+<td>Tried to access an invalid address.</td>
+</tr>
+</tbody>
+</table>
+<h4 id="header-file">Header file</h4>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include &quot;mmc/mmc.h&quot;</span>
+</pre></div>
+
+
+<h4 id="example"><a name="Example"></a>Example</h4>
+<p>This example runs on the STM32F4-Discovery and prints out a listing of
+the root directory on the currently installed card.</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #177500">// NOTE: error handling removed for clarity!</span>
+
+<span style="color: #A90D91">struct</span> <span style="color: #000000">stm32f4_hal_spi_cfg</span> <span style="color: #000000">spi_cfg</span> <span style="color: #000000">=</span> {
+    .<span style="color: #000000">ss_pin</span>   <span style="color: #000000">=</span> <span style="color: #000000">SPI_SS_PIN</span>,
+    .<span style="color: #000000">sck_pin</span>  <span style="color: #000000">=</span> <span style="color: #000000">SPI_SCK_PIN</span>,
+    .<span style="color: #000000">miso_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">SPI_MISO_PIN</span>,
+    .<span style="color: #000000">mosi_pin</span> <span style="color: #000000">=</span> <span style="color: #000000">SPI_MOSI_PIN</span>,
+    .<span style="color: #000000">irq_prio</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">2</span>
+};
+
+<span style="color: #000000">mmc_init</span>(<span style="color: #1C01CE">0</span>, <span style="color: #000000">&amp;spi_cfg</span>, <span style="color: #000000">spi_cfg</span>.<span style="color: #000000">ss_pin</span>);
+<span style="color: #000000">disk_register</span>(<span style="color: #C41A16">&quot;mmc0&quot;</span>, <span style="color: #C41A16">&quot;fatfs&quot;</span>, <span style="color: #000000">&amp;mmc_ops</span>);
+
+<span style="color: #000000">fs_opendir</span>(<span style="color: #C41A16">&quot;mmc0:/&quot;</span>, <span style="color: #000000">&amp;dir</span>);
+
+<span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) {
+    <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_readdir</span>(<span style="color: #000000">dir</span>, <span style="color: #000000">&amp;dirent</span>);
+    <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #000000">FS_ENOENT</span>) {
+        <span style="color: #A90D91">break</span>;
+    }
+
+    <span style="color: #000000">fs_dirent_name</span>(<span style="color: #000000">dirent</span>, <span style="color: #A90D91">sizeof</span>(<span style="color: #000000">out_name</span>), <span style="color: #000000">out_name</span>, <span style="color: #000000">&amp;u8_len</span>);
+    <span style="color: #000000">printf</span>(<span style="color: #C41A16">&quot;%s\n&quot;</span>, <span style="color: #000000">out_name</span>);
+}
+
+<span style="color: #000000">fs_closedir</span>(<span style="color: #000000">dir</span>);
+</pre></div>
+                        
+                        <div class="row">
+                            
+
+
+
+<ul class="nav nav-pills" style="margin-bottom: 10px">
+    <li>
+    
+    <a href=../flash/>
+        <span class="fa fa-arrow-left"></span>
+        Previous: flash
+    </a>
+    
+    </li>
+    <li class="pull-right">
+    
+    <a href=../../../../network/ble/ble_intro/>
+        Next: nimBLE
+        <span class="fa fa-arrow-right"></span>
+    </a>
+    
+    </li>
+</ul>
+                        </div>
+                        <footer class="row">
+    <div class="col-xs-12">
+        
+            <p class="copyright">Apache Mynewt (incubating) is available under Apache License, version 2.0.</p>
+        
+    </div>
+    <div class="col-xs-12">
+        <div class="logos">
+            <img src="/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
+            <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>
+            <img src="/img/egg-logo2.png" alt="Apache Incubator" title="Apache Incubator">
+        </div>
+    </div>
+</footer>
+                    </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/86a27381/develop/os/modules/fs/fatfs/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fatfs/index.html b/develop/os/modules/fs/fatfs/index.html
new file mode 100644
index 0000000..b32c4f2
--- /dev/null
+++ b/develop/os/modules/fs/fatfs/index.html
@@ -0,0 +1,673 @@
+<!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">
+        
+        
+        <!-- This is broken by doc revisioning.
+        <link rel="canonical" href="http://mynewt.apache.org/os/modules/fs/fatfs/"> -->
+        <link rel="shortcut icon" href="../../../../img/favicon.ico">
+
+	    <title>FAT File System - Apache Mynewt</title>
+
+        <link href="../../../../css/bootstrap-3.0.3.min.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="../../../../css/v2.css" rel="stylesheet">
+        <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
+        <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', 'auto');
+                ga('send', 'pageview');
+            </script>
+        
+    </head>
+
+
+    <body class="FAT File System">
+
+
+        <div class="container">
+    <div class="row v2-main-banner">
+        <a class="logo-cell" href="/">
+            <img class="logo" src="/img/logo.png">
+        </a>
+        <div class="tagline-cell">
+            <h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4>
+        </div>
+        <div class="news-cell">
+            <div class="well">
+                <h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.0.0-b2</a> released (Feb 15, 2017)
+            </div>
+        </div>
+    </div>
+</div>
+
+        
+
+
+
+
+
+
+<nav id="navbar" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="150" role="navigation">
+    <div class="container">
+        <!-- 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 
+  class=""
+>
+                    <a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a>
+                </li>
+                <li 
+  class="important"
+>
+                    <a href="/quick-start/">Quick Start</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/about/">About</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/talks/">Talks</a>
+                </li>
+                <li 
+  class="active"
+>
+                    <a href="/latest/os/introduction">Documentation</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/download/">Download</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/community/">Community</a>
+                </li>
+                <li 
+  class=""
+>
+                    <a href="/events/">Events</a>
+                </li>
+            </ul>
+
+            <!-- Search, Navigation and Repo links -->
+            <ul class="nav navbar-nav navbar-right">
+                
+            </ul>
+        </div>
+    </div>
+</nav>
+
+        
+
+        <div class="container">
+            
+                <div class="row">
+                    <div class="col-md-3 v2-sidebar sidebar-container"><div id="docSidebar" class="hidden-print" role="complementary">
+    <div class="top">
+        <div role="search">
+            <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
+                <div class="form-group">
+                    <input type="text" name="q" class="form-control" placeholder="Search documentation" />
+                </div>
+            </form>
+        </div>
+    </div>
+    <ul class="toc-nav">
+      <li class="doc-version">
+<select class="form-control" onchange="if (this.value) window.location.href=this.value">
+    
+    <option
+      value="/develop/os/introduction"
+      selected="selected"
+    >
+      Version: develop (latest)
+    </option>
+    
+    <option
+      value="/v0_9_0/os/introduction"
+      
+    >
+      Version: 0.9.0
+    </option>
+    
+</select>
+</li>
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+      
+        
+          
+  
+  
+    <li ><a href="../../../introduction/">Mynewt Documentation</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../get_started/get_started/">Basic Setup</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../../get_started/vocabulary/">Concepts</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../tutorials/tutorials/">Tutorials</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../os_user_guide/">OS User Guide</a>
+  
+  
+    <ul>
+          
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/mynewt_os/">OS Core</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../core_os/porting/port_os/">Porting to your Platform</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../console/console/">Console</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../shell/shell/">Shell</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../split/split/">Split Images</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../bootloader/bootloader/">Bootloader</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  
+  
+  ../fs/fs/
+
+">File System</a>
+  
+  
+    <ul>
+          
+              
+                
+  
+  
+    <li ><a href="../fs/fs/">File System Abstraction</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li class="active">
+      <a href="./">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../nffs/nffs/">Newtron Flash File System</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../otherfs/">Other File Systems</a>
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../hal/hal/">Hardware Abstraction Layer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../drivers/driver/">Drivers</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../testutil/testutil/">Test Utilities</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../devmgmt/newtmgr/">Device Management with Newt Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../imgmgr/imgmgr/">Image Manager</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+    <li >
+      <a href="../../baselibc/">Baselibc library</a>
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../elua/elua/">Embedded Lua</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../json/json/">JSON</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../fcb/fcb/">Flash Circular Buffer</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../stats/stats/">Stats</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../logs/logs/">Logs</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../sysinitconfig/sysinitconfig/">System Configuration And Initialization</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li><a href="
+  ../../../../network/ble/ble_intro/
+">BLE User Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newt/newt_intro/">Newt Tool Guide</a>
+  
+  
+    </li>
+
+              
+          
+              
+                
+  
+  
+    <li ><a href="../../../../newtmgr/overview/">Newt Manager Guide</a>
+  
+  
+    </li>
+
+              
+          
+    </ul>
+  
+    </li>
+
+        
+      
+        
+          
+  
+  
+    <li><a href="
+  ../../../../faq/how_to_edit_docs/
+">Appendix</a>
+  
+  
+    </li>
+
+        
+      
+    </ul>
+</div></div>
+
+                    <div class="col-md-9" role="main">
+                        <div class="doc-header">
+                            <div role="navigation" aria-label="breadcrumbs navigation">
+  <ul class="wy-breadcrumbs pull-right">
+    <li><a href="/develop/os/introduction">Docs</a></li>
+    
+    
+        
+          <li>&raquo; <a href="../../../os_user_guide/">OS User Guide</a></li>
+        
+      
+        
+          <li>&raquo; File System</li>
+        
+      
+      
+        <li>&raquo; FAT File System</li>
+      
+    
+    
+  </ul>
+</div>
+                        </div>
+                        
+                            <h1 id="the-fat-file-system">The FAT File System</h1>
+<p>Mynewt provides an implementation of the FAT filesystem which is currently
+supported on MMC/SD cards.</p>
+<h3 id="description">Description</h3>
+<blockquote>
+<p>File Allocation Table (FAT) is a computer file system architecture and a family
+of industry-standard file systems utilizing it. The FAT file system is a legacy
+file system which is simple and robust. It offers good performance even in
+lightweight implementations, but cannot deliver the same performance, reliability
+and scalability as some modern file systems.</p>
+</blockquote>
+<h3 id="configuration">Configuration</h3>
+<p><code>fatfs</code> configuration can be tweaked by editing <code>fs/fatfs/include/fatfs/ffconf.h</code>.
+The current configuraton was chosen to minimize memory use and some options address
+limitations existing in the OS:</p>
+<ul>
+<li>Write support is enabled by default (can be disabled to minimize memory use).</li>
+<li>Long filename (up to 255) support is disabled.</li>
+<li>When writing files, time/dates are not persisted due to current lack of a
+  standard <code>hal_rtc</code> interface.</li>
+<li>No unicode support. Vanilla config uses standard US codepage 437.</li>
+<li>Formatting of new volumes is disabled.</li>
+<li>Default number of volumes is configured to 1.</li>
+</ul>
+<h3 id="api">API</h3>
+<p>To include <code>fatfs</code> on a project just include it as a dependency in your
+project:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">pkg.deps:
+    - fs/fatfs
+</pre></div>
+
+
+<p>It can now be used through the standard file system abstraction functions as
+described in <a href="../../../../os/modules/fs/fs/fs#API">FS API</a>.</p>
+<h4 id="example">Example</h4>
+<p>An example of using <code>fatfs</code> on a MMC card is provided on the
+<a href="../../../../os/modules/drivers/mmc#Example">MMC</a> documentation.</p>
+                        
+                        <div class="row">
+                            
+
+
+
+<ul class="nav nav-pills" style="margin-bottom: 10px">
+    <li>
+    
+    <a href=../fs/fsutil_write_file/>
+        <span class="fa fa-arrow-left"></span>
+        Previous: fsutil_write_file
+    </a>
+    
+    </li>
+    <li class="pull-right">
+    
+    <a href=../nffs/nffs/>
+        Next: Newtron Flash File System
+        <span class="fa fa-arrow-right"></span>
+    </a>
+    
+    </li>
+</ul>
+                        </div>
+                        <footer class="row">
+    <div class="col-xs-12">
+        
+            <p class="copyright">Apache Mynewt (incubating) is available under Apache License, version 2.0.</p>
+        
+    </div>
+    <div class="col-xs-12">
+        <div class="logos">
+            <img src="/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
+            <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>
+            <img src="/img/egg-logo2.png" alt="Apache Incubator" title="Apache Incubator">
+        </div>
+    </div>
+</footer>
+                    </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/86a27381/develop/os/modules/fs/fs/fs/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs/index.html b/develop/os/modules/fs/fs/fs/index.html
index 678544f..bc3ca2b 100644
--- a/develop/os/modules/fs/fs/fs/index.html
+++ b/develop/os/modules/fs/fs/fs/index.html
@@ -372,6 +372,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>
@@ -651,6 +659,40 @@ pkg.deps:
 
 
 <p>The <code>libs/imgmgr</code> package uses the <code>fs/fs</code> API for all file system operations.</p>
+<h3 id="support-for-multiple-filesystems">Support for multiple filesystems</h3>
+<p>When using a single filesystem/disk, it is valid to provide paths in the standard
+unix way, eg, <code>/&lt;dir-name&gt;/&lt;file-name&gt;</code>. When trying to run more than one filesystem
+or a single filesystem in multiple devices simultaneosly, an extra name has to be
+given to the disk that is being used. The abstraction for that was added as the
+<code>fs/disk</code> package which is a dependency of <code>fs/fs</code>. It adds the following extra
+user function:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">disk_register</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*disk_name</span>, <span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*fs_name</span>, <span style="color: #A90D91">struct</span> <span style="color: #000000">disk_ops</span> <span style="color: #000000">*dops</span>)
+</pre></div>
+
+
+<p>As an example os usage:</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #000000">disk_register</span>(<span style="color: #C41A16">&quot;mmc0&quot;</span>, <span style="color: #C41A16">&quot;fatfs&quot;</span>, <span style="color: #000000">&amp;mmc_ops</span>);
+<span style="color: #000000">disk_register</span>(<span style="color: #C41A16">&quot;flash0&quot;</span>, <span style="color: #C41A16">&quot;nffs&quot;</span>, <span style="color: #A90D91">NULL</span>);
+</pre></div>
+
+
+<p>This registers the name <code>mmc0</code> to use <code>fatfs</code> as the filesystem and <code>mmc_ops</code> for
+the low-level disk driver and also registers <code>flash0</code> to use <code>nffs</code>. <code>nffs</code> is
+currently strongly bound to the <code>hal_flash</code> interface, ignoring any other possible
+<code>disk_ops</code> given.</p>
+<h4 id="struct-disk_ops">struct disk_ops</h4>
+<p>To support a new low-level disk interface, the <code>struct disk_ops</code> interface must
+be implemented by the low-level driver. Currently only <code>read</code> and <code>write</code> are
+effectively used (by <code>fatfs</code>).</p>
+<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">struct</span> <span style="color: #000000">disk_ops</span> {
+    <span style="color: #A90D91">int</span> (<span style="color: #000000">*read</span>)(<span style="color: #A90D91">uint8_t</span>, <span style="color: #A90D91">uint32_t</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*</span>, <span style="color: #A90D91">uint32_t</span>);
+    <span style="color: #A90D91">int</span> (<span style="color: #000000">*write</span>)(<span style="color: #A90D91">uint8_t</span>, <span style="color: #A90D91">uint32_t</span>, <span style="color: #A90D91">const</span> <span style="color: #A90D91">void</span> <span style="color: #000000">*</span>, <span style="color: #A90D91">uint32_t</span>);
+    <span style="color: #A90D91">int</span> (<span style="color: #000000">*ioctl</span>)(<span style="color: #A90D91">uint8_t</span>, <span style="color: #A90D91">uint32_t</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*</span>);
+    <span style="color: #000000">SLIST_ENTRY</span>(<span style="color: #000000">disk_ops</span>) <span style="color: #000000">sc_next</span>;
+}
+</pre></div>
+
+
 <h3 id="thread-safety">Thread Safety</h3>
 <p>All <code>fs/fs</code> functions are thread safe.</p>
 <h3 id="header-files">Header Files</h3>
@@ -667,7 +709,7 @@ pkg.deps:
 </pre></div>
 
 
-<h3 id="api">API</h3>
+<h3 id="api"><a name="API"></a>API</h3>
 <p>Functions in <code>fs/fs</code> that indicate success or failure do so with the following set of return codes:</p>
 <ul>
 <li><a href="../fs_return_codes/">Return Codes</a></li>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_close/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_close/index.html b/develop/os/modules/fs/fs/fs_close/index.html
index fd21454..a1fc0ed 100644
--- a/develop/os/modules/fs/fs/fs_close/index.html
+++ b/develop/os/modules/fs/fs/fs_close/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_closedir/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_closedir/index.html b/develop/os/modules/fs/fs/fs_closedir/index.html
index 648d2a8..3a11077 100644
--- a/develop/os/modules/fs/fs/fs_closedir/index.html
+++ b/develop/os/modules/fs/fs/fs_closedir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_dirent_is_dir/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_dirent_is_dir/index.html b/develop/os/modules/fs/fs/fs_dirent_is_dir/index.html
index 140c738..7efa6ee 100644
--- a/develop/os/modules/fs/fs/fs_dirent_is_dir/index.html
+++ b/develop/os/modules/fs/fs/fs_dirent_is_dir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_dirent_name/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_dirent_name/index.html b/develop/os/modules/fs/fs/fs_dirent_name/index.html
index 3b3419a..c51b350 100644
--- a/develop/os/modules/fs/fs/fs_dirent_name/index.html
+++ b/develop/os/modules/fs/fs/fs_dirent_name/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_filelen/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_filelen/index.html b/develop/os/modules/fs/fs/fs_filelen/index.html
index 2fe8112..1bc09c5 100644
--- a/develop/os/modules/fs/fs/fs_filelen/index.html
+++ b/develop/os/modules/fs/fs/fs_filelen/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_getpos/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_getpos/index.html b/develop/os/modules/fs/fs/fs_getpos/index.html
index adc89cb..70d8858 100644
--- a/develop/os/modules/fs/fs/fs_getpos/index.html
+++ b/develop/os/modules/fs/fs/fs_getpos/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_mkdir/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_mkdir/index.html b/develop/os/modules/fs/fs/fs_mkdir/index.html
index d670d22..9f9e57c 100644
--- a/develop/os/modules/fs/fs/fs_mkdir/index.html
+++ b/develop/os/modules/fs/fs/fs_mkdir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_open/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_open/index.html b/develop/os/modules/fs/fs/fs_open/index.html
index dd5f5ba..e56886c 100644
--- a/develop/os/modules/fs/fs/fs_open/index.html
+++ b/develop/os/modules/fs/fs/fs_open/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_opendir/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_opendir/index.html b/develop/os/modules/fs/fs/fs_opendir/index.html
index 1cdbe50..48c3d92 100644
--- a/develop/os/modules/fs/fs/fs_opendir/index.html
+++ b/develop/os/modules/fs/fs/fs_opendir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_ops/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_ops/index.html b/develop/os/modules/fs/fs/fs_ops/index.html
index cb51c0d..78dd942 100644
--- a/develop/os/modules/fs/fs/fs_ops/index.html
+++ b/develop/os/modules/fs/fs/fs_ops/index.html
@@ -384,6 +384,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_read/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_read/index.html b/develop/os/modules/fs/fs/fs_read/index.html
index d265289..77e6702 100644
--- a/develop/os/modules/fs/fs/fs_read/index.html
+++ b/develop/os/modules/fs/fs/fs_read/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_readdir/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_readdir/index.html b/develop/os/modules/fs/fs/fs_readdir/index.html
index 152840b..6738a1a 100644
--- a/develop/os/modules/fs/fs/fs_readdir/index.html
+++ b/develop/os/modules/fs/fs/fs_readdir/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_register/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_register/index.html b/develop/os/modules/fs/fs/fs_register/index.html
index 365cc23..50a9d4a 100644
--- a/develop/os/modules/fs/fs/fs_register/index.html
+++ b/develop/os/modules/fs/fs/fs_register/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_rename/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_rename/index.html b/develop/os/modules/fs/fs/fs_rename/index.html
index 17b11c0..8134320 100644
--- a/develop/os/modules/fs/fs/fs_rename/index.html
+++ b/develop/os/modules/fs/fs/fs_rename/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_return_codes/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_return_codes/index.html b/develop/os/modules/fs/fs/fs_return_codes/index.html
index 21c1839..0bb7bb9 100644
--- a/develop/os/modules/fs/fs/fs_return_codes/index.html
+++ b/develop/os/modules/fs/fs/fs_return_codes/index.html
@@ -372,6 +372,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_seek/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_seek/index.html b/develop/os/modules/fs/fs/fs_seek/index.html
index bf2e989..ca7f802 100644
--- a/develop/os/modules/fs/fs/fs_seek/index.html
+++ b/develop/os/modules/fs/fs/fs_seek/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_unlink/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_unlink/index.html b/develop/os/modules/fs/fs/fs_unlink/index.html
index 30807c4..de330dc 100644
--- a/develop/os/modules/fs/fs/fs_unlink/index.html
+++ b/develop/os/modules/fs/fs/fs_unlink/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fs_write/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fs_write/index.html b/develop/os/modules/fs/fs/fs_write/index.html
index 1ced861..16c81eb 100644
--- a/develop/os/modules/fs/fs/fs_write/index.html
+++ b/develop/os/modules/fs/fs/fs_write/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fsutil_read_file/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fsutil_read_file/index.html b/develop/os/modules/fs/fs/fsutil_read_file/index.html
index 91b28ab..170e40e 100644
--- a/develop/os/modules/fs/fs/fsutil_read_file/index.html
+++ b/develop/os/modules/fs/fs/fsutil_read_file/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/fs/fsutil_write_file/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/fs/fsutil_write_file/index.html b/develop/os/modules/fs/fs/fsutil_write_file/index.html
index 3b562f0..305d5a3 100644
--- a/develop/os/modules/fs/fs/fsutil_write_file/index.html
+++ b/develop/os/modules/fs/fs/fsutil_write_file/index.html
@@ -520,6 +520,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../../nffs/nffs/">Newtron Flash File System</a>
@@ -837,8 +845,8 @@
     </li>
     <li class="pull-right">
     
-    <a href=../../nffs/nffs/>
-        Next: Newtron Flash File System
+    <a href=../../fatfs/>
+        Next: FAT File System
         <span class="fa fa-arrow-right"></span>
     </a>
     

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/nffs/nffs/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/nffs/nffs/index.html b/develop/os/modules/fs/nffs/nffs/index.html
index 9e9cb59..9ef1cfa 100644
--- a/develop/os/modules/fs/nffs/nffs/index.html
+++ b/develop/os/modules/fs/nffs/nffs/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li class="active"><a href="./">Newtron Flash File System</a>
@@ -720,9 +728,9 @@
 <ul class="nav nav-pills" style="margin-bottom: 10px">
     <li>
     
-    <a href=../../fs/fsutil_write_file/>
+    <a href=../../fatfs/>
         <span class="fa fa-arrow-left"></span>
-        Previous: fsutil_write_file
+        Previous: FAT File System
     </a>
     
     </li>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/nffs/nffs_area_desc/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/nffs/nffs_area_desc/index.html b/develop/os/modules/fs/nffs/nffs_area_desc/index.html
index 494e01a..b60744a 100644
--- a/develop/os/modules/fs/nffs/nffs_area_desc/index.html
+++ b/develop/os/modules/fs/nffs/nffs_area_desc/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/nffs/nffs_config/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/nffs/nffs_config/index.html b/develop/os/modules/fs/nffs/nffs_config/index.html
index 12a280b..d3e6fa9 100644
--- a/develop/os/modules/fs/nffs/nffs_config/index.html
+++ b/develop/os/modules/fs/nffs/nffs_config/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/nffs/nffs_detect/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/nffs/nffs_detect/index.html b/develop/os/modules/fs/nffs/nffs_detect/index.html
index f33b4f4..bb6a846 100644
--- a/develop/os/modules/fs/nffs/nffs_detect/index.html
+++ b/develop/os/modules/fs/nffs/nffs_detect/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/nffs/nffs_format/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/nffs/nffs_format/index.html b/develop/os/modules/fs/nffs/nffs_format/index.html
index c86fce4..e529859 100644
--- a/develop/os/modules/fs/nffs/nffs_format/index.html
+++ b/develop/os/modules/fs/nffs/nffs_format/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/nffs/nffs_init/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/nffs/nffs_init/index.html b/develop/os/modules/fs/nffs/nffs_init/index.html
index 856135e..51511d2 100644
--- a/develop/os/modules/fs/nffs/nffs_init/index.html
+++ b/develop/os/modules/fs/nffs/nffs_init/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/86a27381/develop/os/modules/fs/nffs/nffs_internals/index.html
----------------------------------------------------------------------
diff --git a/develop/os/modules/fs/nffs/nffs_internals/index.html b/develop/os/modules/fs/nffs/nffs_internals/index.html
index e8f6b67..6c6a966 100644
--- a/develop/os/modules/fs/nffs/nffs_internals/index.html
+++ b/develop/os/modules/fs/nffs/nffs_internals/index.html
@@ -332,6 +332,14 @@
           
               
                 
+    <li >
+      <a href="../../fatfs/">FAT File System</a>
+    </li>
+
+              
+          
+              
+                
   
   
     <li ><a href="../nffs/">Newtron Flash File System</a>



[7/7] incubator-mynewt-site git commit: PRs #160, #161, minor edits to various docs

Posted by ad...@apache.org.
PRs #160, #161, minor edits to various docs


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/86a27381
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/86a27381
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/86a27381

Branch: refs/heads/asf-site
Commit: 86a27381696dfc82baeee58cf0f3dd947b5fc891
Parents: 36d4761
Author: aditihilbert <ad...@runtime.io>
Authored: Tue Mar 7 11:27:47 2017 +0100
Committer: aditihilbert <ad...@runtime.io>
Committed: Tue Mar 7 11:27:47 2017 +0100

----------------------------------------------------------------------
 develop/mkdocs/search_index.json                | 151 +++-
 .../os/modules/bootloader/bootloader/index.html |   8 -
 develop/os/modules/drivers/driver/index.html    |  57 +-
 develop/os/modules/drivers/flash/index.html     | 744 ++++++++++++++++++
 develop/os/modules/drivers/mmc/index.html       | 761 +++++++++++++++++++
 develop/os/modules/fs/fatfs/index.html          | 673 ++++++++++++++++
 develop/os/modules/fs/fs/fs/index.html          |  44 +-
 develop/os/modules/fs/fs/fs_close/index.html    |   8 +
 develop/os/modules/fs/fs/fs_closedir/index.html |   8 +
 .../modules/fs/fs/fs_dirent_is_dir/index.html   |   8 +
 .../os/modules/fs/fs/fs_dirent_name/index.html  |   8 +
 develop/os/modules/fs/fs/fs_filelen/index.html  |   8 +
 develop/os/modules/fs/fs/fs_getpos/index.html   |   8 +
 develop/os/modules/fs/fs/fs_mkdir/index.html    |   8 +
 develop/os/modules/fs/fs/fs_open/index.html     |   8 +
 develop/os/modules/fs/fs/fs_opendir/index.html  |   8 +
 develop/os/modules/fs/fs/fs_ops/index.html      |   8 +
 develop/os/modules/fs/fs/fs_read/index.html     |   8 +
 develop/os/modules/fs/fs/fs_readdir/index.html  |   8 +
 develop/os/modules/fs/fs/fs_register/index.html |   8 +
 develop/os/modules/fs/fs/fs_rename/index.html   |   8 +
 .../os/modules/fs/fs/fs_return_codes/index.html |   8 +
 develop/os/modules/fs/fs/fs_seek/index.html     |   8 +
 develop/os/modules/fs/fs/fs_unlink/index.html   |   8 +
 develop/os/modules/fs/fs/fs_write/index.html    |   8 +
 .../modules/fs/fs/fsutil_read_file/index.html   |   8 +
 .../modules/fs/fs/fsutil_write_file/index.html  |  12 +-
 develop/os/modules/fs/nffs/nffs/index.html      |  12 +-
 .../modules/fs/nffs/nffs_area_desc/index.html   |   8 +
 .../os/modules/fs/nffs/nffs_config/index.html   |   8 +
 .../os/modules/fs/nffs/nffs_detect/index.html   |   8 +
 .../os/modules/fs/nffs/nffs_format/index.html   |   8 +
 develop/os/modules/fs/nffs/nffs_init/index.html |   8 +
 .../modules/fs/nffs/nffs_internals/index.html   |   8 +
 develop/os/modules/fs/otherfs/index.html        |   8 +
 .../os/modules/hal/hal_gpio/hal_gpio/index.html |   2 +-
 develop/os/modules/shell/shell/index.html       |  20 +-
 develop/os/modules/testutil/testutil/index.html |   4 +-
 .../tutorials/project-target-slinky/index.html  |   2 +-
 develop/sitemap.xml                             |  24 +-
 latest/mkdocs/search_index.json                 | 151 +++-
 .../os/modules/bootloader/bootloader/index.html |   8 -
 latest/os/modules/drivers/driver/index.html     |  57 +-
 latest/os/modules/drivers/flash/index.html      | 744 ++++++++++++++++++
 latest/os/modules/drivers/mmc/index.html        | 761 +++++++++++++++++++
 latest/os/modules/fs/fatfs/index.html           | 673 ++++++++++++++++
 latest/os/modules/fs/fs/fs/index.html           |  44 +-
 latest/os/modules/fs/fs/fs_close/index.html     |   8 +
 latest/os/modules/fs/fs/fs_closedir/index.html  |   8 +
 .../modules/fs/fs/fs_dirent_is_dir/index.html   |   8 +
 .../os/modules/fs/fs/fs_dirent_name/index.html  |   8 +
 latest/os/modules/fs/fs/fs_filelen/index.html   |   8 +
 latest/os/modules/fs/fs/fs_getpos/index.html    |   8 +
 latest/os/modules/fs/fs/fs_mkdir/index.html     |   8 +
 latest/os/modules/fs/fs/fs_open/index.html      |   8 +
 latest/os/modules/fs/fs/fs_opendir/index.html   |   8 +
 latest/os/modules/fs/fs/fs_ops/index.html       |   8 +
 latest/os/modules/fs/fs/fs_read/index.html      |   8 +
 latest/os/modules/fs/fs/fs_readdir/index.html   |   8 +
 latest/os/modules/fs/fs/fs_register/index.html  |   8 +
 latest/os/modules/fs/fs/fs_rename/index.html    |   8 +
 .../os/modules/fs/fs/fs_return_codes/index.html |   8 +
 latest/os/modules/fs/fs/fs_seek/index.html      |   8 +
 latest/os/modules/fs/fs/fs_unlink/index.html    |   8 +
 latest/os/modules/fs/fs/fs_write/index.html     |   8 +
 .../modules/fs/fs/fsutil_read_file/index.html   |   8 +
 .../modules/fs/fs/fsutil_write_file/index.html  |  12 +-
 latest/os/modules/fs/nffs/nffs/index.html       |  12 +-
 .../modules/fs/nffs/nffs_area_desc/index.html   |   8 +
 .../os/modules/fs/nffs/nffs_config/index.html   |   8 +
 .../os/modules/fs/nffs/nffs_detect/index.html   |   8 +
 .../os/modules/fs/nffs/nffs_format/index.html   |   8 +
 latest/os/modules/fs/nffs/nffs_init/index.html  |   8 +
 .../modules/fs/nffs/nffs_internals/index.html   |   8 +
 latest/os/modules/fs/otherfs/index.html         |   8 +
 .../os/modules/hal/hal_gpio/hal_gpio/index.html |   2 +-
 latest/os/modules/shell/shell/index.html        |  20 +-
 latest/os/modules/testutil/testutil/index.html  |   4 +-
 .../tutorials/project-target-slinky/index.html  |   2 +-
 latest/sitemap.xml                              |  24 +-
 sitemap.xml                                     |  26 +-
 v0_9_0/sitemap.xml                              |  26 +-
 82 files changed, 5362 insertions(+), 134 deletions(-)
----------------------------------------------------------------------