You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2016/03/17 02:51:36 UTC
[1/3] incubator-mynewt-site git commit: MYNEWT-214
Repository: incubator-mynewt-site
Updated Branches:
refs/heads/master 0ff4d891f -> 7fc4a18a8
MYNEWT-214
rewrite newtmgr tutorials for new newt and cleaup
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/b332b1c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/b332b1c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/b332b1c4
Branch: refs/heads/master
Commit: b332b1c46bf1601b001937ecd6b48380de3d6d7e
Parents: 4d24515
Author: Paul Dietrich <pa...@yahoo.com>
Authored: Wed Mar 16 15:43:16 2016 -0700
Committer: Paul Dietrich <pa...@yahoo.com>
Committed: Wed Mar 16 15:43:16 2016 -0700
----------------------------------------------------------------------
docs/newtmgr/installing.md | 67 +++++++
docs/newtmgr/project-slinky.md | 292 ++++++++---------------------
docs/newtmgr/project-target-slinky.md | 179 ++++++++++++++++++
mkdocs.yml | 4 +-
4 files changed, 331 insertions(+), 211 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/b332b1c4/docs/newtmgr/installing.md
----------------------------------------------------------------------
diff --git a/docs/newtmgr/installing.md b/docs/newtmgr/installing.md
new file mode 100644
index 0000000..2a0e94f
--- /dev/null
+++ b/docs/newtmgr/installing.md
@@ -0,0 +1,67 @@
+
+# Installing Newtmgr
+
+This page shows you how to install newtmgr from source code.
+
+### Install Go (golang)
+
+If you have not already done so, install golang for your platform.
+
+The easiest way on a MAC is to use `brew`.
+
+```no-highlight
+brew install go
+==> Downloading https://homebrew.bintray.com/bottles/go-1.5.3.mavericks.bottle.t
+...
+==> Summary
+🍺 /usr/local/Cellar/go/1.5.3: 5,336 files, 259.6M
+```
+Alternately you can download binaries from
+[the golang.org site](https://golang.org/doc/install)
+To test your go implementation, you can query go for its version information
+
+```no-highlight
+$ go version
+go version go1.5.3 darwin/amd64
+```
+
+To use go, you must set a `$GOPATH` variable in your environment. This tells
+go where to put all the packages it downloads, builds and runs.
+
+```no-highlight
+$ mkdir $HOME/dev
+$ export GOPATH=$HOME/dev/Go
+```
+
+Its best to add this to your `.profile` so its set automatically for your
+environment.
+
+### Download the newtmgr source
+
+You will first download the source code for newt.
+
+```no-highlight
+ go get mynewt.apache.org/newt/...
+ (wait a few minutes please, this sits without any indications of working)
+```
+
+### Building newtmgr
+
+Change into the directory where the newmgr tool was downloaded and
+install the newtmgr tool
+
+```no-highlight
+ cd $GOPATH/src/mynewt.apache.org/newt/newtmgr
+ go install
+ $ ls $GOPATH/bin
+ ... newtmgr ...
+```
+
+Note: If the `go install` command results in errors indicating some package
+cannot be found, do a `go get` to download all the third-party files needed
+from github.com and then run `go install` again.
+
+### Add to your Path
+
+Add your `$GOPATH/bin` directory to your path
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/b332b1c4/docs/newtmgr/project-slinky.md
----------------------------------------------------------------------
diff --git a/docs/newtmgr/project-slinky.md b/docs/newtmgr/project-slinky.md
index 7aa1996..71137a1 100644
--- a/docs/newtmgr/project-slinky.md
+++ b/docs/newtmgr/project-slinky.md
@@ -1,18 +1,13 @@
-## Project Slinky
+## Project Sim Slinky
### Objective
-The goal of the project is to enable and demonstate remote communications with a device or target via newt manager (newtmgr). We will first build the project image for a simulated device and then build an image for a hardware target. Next, the tool newtmgr has to be installed and a connection established with the target. Finally, various available commands in newtmgr will be used to query the target, upgrade image, and collect data from the endpoint.
-
+The goal of the project is to enable and demonstrate remote communications with the Mynewt OS via newt manager (newtmgr). We will do this through building a project with Mynewt called Slinky that runs via the native platform.
### What you need
-1. STM32-E407 development board from Olimex. You can order it from [http://www.mouser.com](http://www.mouser.com/ProductDetail/Olimex-Ltd/STM32-E407/?qs=UN6GZl1KCcit6Ye0xmPO4A%3D%3D), [http://www.digikey.com](http://www.digikey.com/product-detail/en/STM32-E407/1188-1093-ND/3726951), and other places.
-2. ARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)
-3. USB A-B type cable to connect the debugger to your personal computer
-4. A USB to TTL Serial Cable with female wiring harness. An example is [http://www.amazon.com/JBtek®-WINDOWS-Supported-Raspberry-Programming/dp/B00QT7LQ88/ref=lp_464404_1_9?s=pc&ie=UTF8&qid=1454631303&sr=1-9](http://www.amazon.com/JBtek®-WINDOWS-Supported-Raspberry-Programming/dp/B00QT7LQ88/ref=lp_464404_1_9?s=pc&ie=UTF8&qid=1454631303&sr=1-9)
-5. Personal Computer
+1.Personal Computer
The 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:
@@ -20,247 +15,124 @@ The instructions assume the user is using a Bourne-compatible shell (e.g. bash o
### Overview of steps
-* Define targets using the newt tool
+* Install dependencies
+* Define a target using the newt tool
* Build executables for the targets using the newt tool
-* Set up serial connection with the targets - both the physical connection with a hardware target and the connection profile using the newtmgr tool
+* Set up serial connection with the targets
+* Create a connection profile using the newtmgr tool
* Use the newtmgr tool to communicate with the targets
-The following instructions will walk you through the update of the larva nest and the installation of newtmgr as well.
+### Installing newt
-### Creating local repository
+If you have not already installed `newt` see the
+[newt installation instructions](../newt/tutorials/newt_mac.md) and ensure newt is installed an in your path.
-Make sure Mynewt's default nest `larva` is up to date by downloading the latest from the Apache mynewt repository ([https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva](https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva)).
+### Installing newtmgr
-```no-highlight
- $ pwd
- /Users/<user>/dev/larva
- $ ls -al
- total 72
- drwxr-xr-x 18 <user> staff 612 Feb 3 15:47 .
- drwxr-xr-x 5 <user> staff 170 Feb 3 13:32 ..
- drwxr-xr-x 13 <user> staff 442 Feb 3 13:32 .git
- -rw-r--r-- 1 <user> staff 66 Feb 3 13:32 .gitignore
- -rw-r--r-- 1 <user> staff 0 Feb 3 13:32 .gitmodules
- drwxr-xr-x 4 <user> staff 136 Feb 3 16:13 .nest
- -rw-r--r-- 1 <user> staff 11358 Feb 3 13:32 LICENSE
- ...
- ...
- drwxr-xr-x 5 <user> staff 170 Feb 3 13:32 sys
- $ git pull origin master
-```
+If you have not already installed `newtmgr` see the
+[newtmgr installation instructions](installing.md) and ensure newtmgr is installed an in your path.
+
+### Creating a new project
-### Installing Newtmgr
+Instructions for creating a project are located in the [Getting Started](../os/get_started/project_create.md) section of the [Mynewt OS Manual](../os/get_started/introduction.md)
-You will first download the source code for newt. Currently, you need to create a symbolic link for all the directory references in the go scripts to work correctly.
+We will list only the steps here for brevity. We will name the project
+`slinky`.
```no-highlight
- $ cd ~/dev
- $ go get git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git/newt
- $ ln -s ~/dev/go/src/git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git ~/dev/go/src/git-wip-us.apache.org/repos/asf/incubator-mynewt-newt
-
- $ pwd
- /Users/<user>/dev/go
- $ ls
- bin pkg src
- $ cd src/git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/newt
- $ ls
- newt newtmgr newtvm util
- $ cd newtmgr
- $ go build
- $
+ $ newt new slinky
+ Downloading project skeleton from apache/incubator-mynewt-blinky...
+ ...
+ Installing skeleton in slink...
+ Project slink successfully created
+ $ cd slinky
+ $ newt install -v
+ Downloading repository description for apache-mynewt-core... success!
+ ...
+ Repos successfully installed
```
-Note: If the `go build` command results in errors indicating some package cannot be found, do a `go get` to download all the third-party files needed from github.com and then run `go build` again.
+### Setting up your target build
-### Building Targets
-
-You will create a total of 4 targets. The first one is a simulation target and the second a hardware target (for STM32-E407 Olimex development board). In order to run an image from the flash on the Olimex board, a bootloader is required. You will build two additional targets (bootloader and bin2img) as explained in Project Blinky under [Using flash to make LED blink](../get_started/project1/#using-flash-to-make-led-blink) and as shown below.
-
-Here;'s how to create the target for simulation.
+Create a target for `slinky` using the native bsp. See
+[How to Define a Target](../newt/tutorials/define_target.md) for a detailed
+description. We will list only the steps and suppress the tool output
+here for brevity.
```no-highlight
- $ newt target create slinky_sim
- Creating target slinky_sim
- Target slinky_sim sucessfully created!
- $ newt target set slinky_sim arch=sim
- Target slinky_sim successfully set arch to sim
- $ newt target set slinky_sim compiler=sim
- Target slinky_sim successfully set compiler to sim
- $ newt target set slinky_sim project=slinky
- Target slinky_sim successfully set project to slinky
- $ newt target set slinky_sim compiler_def=debug
- Target slinky_sim successfully set compiler_def to debug
- $ newt target set slinky_sim bsp=hw/bsp/native
- Target slinky_sim successfully set bsp to hw/bsp/native
- $ newt target show slinky_sim
- slinky_sim
- arch: sim
- bsp: hw/bsp/native
- compiler: sim
- compiler_def: debug
- name: slinky_sim
- project: slinky
+ $ 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
```
-Repeat the above steps using the attribute information for each target from the target output shown below to create the remaining three targets. The four target definitions are:
-```no-highlight
- $ newt target show
- bin2img
- arch: sim
- bsp: hw/bsp/native
- compiler: sim
- compiler_def: debug
- name: bin2img
- project: bin2img
- boot_olimex
- arch: cortex_m4
- bsp: hw/bsp/olimex_stm32-e407_devboard
- compiler: arm-none-eabi-m4
- compiler_def: optimized
- name: boot_olimex
- project: boot
- slinky1
- arch: cortex_m4
- bsp: hw/bsp/olimex_stm32-e407_devboard
- compiler: arm-none-eabi-m4
- compiler_def: debug
- name: slinky1
- project: slinky
- slinky_sim
- arch: sim
- bsp: hw/bsp/native
- compiler: sim
- compiler_def: debug
- name: slinky_sim
- project: slinky
-```
-Go ahead and build all the targets. The build command for slinky_sim is shown below.
-```no-highlight
- $ newt target build slinky_sim
- Building target slinky_sim (project = slinky)
- Compiling base64.c
- Compiling cbmem.c
- ...
- Archiving libnative.a
- Compiling main.c
- Building project slinky
- Linking slinky.elf
- Successfully run!
-```
-Now run the `newt target build` command for the remaining three targets.
-
+### Building Your target
-### Using newtmgr with a sim 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.
+To build your target, use `newt build`. When complete, an executable file
+is created.
```no-highlight
- $ pwd
- /Users/<user>/dev/larva/project/slinky
- $ ./bin/slinky_sim/slinky.elf
- uart0 at /dev/ttys007
+ $ newt build sim_slinky
+ Compiling main.c
+ ...
+ Linking slinky.elf
+ App successfully built: ~/dev/slinky/bin/sim_slinky/apps/slinky/slinky.elf
```
-* 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/ttys007
- Connection profile sim1 successfully added
- $ newtmgr conn show
- Connection profiles:
- sim1: type=serial, connstring='/dev/ttys007'
- $ newtmgr -c sim1 taskstats
- Return Code = 0
- uart_poller (prio=0 tid=3 runtime=0 cswcnt=43810 stksize=1024 stkusage=325 last_checkin=0 next_checkin=0)
- newtmgr (prio=4 tid=4 runtime=0 cswcnt=6 stksize=1024 stkusage=585 last_checkin=0 next_checkin=0)
- task1 (prio=1 tid=5 runtime=0 cswcnt=551 stksize=1024 stkusage=83 last_checkin=0 next_checkin=0)
- task2 (prio=2 tid=6 runtime=0 cswcnt=551 stksize=1024 stkusage=85 last_checkin=0 next_checkin=0)
- idle (prio=255 tid=0 runtime=552525 cswcnt=44005 stksize=1024 stkusage=529 last_checkin=0 next_checkin=0)
- os_sanity (prio=254 tid=1 runtime=0 cswcnt=551 stksize=1024 stkusage=82 last_checkin=0 next_checkin=0)
- shell (prio=3 tid=2 runtime=0 cswcnt=20 stksize=1024 stkusage=142 last_checkin=0 next_checkin=0)
- $ newtmgr -c sim1 stat stat
- Return Code = 0
- Stats Name: stat
- s0: 1
-```
-
+### Run the target
-### Using newtmgr with a remote target
-
-* 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. You will see the executables in the `slinky1` directory created for the Olimex target to run the slinky project.
+* 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
- $ pwd
- /Users/<user>/dev/larva/project/slinky
- $ ls
- bin egg.yml slinky.yml src
- $ ls bin
- slinky1 slinky_sim
- $ ls bin/slinky1
- slinky.elf slinky.elf.bin slinky.elf.cmd slinky.elf.img slinky.elf.lst slinky.elf.map
- $ newt target download boot_olimex
- Downloading with /Users/<user>/dev/larva/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
- $ newt target download slinky1
- Downloading with /Users/<user>/dev/larva/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
+ $ ~/dev/slinky/bin/sim_slinky/apps/slinky/slinky.elf
+ uart0 at /dev/ttys005
```
- 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/](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](https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf) for reference.
-
- 
-
+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.*
- * 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.
+### Setting up a connection profile
-
-* Locate the serial connection established in the /dev directory of your computer. It should be of the type `tty.usbserial-<some identifier>`.
+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
- $ ls /dev/tty.usbserial-AJ03HAQQ
- /dev/tty.usbserial-AJ03HAQQ
+ $ newtmgr conn add sim1 type=serial connstring=/dev/ttys005
+ Connection profile sim1 successfully added
+ $ newtmgr conn show
+ Connection profiles:
+ sim1: type=serial, connstring='/dev/ttys007'
```
-* 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`.
+### Executing newtmgr commands with the target
+
+You can now use connection profile `sim1` to talk to the running sim_blinky.
+As an example, we will query the running mynewt OS for the usage of its
+memory pools.
```no-highlight
- $ pwd
- /Users/<user>/dev/larva/project/slinky
- $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ
- Connection profile olimex01 successfully added
- $ newtmgr conn show
- Connection profiles:
- sim1: type=serial, connstring='/dev/ttys007'
- olimex01: type=serial, connstring='/dev/tty.usbserial-AJ03HAQQ'
+ $ newtmgr -c sim1 mpstats
+ Return Code = 0
+ nffs_cache_inode_pool (blksize=36 nblocks=4 nfree=4)
+ nffs_cache_block_pool (blksize=32 nblocks=64 nfree=64)
+ nffs_dir_pool (blksize=8 nblocks=4 nfree=4)
+ default_mbuf_data (blksize=256 nblocks=10 nfree=8)
+ nffs_file_pool (blksize=12 nblocks=4 nfree=4)
+ nffs_inode_entry_pool (blksize=24 nblocks=100 nfree=98)
+ nffs_block_entry_pool (blksize=12 nblocks=100 nfree=100)
```
-* 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.
+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 echo -c olimex01 hello
- {"r": "hello"}
- $ newtmgr image -c olimex01 list
- Images:
- 0 : 11.22.33.44
- $ newtmgr -c olimex01 taskstats
- Return Code = 0
- shell (prio=3 tid=1 runtime=0 cswcnt=5 stksize=1024 stkusage=60 last_checkin=0 next_checkin=0)
- newtmgr (prio=4 tid=2 runtime=0 cswcnt=4 stksize=1024 stkusage=256 last_checkin=0 next_checkin=0)
- task1 (prio=1 tid=3 runtime=0 cswcnt=23 stksize=1024 stkusage=32 last_checkin=0 next_checkin=0)
- task2 (prio=2 tid=4 runtime=0 cswcnt=24 stksize=1024 stkusage=33 last_checkin=0 next_checkin=0)
- idle (prio=255 tid=0 runtime=23121 cswcnt=26 stksize=32 stkusage=16 last_checkin=0 next_checkin=0)
+ $ newtmgr -c sim1 echo "Hello Mynewt"
+ {"r": "Hello Mynewt"}
```
+The response comes back as a json string.
-
-
-
-
-
-
-
-
+In addition to these, uou can also examine running tasks, statistics,
+logs, image status (not on sim), and configuration.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/b332b1c4/docs/newtmgr/project-target-slinky.md
----------------------------------------------------------------------
diff --git a/docs/newtmgr/project-target-slinky.md b/docs/newtmgr/project-target-slinky.md
new file mode 100644
index 0000000..f66730e
--- /dev/null
+++ b/docs/newtmgr/project-target-slinky.md
@@ -0,0 +1,179 @@
+## Project Slinky
+
+
+### Objective
+
+The goal of the project is to enable and demonstrate remote communications with the Mynewt OS via newt manager (newtmgr). We will do this through building a project with Mynewt called Slinky that runs on the STM32-E407 board.
+
+### What you need
+
+1. STM32-E407 development board from Olimex. You can order it from [http://www.mouser.com](http://www.mouser.com/ProductDetail/Olimex-Ltd/STM32-E407/?qs=UN6GZl1KCcit6Ye0xmPO4A%3D%3D), [http://www.digikey.com](http://www.digikey.com/product-detail/en/STM32-E407/1188-1093-ND/3726951), and other places.
+2. ARM-USB-TINY-H connector with JTAG interface for debugging ARM microcontrollers (comes with the ribbon cable to hook up to the board)
+3. USB A-B type cable to connect the debugger to your personal computer
+4. A USB to TTL Serial Cable with female wiring harness. An example is [http://www.amazon.com/JBtek®-WINDOWS-Supported-Raspberry-Programming/dp/B00QT7LQ88/ref=lp_464404_1_9?s=pc&ie=UTF8&qid=1454631303&sr=1-9](http://www.amazon.com/JBtek®-WINDOWS-Supported-Raspberry-Programming/dp/B00QT7LQ88/ref=lp_464404_1_9?s=pc&ie=UTF8&qid=1454631303&sr=1-9)
+5. Personal Computer
+
+The 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:
+
+* Mac: OS X Yosemite Version 10.10.5
+
+### Overview of steps
+
+* Install dependencies
+* Define a target using the newt tool
+* Build executables for the targets using the newt tool
+* Set up serial connection with the targets
+* Create a connection profile using the newtmgr tool
+* Use the newtmgr tool to communicate with the targets
+
+### Installing newt
+
+If you have not already installed `newt` see the
+[newt installation instructions](../newt/tutorials/newt_mac.md) and ensure newt is installed an in your path.
+
+### Installing newtmgr
+
+If you have not already installed `newtmgr` see the
+[newtmgr installation instructions](installing.md) and ensure newtmgr is installed an in your path.
+
+### Creating a new project
+
+Instructions for creating a project are located in the [Getting Started](../os/get_started/project_create.md) section of the [Mynewt OS Manual](../os/get_started/introduction.md)
+
+If you already completed [sim slinky](project-slinky.md) you can skip this step.
+
+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 slink successfully created
+$ cd slinky
+$newt install -v
+Downloading repository description for apache-mynewt-core... success!
+...
+Repos successfully installed
+```
+
+### Setting up your target builds
+
+Create a target for `stm32_slinky` using the native bsp. See
+[How to Define a Target](../newt/tutorials/define_target.md) for a detailed
+description. The tool output is suppressed below for brevity.
+
+```no-highlight
+$ newt target create stm32_slinky
+$ newt target set stm32_slinky bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard
+$ newt target set stm32_slinky build_profile=debug
+$ newt target set stm32_slinky app=@apache-mynewt-core/apps/slinky
+```
+
+Create a second target for `stm32_bootloader` to build a bootloader to boot
+the `stm32_slinky` image. The tool output is suppressed below for brevity.
+
+```no-highlight
+$ newt target create stm32_bootloader
+$ newt target set stm32_bootloader bsp=@apache-mynewt-core/hw/bsp/olimex_stm32-e407_devboard
+$ newt target set stm32_bootloader build_profile=optimized
+$ newt target set stm32_bootloader target.app=@apache-mynewt-core/apps/boot
+```
+
+### Building Targets
+
+```no-highlight
+$ newt build stm32_slinky
+Compiling main.c
+...
+Linking slinky.elf
+App successfully built: ~/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.elf
+```
+
+```no-highlight
+newt build stm32_bootloader
+Compiling crc16.c
+...
+Linking boot.elf
+App successfully built: ~/slinky/bin/stm32_bootloader/apps/boot/boot.elf
+```
+
+For the main image, you need to create an image using newt create-image.
+Give this image some arbitrary version number "1.2.3".
+
+```no-highlight
+$ newt create-image stm32_slinky 1.2.3
+App image succesfully generated: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/slinky.img
+Build manifest: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/manifest.json
+```
+
+### Using newtmgr with a remote target
+
+* 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.
+
+```no-highlight
+$ newt load stm32_bootloader
+$ 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/](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](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>`.
+
+```no-highlight
+ $ ls /dev/tty.usbserial-AJ03HAQQ
+ /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`.
+
+```no-highlight
+ $ pwd
+ /Users/<user>/dev/larva/project/slinky
+ $ newtmgr conn add olimex01 type=serial connstring=/dev/tty.usbserial-AJ03HAQQ
+ Connection profile olimex01 successfully added
+ $ newtmgr conn show
+ Connection profiles:
+ sim1: type=serial, connstring='/dev/ttys007'
+ 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.
+
+```no-highlight
+ $ newtmgr echo -c olimex01 hello
+ {"r": "hello"}
+ $ newtmgr image -c olimex01 list
+ Images:
+ 0 : 1.2.3
+ $ newtmgr -c olimex01 taskstats
+ Return Code = 0
+ newtmgr (prio=4 tid=2 runtime=0 cswcnt=12 stksize=512 stkusage=255 last_checkin=0 next_checkin=0)
+ task1 (prio=1 tid=3 runtime=0 cswcnt=299 stksize=128 stkusage=33 last_checkin=0 next_checkin=0)
+ task2 (prio=2 tid=4 runtime=0 cswcnt=300 stksize=128 stkusage=31 last_checkin=0 next_checkin=0)
+ idle (prio=255 tid=0 runtime=299916 cswcnt=313 stksize=32 stkusage=18 last_checkin=0 next_checkin=0)
+ shell (prio=3 tid=1 runtime=1 cswcnt=20 stksize=384 stkusage=60 last_checkin=0 next_checkin=0)
+```
+
+
+
+
+
+
+
+
+
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/b332b1c4/mkdocs.yml
----------------------------------------------------------------------
diff --git a/mkdocs.yml b/mkdocs.yml
index 3583b46..2d5b189 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -304,8 +304,10 @@ pages:
- 'newt version': 'newt/command_list/newt_version.md'
- Newt Manager Manual:
- 'Introduction': 'newtmgr/overview.md'
+ - 'Installing': 'newtmgr/installing.md'
- Tutorials:
- - 'Project Slinky': 'newtmgr/project-slinky.md'
+ - 'Sim Slinky': 'newtmgr/project-slinky.md'
+ - 'Target Slinky': 'newtmgr/project-target-slinky.md'
- Manual:
- 'Protocol': 'newtmgr/protocol.md'
- Appendix:
[2/3] incubator-mynewt-site git commit: Merge branch 'MYNEWT-214' of
https://github.com/paulfdietrich/incubator-mynewt-site
Posted by ad...@apache.org.
Merge branch 'MYNEWT-214' of https://github.com/paulfdietrich/incubator-mynewt-site
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/6695951b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/6695951b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/6695951b
Branch: refs/heads/master
Commit: 6695951b0595966280309e2a817f0b825b313f17
Parents: 0ff4d89 b332b1c
Author: aditihilbert <ad...@runtime.io>
Authored: Wed Mar 16 18:30:56 2016 -0700
Committer: aditihilbert <ad...@runtime.io>
Committed: Wed Mar 16 18:30:56 2016 -0700
----------------------------------------------------------------------
docs/newtmgr/installing.md | 67 +++++++
docs/newtmgr/project-slinky.md | 292 ++++++++---------------------
docs/newtmgr/project-target-slinky.md | 179 ++++++++++++++++++
mkdocs.yml | 4 +-
4 files changed, 331 insertions(+), 211 deletions(-)
----------------------------------------------------------------------
[3/3] incubator-mynewt-site git commit: Updated Slinky tutorials for
newtmgr. This closes #54
Posted by ad...@apache.org.
Updated Slinky tutorials for newtmgr. This closes #54
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/7fc4a18a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/7fc4a18a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/7fc4a18a
Branch: refs/heads/master
Commit: 7fc4a18a87e64ed1cb79598f1574f91bc8ded548
Parents: 6695951
Author: aditihilbert <ad...@runtime.io>
Authored: Wed Mar 16 18:51:24 2016 -0700
Committer: aditihilbert <ad...@runtime.io>
Committed: Wed Mar 16 18:51:24 2016 -0700
----------------------------------------------------------------------
docs/newtmgr/installing.md | 23 +++++++++++++++-----
docs/newtmgr/project-slinky.md | 14 +++++++-----
docs/newtmgr/project-target-slinky.md | 35 ++++++++++++++++++++----------
3 files changed, 51 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/7fc4a18a/docs/newtmgr/installing.md
----------------------------------------------------------------------
diff --git a/docs/newtmgr/installing.md b/docs/newtmgr/installing.md
index 2a0e94f..8f8589d 100644
--- a/docs/newtmgr/installing.md
+++ b/docs/newtmgr/installing.md
@@ -5,7 +5,7 @@ This page shows you how to install newtmgr from source code.
### Install Go (golang)
-If you have not already done so, install golang for your platform.
+If you have not already done so, install Go for your platform.
The easiest way on a MAC is to use `brew`.
@@ -16,15 +16,20 @@ brew install go
==> Summary
🍺 /usr/local/Cellar/go/1.5.3: 5,336 files, 259.6M
```
-Alternately you can download binaries from
+
+<br>
+
+Alternatively, you can download binaries from
[the golang.org site](https://golang.org/doc/install)
-To test your go implementation, you can query go for its version information
+To test your Go implementation, you can query Go for its version information
```no-highlight
$ go version
go version go1.5.3 darwin/amd64
```
+<br>
+
To use go, you must set a `$GOPATH` variable in your environment. This tells
go where to put all the packages it downloads, builds and runs.
@@ -33,9 +38,13 @@ $ mkdir $HOME/dev
$ export GOPATH=$HOME/dev/Go
```
+<br>
+
Its best to add this to your `.profile` so its set automatically for your
environment.
+<br>
+
### Download the newtmgr source
You will first download the source code for newt.
@@ -45,6 +54,8 @@ You will first download the source code for newt.
(wait a few minutes please, this sits without any indications of working)
```
+<br>
+
### Building newtmgr
Change into the directory where the newmgr tool was downloaded and
@@ -57,11 +68,13 @@ install the newtmgr tool
... newtmgr ...
```
-Note: If the `go install` command results in errors indicating some package
+<br>
+
+**Note:** If the `go install` command results in errors indicating some package
cannot be found, do a `go get` to download all the third-party files needed
from github.com and then run `go install` again.
### Add to your Path
-Add your `$GOPATH/bin` directory to your path
+Add your `$GOPATH/bin` directory to your path.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/7fc4a18a/docs/newtmgr/project-slinky.md
----------------------------------------------------------------------
diff --git a/docs/newtmgr/project-slinky.md b/docs/newtmgr/project-slinky.md
index 71137a1..077aacc 100644
--- a/docs/newtmgr/project-slinky.md
+++ b/docs/newtmgr/project-slinky.md
@@ -81,7 +81,7 @@ is created.
### 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
+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
@@ -89,10 +89,14 @@ when mynewt slinky starts.
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.*
+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
@@ -134,5 +138,5 @@ will echo that string back in a response to newtmgr.
The response comes back as a json string.
-In addition to these, uou can also examine running tasks, statistics,
+In addition to these, you can also examine running tasks, statistics,
logs, image status (not on sim), and configuration.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/7fc4a18a/docs/newtmgr/project-target-slinky.md
----------------------------------------------------------------------
diff --git a/docs/newtmgr/project-target-slinky.md b/docs/newtmgr/project-target-slinky.md
index f66730e..e92344d 100644
--- a/docs/newtmgr/project-target-slinky.md
+++ b/docs/newtmgr/project-target-slinky.md
@@ -3,7 +3,7 @@
### Objective
-The goal of the project is to enable and demonstrate remote communications with the Mynewt OS via newt manager (newtmgr). We will do this through building a project with Mynewt called Slinky that runs on the STM32-E407 board.
+The goal of the project is to enable and demonstrate remote communications with the Mynewt OS via newt manager (newtmgr). We will do this through a project with Mynewt called Slinky that runs on the STM32-E407 board.
### What you need
@@ -26,19 +26,19 @@ The instructions assume the user is using a Bourne-compatible shell (e.g. bash o
* Create a connection profile using the newtmgr tool
* Use the newtmgr tool to communicate with the targets
-### Installing newt
+### Install newt
-If you have not already installed `newt` see the
+If you have not already installed `newt`, see the
[newt installation instructions](../newt/tutorials/newt_mac.md) and ensure newt is installed an in your path.
-### Installing newtmgr
+### Install newtmgr
-If you have not already installed `newtmgr` see the
+If you have not already installed `newtmgr`, see the
[newtmgr installation instructions](installing.md) and ensure newtmgr is installed an in your path.
-### Creating a new project
+### Create a new project
-Instructions for creating a project are located in the [Getting Started](../os/get_started/project_create.md) section of the [Mynewt OS Manual](../os/get_started/introduction.md)
+Instructions for creating a project are located in the [Getting Started](../os/get_started/project_create.md) section of the [Mynewt OS Manual](../os/get_started/introduction.md).
If you already completed [sim slinky](project-slinky.md) you can skip this step.
@@ -58,7 +58,9 @@ Downloading repository description for apache-mynewt-core... success!
Repos successfully installed
```
-### Setting up your target builds
+<br>
+
+### Set up your target builds
Create a target for `stm32_slinky` using the native bsp. See
[How to Define a Target](../newt/tutorials/define_target.md) for a detailed
@@ -81,7 +83,9 @@ $ newt target set stm32_bootloader build_profile=optimized
$ newt target set stm32_bootloader target.app=@apache-mynewt-core/apps/boot
```
-### Building Targets
+<br>
+
+### Build Targets
```no-highlight
$ newt build stm32_slinky
@@ -108,6 +112,8 @@ App image succesfully generated: /Users/paulfdietrich/dev/slinky/bin/stm32_slink
Build manifest: /Users/paulfdietrich/dev/slinky/bin/stm32_slinky/apps/slinky/manifest.json
```
+<br>
+
### Using newtmgr with a remote target
* First make sure the USB A-B type cable is connected to the ARM-USB-TINY-H debugger connector on the Olimex board.
@@ -119,8 +125,10 @@ $ newt load stm32_bootloader
$ 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.
-
+You can now disconnect the debugging cable from the board. You should see the green LED blinking. If not, try powercycling the board.
+
+<br>
+
* 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/](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](https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E407_sch.pdf) for reference.

@@ -130,6 +138,7 @@ $ newt load stm32_slinky
* 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.
+<br>
* Locate the serial connection established in the /dev directory of your computer. It should be of the type `tty.usbserial-<some identifier>`.
@@ -138,6 +147,8 @@ $ newt load stm32_slinky
/dev/tty.usbserial-AJ03HAQQ
```
+<br>
+
* 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`.
```no-highlight
@@ -151,6 +162,8 @@ $ newt load stm32_slinky
olimex01: type=serial, connstring='/dev/tty.usbserial-AJ03HAQQ'
```
+<br>
+
* 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.
```no-highlight