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/04/08 00:22:06 UTC

[6/9] incubator-mynewt-site git commit: Removed -v from newt command This file is renamed from project-slinky.md to project-sim-slinky.md

Removed -v from newt command
This file is renamed from project-slinky.md to project-sim-slinky.md


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/85f956e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/85f956e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/85f956e6

Branch: refs/heads/develop
Commit: 85f956e6e0b5fdb5bfce767b7bc14518d3223c87
Parents: 59a5159
Author: cwanda <wa...@happycity.com>
Authored: Fri Apr 7 11:27:47 2017 -0700
Committer: cwanda <wa...@happycity.com>
Committed: Fri Apr 7 11:27:47 2017 -0700

----------------------------------------------------------------------
 docs/os/tutorials/project-sim-slinky.md | 119 +++++++++++++++++++++++++++
 1 file changed, 119 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/85f956e6/docs/os/tutorials/project-sim-slinky.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/project-sim-slinky.md b/docs/os/tutorials/project-sim-slinky.md
new file mode 100644
index 0000000..8a6eb4e
--- /dev/null
+++ b/docs/os/tutorials/project-sim-slinky.md
@@ -0,0 +1,119 @@
+## Project Sim Slinky  
+
+This tutorial shows you how to create, build and run the Slinky application and communicate with newtmgr for a simulated device.
+
+<br>
+### Prerequisites
+
+Meet the prerequisites listed in [Project Slinky](/os/tutorials/project-slinky.md).
+
+### Creating a new project
+
+Instructions for creating a project are located in the [Basic Setup](../get_started/project_create/) section of the [Mynewt Documentation](../introduction/)
+
+We will list only the steps here for brevity.  We will name the project `slinky`.
+
+```no-highlight
+$ newt new slinky
+Downloading project skeleton from apache/incubator-mynewt-blinky...
+...
+Installing skeleton in slink...
+Project slinky successfully created
+$ cd slinky
+$newt install
+apache-mynewt-core
+```
+
+### Setting up your target build
+
+Create a target for `slinky` using the native bsp. We will list only the steps and suppress the tool output here for brevity.
+
+```no-highlight
+    $ newt target create sim_slinky
+    $ newt target set sim_slinky bsp=@apache-mynewt-core/hw/bsp/native
+    $ newt target set sim_slinky build_profile=debug
+    $ newt target set sim_slinky app=@apache-mynewt-core/apps/slinky
+```
+
+### Building Your target
+
+To build your target, use `newt build`.  When complete, an executable file
+is created.
+
+```no-highlight
+    $ newt build sim_slinky 
+    Building target targets/sim_slinky
+    Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec256.c
+    Compiling repos/apache-mynewt-core/boot/bootutil/src/image_rsa.c
+    Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec.c
+    Compiling repos/apache-mynewt-core/boot/split/src/split.c
+    Compiling repos/apache-mynewt-core/boot/bootutil/src/image_validate.c
+    Compiling repos/apache-mynewt-core/boot/bootutil/src/loader.c
+    Compiling repos/apache-mynewt-core/boot/bootutil/src/bootutil_misc.c
+    Compiling repos/apache-mynewt-core/crypto/mbedtls/src/aesni.c
+    Compiling repos/apache-mynewt-core/crypto/mbedtls/src/aes.c
+    Compiling repos/apache-mynewt-core/boot/split/src/split_config.c
+    Compiling repos/apache-mynewt-core/apps/slinky/src/main.c
+
+              ...
+
+    Archiving util_crc.a
+    Archiving util_mem.a
+    Linking ~/dev/slinky/bin/targets/sim_slinky/app/apps/slinky/slinky.elf
+    Target successfully built: targets/sim_slinky
+
+```
+
+### Run the target
+
+Run the executable you have build for the simulated environment. The serial port name on which the simulated target is connected is shown in the output when mynewt slinky starts.
+
+```no-highlight
+    $ ~/dev/slinky/bin/targets/sim_slinky/app/apps/slinky/slinky.elf
+    uart0 at /dev/ttys005
+```
+
+<br>
+
+In this example, the slinky app opened up a com port `/dev/ttys005` for communications with newtmgr. 
+
+**NOTE:** This application will block. You will need to open a new console (or execute this in another console) to continue the tutorial.*
+
+<br>
+
+### Setting up a connection profile
+
+You will now set up a connection profile using `newtmgr` for the serial port connection and start communicating with the simulated remote device.
+
+```no-highlight
+    $ newtmgr conn add sim1 type=serial connstring=/dev/ttys005
+    Connection profile sim1 successfully added
+    $ newtmgr conn show
+    Connection profiles: 
+      sim1: type=serial, connstring='/dev/ttys005'
+```
+
+### Executing newtmgr commands with the target
+
+You can now use connection profile `sim1` to talk to the running sim_slinky.
+As an example, we will query the running mynewt OS for the usage of its 
+memory pools.  
+
+```no-highlight
+    $ newtmgr -c sim1 mpstats
+    Return Code = 0
+                            name blksz  cnt free  min
+                          msys_1   292   12   10   10
+
+```
+
+As a test command, you can send an arbitrary string to the target and it
+will echo that string back in a response to newtmgr.
+
+```no-highlight
+    $ newtmgr -c sim1 echo "Hello Mynewt"
+    Hello Mynewt
+```
+
+In addition to these, you can also examine running tasks, statistics, 
+logs, image status (not on sim), and configuration.