You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by pa...@apache.org on 2016/08/26 16:36:36 UTC

incubator-mynewt-core git commit: add documentation for split app packages

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop f83ed14c3 -> f2d1ba1e0


add documentation for split app packages


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

Branch: refs/heads/develop
Commit: f2d1ba1e0c6a2521447a4c06cab0e3dc9bdb0f8f
Parents: f83ed14
Author: Paul Dietrich <pa...@yahoo.com>
Authored: Fri Aug 26 09:35:53 2016 -0700
Committer: Paul Dietrich <pa...@yahoo.com>
Committed: Fri Aug 26 09:36:11 2016 -0700

----------------------------------------------------------------------
 apps/splitty/README.md           | 34 +++++++++++++++++++
 libs/split/README.md             | 63 +++++++++++++++++++++++++++++++++++
 libs/split/include/split/split.h | 14 +++++++-
 3 files changed, 110 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f2d1ba1e/apps/splitty/README.md
----------------------------------------------------------------------
diff --git a/apps/splitty/README.md b/apps/splitty/README.md
new file mode 100644
index 0000000..dc53092
--- /dev/null
+++ b/apps/splitty/README.md
@@ -0,0 +1,34 @@
+
+<img src="http://mynewt.apache.org/img/logo.svg" width="250" alt="Apache Mynewt">
+
+## Overview
+
+`apps/splitty` is an example split application.  It can be paired with slinky to form an application.
+
+## Split Image
+
+Split applications allow the user to build the application content separate from the library content by splitting an application into two pieces:
+
+* A "loader" which contains a separate application that can perform upgrades and manage split images
+* A "split app" which contains the main application content and references the libraries in the loader by static linkage
+
+See [split image architecture](http://mynewt.apache.org/latest/os/modules/split/split/) for the details of split image design.
+
+## Contents
+
+splitty is just a simply app that has newtmgr, shell and blinkys the LED at a differernt rate than slinky, so its visually evident that its running.
+
+## Usage
+
+You can use splitty as part of a split app by setting up your target.
+
+```
+targets/app
+    app=@apache-mynewt-core/apps/splitty
+    loader=@apache-mynewt-core/apps/slinky
+    bsp=@apache-mynewt-core/hw/bsp/nrf52dk
+    build_profile=optimized
+```
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f2d1ba1e/libs/split/README.md
----------------------------------------------------------------------
diff --git a/libs/split/README.md b/libs/split/README.md
new file mode 100644
index 0000000..1ef4cc5
--- /dev/null
+++ b/libs/split/README.md
@@ -0,0 +1,63 @@
+
+
+<img src="http://mynewt.apache.org/img/logo.svg" width="250" alt="Apache Mynewt">
+
+## Overview
+
+`libs/split` is a library required to build split applications.  When building a split application you must include `libs/split` in your loader and your application
+
+## Split Image
+
+Split applications allow the user to build the application content separate from the library content by splitting an application into two pieces:
+
+* A "loader" which contains a separate application that can perform upgrades and manage split images
+* A "split app" which contains the main application content and references the libraries in the loader by static linkage
+
+See [split image architecture](http://mynewt.apache.org/latest/os/modules/split/split/) for the details of split image design.
+
+
+## Contents
+
+`libs/split` contains the following components
+
+* The split app configuration which tells the system whether to run the "loader" or the "app"
+* The newrmgr commands to access split functionality
+* The functions used by the loader to check and run a split application
+
+## Examples
+
+### Split App
+
+Your split application and loader must initialize the library by calling
+
+```
+#include "split/split.h"
+void split_app_init(void);
+```
+
+This registers the configuration and commands for split applications.
+
+### Loader
+
+Your loader can call 
+
+```
+int split_app_go(void **entry, int toBoot);
+```
+
+to check whether the split application can be run.  A example is shown below
+
+```
+#include "split/split.h"
+#include "bootutil/bootutil.h"
+    {
+        void *entry;
+        rc = split_app_go(&entry, true);
+        if(rc == 0) {
+            system_start(entry);
+        }
+    }
+```
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f2d1ba1e/libs/split/include/split/split.h
----------------------------------------------------------------------
diff --git a/libs/split/include/split/split.h b/libs/split/include/split/split.h
index edf436c..9396a9c 100644
--- a/libs/split/include/split/split.h
+++ b/libs/split/include/split/split.h
@@ -22,7 +22,6 @@
 
 #define SPLIT_NMGR_OP_SPLIT 0
 
-
 typedef enum splitMode_e {
     SPLIT_NONE,
     SPLIT_TEST,
@@ -36,9 +35,22 @@ typedef enum splitStatus_e {
     SPLIT_MATCHING,
 }splitStatus_t;
 
+/*
+  * Initializes the split application library */
 void
 split_app_init(void);
 
+/**
+  * checks the split application state.
+  * If the application is configured to be run (and valid)
+  * returns zero and puts the entry data into entry. NOTE:
+  * Entry data is not a function pointer, but a pointer
+  * suitable to call system_start
+  *
+  * If toBoot is true, also performs the necessary steps
+  * to prepare to boot.  An application may set toBoot to
+  * false and call this function to check whether the split
+  * application is bootable */
 int
 split_app_go(void **entry, int toBoot);