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 2015/11/10 08:35:43 UTC

[2/2] incubator-mynewt-site git commit: updating master with markdown docs for mkdocs

updating master with markdown docs for mkdocs


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

Branch: refs/heads/master
Commit: 50ce48b03c3731135db52be4a2b9696e1a67b21c
Parents: 6fd10fd
Author: aditihilbert <ad...@runtime.io>
Authored: Mon Nov 9 23:35:22 2015 -0800
Committer: aditihilbert <ad...@runtime.io>
Committed: Mon Nov 9 23:35:22 2015 -0800

----------------------------------------------------------------------
 docs/chapter1/newt_concepts.md       |  48 ++
 docs/chapter1/project1.md            | 934 ++++++++++++++++++++++++++++++
 docs/chapter2/project2.md            | 362 ++++++++++++
 docs/chapter2/project3.md            |   1 +
 docs/chapter2/vocabulary.md          | 170 ++++++
 docs/chapter3/newt_ops.md            |  40 ++
 docs/chapter3/newt_tool_reference.md | 269 +++++++++
 docs/chapter4/newt_os.md             |   0
 docs/chapter4/os_overview.md         |   0
 docs/chapter5/console.md             |   0
 docs/chapter5/mods.md                |   0
 docs/chapter6/dist.md                |   0
 docs/extra.css                       |   9 +
 docs/images/egg-logo.png             | Bin 0 -> 8626 bytes
 docs/index.md                        |  18 +
 images/asf_logo_wide.gif             | Bin 0 -> 7051 bytes
 images/egg-logo.png                  | Bin 0 -> 8626 bytes
 17 files changed, 1851 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/50ce48b0/docs/chapter1/newt_concepts.md
----------------------------------------------------------------------
diff --git a/docs/chapter1/newt_concepts.md b/docs/chapter1/newt_concepts.md
new file mode 100644
index 0000000..6ac28da
--- /dev/null
+++ b/docs/chapter1/newt_concepts.md
@@ -0,0 +1,48 @@
+## Newt Concepts
+
+This page introduces the basic terms you will need to find your way around the Mynewt ecosystem.
+
+### Basic components in the ecosystem
+
+* NewtOS is an open-source RTOS (Real Time Operating System) that works on a variety of hardware. The goal is to develop a pre-emptive, multitasking OS that is highly modular, making it possible to mix and match components to enable desired features and capabilities on multiple hardware architectures. Examples of components being worked on are the Core RTOS, a flash file system, utility functions, a variety of board support packages, packages of microcontrollers etc.
+
+
+* Network protocol stacks such as Bluetooth Low Energy, and more
+
+
+* Newt Tool helps you mix the specific packages for the combination of hardware and low-level embedded architecture features of the user's choice and generate the corresponding run-time image based on the NewtOS. It provides the infrastructure to manage and build for different CPU architectures, memory units, board support packages etc., allowing a user to formulate the contents according to the low-level features needed by his or her project.
+
+
+### Terminology
+
+A Mynewt user starts with a project in mind that defines the application or utility that he or she wants to implement on an embedded device. Making an LED blink on an electronics prototyping board is a common starter project. Enabling a BLE (Bluetooth Low Energy) peripheral mode on a development board is a more complex project. Specifying a project requires naming it, at the very least, and then adding the desired properties or attributes. In order to actualize a project, it needs to be applied to a target which is essentially a combination of some specified hardware and the execution environment. 
+
+In the mynewt lifecycle, a project grows in a nest. A nest may house multiple projects. The nest is, therefore, a repository where various component packages for one or more projects reside. Each package is an egg (naturally!). However, in the world of Mynewt an egg may consist of other eggs! For example, the starter project Blinky is an egg consisting of several constituent eggs that enable core features. The egg form is suitable for elemental units of code as it explicitly exposes characteristics such as dependencies, versions, capabilities, requirements etc., thus making assembling appropriate components for a project and building an image for it easy to follow, modular, and robust.
+
+A nest can be given any name. For example, you will see a nest named "tadpole" in Mynewt ([https://git-wip-us.apache.org/repos/asf?p=incubator-mynewt-tadpole.git](https://git-wip-us.apache.org/repos/asf?p=incubator-mynewt-tadpole.git)). It contains all the core libraries of the operating system for the native platform which currently supports compilation on Mac OS X. The core libraries are contained in the form of eggs where an egg is a basic unit of implementation of any aspect of the RTOS. The eggs are distributed in the following directory structure inside the nest:
+
+* libs: contains the two eggs `os` and `testutil`
+* hw: contains three eggs - (i) `hal` which has the abstraction layer (HAL) API definitions that all BSP and MCU implementations must support, (ii) `/mcu/native` which in an MCU implementation for the native platform (a simulator, in this case), and (iii) `bsp/native` which is a BSP implementation for the native platform 
+* compiler: contains the `sim` egg which bundles the compiler specifications for the native platform.
+
+Let's explore this sample nest a bit further. The `libs/os` egg contains code for scheduler, process/thread/memory management, semaphores etc. It is the core RTOS which ports to all supported chip platforms.The `libs/testutil` egg contains code for testing packages on hardware or simulated environment. The `hw/hal` egg contains header files that provide abstraction for physical hardware components such as GPIO (general purpose input/output), network adapters, timers, and UARTs. This `hw/hal` egg is an MCU peripheral abstraction designed to make it easy to port to different MCUs (microcontrollers). The `hw/mcu/native` egg contains code for microcontroller operations on the native platform. The `hw/bsp/native` egg contains the board support package for the native platform. And finally, the sixth egg `sim` contains the compiler specifications such as path and flags. Currently the compilation is supported on Mac OS X.
+
+You can see another nest in the mynewt ecosystem called the "larva". It was spawned from the skeletal "tadpole" nest using the newt tool. Spawning is easy - ` $ newt create nest <your_nest_name> `. "larva" is the developer's test repository containing all sorts of eggs being written and incubated, including ones to enhance the core operating system which should eventually make their way into the "tadpole" nest. There is a `hatch_tadpole` script to update the "tadpole" nest when the core OS related eggs in "larva" are ready.
+
+There is a third nest named "newt" that contains all the eggs needed to support the build and release process of mynewt software. In the future, there will also be pre-built nests for certain common hardware devices to enable a user to quickly get started with a project.
+
+
+### A Mynewt contributor
+
+A contributor can choose to work on any area(s) of the Mynewt endeavor that appeals to him or her. Hence, you can work on one or more eggs or an entire nest. You can create your own nest (master) or create a branch in an existing nest. For now, Runtime contributors will review any new areas of support that you may wish to introduce e.g. a new board support package (BSP) or a new network protocol. 
+
+A contributer role necessarily implies he or she is a Mynewt user (see below) of some or all of the products developed.
+
+### A Mynewt user 
+
+An application developer is interested only in using software available in this ecosystem to build a top level build artifact. He or she may either:
+
+* Use a pre-built nest, or
+* Spawn a new nest using the newt tool for a target where a target is a custom combination of supported hardware components
+
+In either case, the user would use the newt tool to create and set the target in the chosen nest. The newt tool would then be used to build out the target profile which would determine which eggs to choose. Finally, the user would use the newt tool to generate a run-time image that can be run on the device.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/50ce48b0/docs/chapter1/project1.md
----------------------------------------------------------------------
diff --git a/docs/chapter1/project1.md b/docs/chapter1/project1.md
new file mode 100644
index 0000000..100ce27
--- /dev/null
+++ b/docs/chapter1/project1.md
@@ -0,0 +1,934 @@
+## Blinky, the First Project
+
+### Objective
+
+We will show you how you can use eggs from a nest on Mynewt to make an LED on a target board blink. We will call it ** Project Blinky**. The goals of this tutorial are threefold:
+ 
+1. First, you will learn how to set up your environment to be ready to use Mynewt OS and newt tool. 
+2. Second, we will walk you through a download of eggs for building and testing [on a simulated target](#building-test-code-on-simulator) on a non-Windows machine.
+3. Third, you will download eggs and use tools to create a runtime image for a board to [make its LED blink](#making-an-led-blink). 
+
+If you want to explore even further, you can try to upload the image to the board's flash memory and have it [boot from flash](#using-flash-to-make-led-blink)!
+
+### What you need
+
+1. STM32-E407 development board from Olimex.
+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. Personal Computer
+
+The instructions assume the user is using a Bourne-compatible shell (e.g. bash or zsh) on your computer. You may already have some of the required packages on your machine.  In that 
+case, simply skip the corresponding installation step in the instructions under [Getting your Mac Ready](project1.md#getting-your-mac-ready) or [Getting your Ubuntu machine Ready](project1.md#getting-your-ubuntu-machine-ready) or [Getting your Windows machine Ready](#getting-your-windows-machine-ready). While the given instructions should work on other versions, they have been tested for the three specific releases of operating systems noted here:
+
+* Mac: OS X Yosemite Version 10.10.5
+* Linux: Ubuntu 14.10 (Utopic Unicorn)
+* Windows: Windows 10
+
+
+### Getting your Mac Ready
+
+#### Getting an account on GitHub
+
+* Get an account on GitHub. Make sure you have joined the "Newt Operating System" organization.
+
+#### Installing Homebrew to ease installs on OS X 
+
+* Do you have Homebrew? If not, open a terminal on your Mac and paste the following at a Terminal prompt. It will ask you for your sudo password.
+
+        $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+    Alternatively, you can just extract (or `git clone`) Homebrew and install it to `/usr/local`.
+
+#### Creating local repository 
+
+* The directory structure must be first readied for using Go. Go code must be kept inside a workspace. A workspace is a directory hierarchy with three directories at its root:
+
+    * src contains Go source files organized into packages (one package per directory),
+
+    * pkg contains package objects, and
+
+    * bin contains executable commands.
+
+    The GOPATH environment variable specifies the location of your workspace. First create a 'dev' directory and then a 'go' directory under it. Set the GOPATH environment variable to this directory and then proceed to create the directory for cloning the newt tool repository.
+
+        $ cd $HOME
+        $ mkdir -p dev/go  
+        $ cd dev/go
+        $ export GOPATH=`pwd`
+
+    Note that you need to add export statements to ~/.bash_profile to export variables permanently.
+        $ vi ~/.bash_profile
+
+* The next step is to set up the repository for the package building tool "newt" on your local machine. First create the appropriate directory for it and then clone the newt tool repository from the online apache repository (or its github.com mirror) into this newly created directory. Check the installation.
+
+        $ mkdir -p $GOPATH/src/github.com/mynewt  
+        $ cd $GOPATH/src/github.com/mynewt
+        $ git clone https://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git newt
+        $ ls
+        newt
+        $ cd newt
+        $ ls
+        Godeps                  README.md               coding_style.txt        newt.go
+        LICENSE                 cli                     design.txt
+
+#### Installing Go and Godep
+
+* Next you will use brew to install go. The summary message at the end of the installation should indicate that it is installed in the /usr/local/Cellar/go/ directory. You will use the go command 'install' to compile and install packages (called eggs in the Mynewt world) and dependencies. 
+    
+        $ brew install go
+        ==> 
+        ==> 
+        ==> *Summary*
+        🍺  /usr/local/Cellar/go/1.5.1: 5330 files, 273M
+        $ cd $GOPATH/src/github.com/mynewt/newt
+
+    Alternatively, you can download the go package directly from (https://golang.org/dl/) instead of brewing it. Install it in /usr/local directory.
+
+* Now you will get the godep package. Return to the go directory level and get godep. Check for it in the bin subdirectory. Add the go environment to path. Make sure it is added to your .bash_profile.
+
+        $ cd $GOPATH
+        $ go get github.com/tools/godep
+        $ ls
+        bin     pkg     src
+        $ ls bin
+        godep
+        $ export PATH=$PATH:$GOPATH/bin 
+
+* Use the go command 'install' to compile and install packages and dependencies. In preparation for the install, you may use the godep command 'restore' to check out listed dependency versions in $GOPATH and link all the necessary files. Note that you may have to go to the `~/dev/go/src/github.com/mynewt/newt` directory to successfully run the restore command (e.g. on certain distributions of Linux). You may also have to do a `go get` before the restore to make sure all the necessary packages and dependencies are correct.
+
+        $ cd ~/dev/go/src/github.com/mynewt/newt
+        $ go get
+        $ ~/dev/go/bin/godep restore
+        $ go install
+
+#### Building the Newt tool
+
+* You will now use go to run the newt.go program to build the newt tool. You will have to use `go build` command which compiles and writes the resulting executable to an output file named `newt`. However, it does not install the results along with its dependencies in $GOPATH/bin (for that you will need to use `go install`). Now try running newt using the compiled binary. For example, check for the version number by typing 'newt version'. See all the possible commands available to a user of newt by typing 'newt -h'.
+
+Note: If you are going to be be modifying the newt tool itself often and wish to compile the program every time you call it, you may want to store the command in a variable in your .bash_profile. So type in `export newt="go run $GOPATH/src/github.com/mynewt/newt/newt.go"` in your .bash_profile and execute it by calling `$newt` at the prompt instead of `newt`. Don't forget to reload the updated bash profile by typing `source ~/.bash_profile` at the prompt! Here, you use `go run` which runs the compiled binary directly without producing an executable.
+
+        $ go run %GOPATH%/src/github.com/mynewt/newt/newt.go
+        $ cd ~/dev/go/src/github.com/mynewt/newt
+        $ ls
+        Godeps			README.md		coding_style.txt	newt
+        LICENSE			cli			design.txt		newt.go
+        $ newt version
+        Newt version:  1.0
+        $ newt -h
+        Newt allows you to create your own embedded project based on the Mynewt
+        operating system. Newt provides both build and package management in a
+        single tool, which allows you to compose an embedded workspace, and set
+        of projects, and then build the necessary artifacts from those projects.
+        For more information on the Mynewt operating system, please visit
+        https://www.github.com/mynewt/documentation.
+
+        Please use the newt help command, and specify the name of the command
+        you want help for, for help on how to use a specific command
+
+        Usage:
+         newt [flags]
+         newt [command]
+
+        Examples:
+         newt
+         newt help [<command-name>]
+           For help on <command-name>.  If not specified, print this message.
+
+
+        Available Commands:
+         version     Display the Newt version number.
+         target      Set and view target information
+         egg         Commands to list and inspect eggs on a nest
+         nest        Commands to manage nests & clutches (remote egg repositories)
+         help        Help about any command
+
+        Flags:
+         -h, --help=false: help for newt
+         -l, --loglevel="WARN": Log level, defaults to WARN.
+         -q, --quiet=false: Be quiet; only display error output.
+         -s, --silent=false: Be silent; don't output anything.
+         -v, --verbose=false: Enable verbose output when executing commands.
+
+
+        Use "newt help [command]" for more information about a command.
+       
+* Without creating a project repository you can't do a whole lot with the Newt tool. So you'll have to wait till you have downloaded a nest to try out the tool. 
+
+#### Getting the debugger ready
+
+* Before you start building nests and hatching eggs, you need to do one final step in the environment preparation - install gcc / libc that can produce 32-bit executables. So, first install gcc. You will see the brew steps and a final summary confirming install.
+
+        $ brew install gcc
+        ...
+        ...
+        ==> Summary
+        🍺  /usr/local/Cellar/gcc/5.2.0: 1353 files, 248M
+
+
+* ARM maintains a pre-built GNU toolchain with a GCC source branch targeted at Embedded ARM Processors namely Cortex-R/Cortex-M processor families. Install the PX4 Toolchain and check the version installed. Make sure that the symbolic link installed by Homebrew points to the correct version of the debugger. If not, you can either change the symbolic link using the "ln -f -s" command or just go ahead and try with the version it points to!
+
+        $ brew tap PX4/homebrew-px4
+        $ brew update
+        $ brew install gcc-arm-none-eabi-49
+        $ arm-none-eabi-gcc --version  
+        arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288]
+        Copyright (C) 2014 Free Software Foundation, Inc.
+        This is free software; see the source for copying conditions.  There is NO
+        warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+        $ ls -al /usr/local/bin/arm-none-eabi-gdb
+        lrwxr-xr-x  1 aditihilbert  admin  69 Sep 22 17:16 /usr/local/bin/arm-none-eabi-gdb -> /usr/local/Cellar/gcc-arm-none-eabi-49/20150609/bin/arm-none-eabi-gdb
+
+    Note: If no version is specified, brew will install the latest version available. StackOS will eventually work with multiple versions available including the latest releases. However, at present we have tested only with this version and recommend it for getting started. 
+    
+* You have to install OpenOCD (Open On-Chip Debugger) which is an open-source software that will allow you to interface with the JTAG debug connector/adaptor for the Olimex board. It lets you program, debug, and test embedded target devices which, in this case, is the Olimex board. Use brew to install it. Brew adds a simlink /usr/local/bin/openocd to the openocd directory in the Cellar.
+
+        $ brew install open-ocd
+        $ which openocd
+        /usr/local/bin/openocd
+        $ ls -l $(which openocd)
+        lrwxr-xr-x  1 <user>  admin  36 Sep 17 16:22 /usr/local/bin/openocd -> ../Cellar/open-ocd/0.9.0/bin/openocd
+
+* Proceed to the [Building test code on simulator](#building-test-code-on-simulator) section.
+
+
+### Getting your Ubuntu machine Ready 
+
+#### Getting an account on GitHub
+
+* Get an account on GitHub. Make sure you have joined the "Newt Operating System" organization.
+
+#### Installing some prerequisites
+
+* Install git, libcurl, and the go language if you do not have them already.
+
+        $ sudo apt-get install git 
+        $ sudo apt-get install libcurl4-gnutls-dev 
+        $ sudo apt-get install golang 
+        
+#### Creating local repository 
+
+* The directory structure must be first readied for using Go. Go code must be kept inside a workspace. A workspace is a directory hierarchy with three directories at its root:
+
+    * src contains Go source files organized into packages (one package per directory),
+
+    * pkg contains package objects, and
+
+    * bin contains executable commands.
+
+    The GOPATH environment variable specifies the location of your workspace. First create a 'dev' directory and then a 'go' directory under it. Set the GOPATH environment variable to this directory and then proceed to create the directory for cloning the newt tool repository.
+
+        $ cd $HOME
+        $ mkdir -p dev/go  
+        $ cd dev/go
+        $ export GOPATH=$PWD
+
+    Note that you need to add export statements to ~/.bashrc (or equivalent) to export variables permanently.
+
+* Next, install godep. Note that the following command produces no output.
+
+        $ go get github.com/tools/godep 
+
+* Set up the repository for the package building tool "newt" on your local machine. First create the appropriate directory for it and then clone the newt tool repository from the online apache repository (or its github.com mirror) into this newly created directory. Check the contents of the directory.
+
+        $ mkdir -p $GOPATH/src/github.com/mynewt  
+        $ cd $GOPATH/src/github.com/mynewt
+        $ git clone https://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git newt
+        $ ls
+        newt
+        $ cd newt
+        $ ls
+        Godeps                  README.md               coding_style.txt        newt.go
+        LICENSE                 cli                     design.txt
+
+* Use the go command 'install' to compile and install packages and dependencies. Add go environment to path. Again, to make the export variable permanent, add it to your ~/.bashrc (or equivalent) file.
+
+        $ $GOPATH/bin/godep restore 
+        $ go get 
+        $ go install 
+        $ export PATH=$PATH:$GOPATH/bin
+
+#### Building the newt tool
+
+* You will now use go to run the newt.go program to build the newt tool. You will have to use `go build` command which compiles and writes the resulting executable to an output file named `newt`. However, it does not install the results along with its dependencies in $GOPATH/bin (for that you will need to use `go install`). Now try running newt using the compiled binary. For example, check for the version number by typing 'newt version'. See all the possible commands available to a user of newt by typing 'newt -h'.
+
+Note: If you are going to be be modifying the newt tool itself often and wish to compile the program every time you call it, you may want to store the command in a variable in your .bash_profile. So type in `export newt="go run $GOPATH/src/github.com/mynewt/newt/newt.go"` in your ~/.bashrc (or equivalent) and execute it by calling `$newt` at the prompt instead of `newt`. Here, you use `go run` which runs the compiled binary directly without producing an executable.
+
+        $ go build %GOPATH%/src/github.com/mynewt/newt/newt.go
+        $ cd ~/dev/go/src/github.com/mynewt/newt
+        $ ls
+        Godeps			README.md		coding_style.txt	newt
+        LICENSE			cli			design.txt		newt.go
+        $ newt version
+        Newt version:  1.0
+        $ newt -h
+        Newt allows you to create your own embedded project based on the Mynewt
+        operating system. Newt provides both build and package management in a
+        single tool, which allows you to compose an embedded workspace, and set
+        of projects, and then build the necessary artifacts from those projects.
+        For more information on the Mynewt operating system, please visit
+        https://www.github.com/mynewt/documentation.
+
+        Please use the newt help command, and specify the name of the command
+        you want help for, for help on how to use a specific command
+
+        Usage:
+         newt [flags]
+         newt [command]
+
+        Examples:
+         newt
+         newt help [<command-name>]
+           For help on <command-name>.  If not specified, print this message.
+
+
+        Available Commands:
+         version     Display the Newt version number.
+         target      Set and view target information
+         egg         Commands to list and inspect eggs on a nest
+         nest        Commands to manage nests & clutches (remote egg repositories)
+         help        Help about any command
+
+        Flags:
+         -h, --help=false: help for newt
+         -l, --loglevel="WARN": Log level, defaults to WARN.
+         -q, --quiet=false: Be quiet; only display error output.
+         -s, --silent=false: Be silent; don't output anything.
+         -v, --verbose=false: Enable verbose output when executing commands.
+
+
+        Use "newt help [command]" for more information about a command.
+        
+* Without creating a project repository you can't do a whole lot with the Newt tool. So you'll have to wait till you have downloaded a nest to try out the tool. 
+
+#### Getting the debugger ready
+
+* Before you start building nests and hatching eggs, you need to do one final step in the environment preparation - install gcc / libc that can produce 32-bit executables. You can install these as follows: 
+
+        $ sudo apt-get install gcc-multilib libc6-i386
+        
+* For the LED project on the Olimex hardware, you have to install gcc for AM 4.9.3.  This package can be installed with apt-get as documented [here](https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded).
+
+        $ sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi 
+        $ sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded 
+        $ sudo apt-get update 
+        $ sudo apt-get install gcc-arm-none-eabi
+
+* And finally, you have to install OpenOCD (Open On-Chip Debugger) which is an open-source software that will allow you to interface with the JTAG debug connector/adaptor for the Olimex board. It lets you program, debug, and test embedded target devices which, in this case, is the Olimex board. You have to acquire OpenOCD 0.8.0. 
+
+    If you are running Ubuntu 15.x, then you are in luck and you can simply run: 
+
+        $ sudo apt-get install openocd 
+
+    Other versions of Ubuntu may not have the correct version of openocd available.  In this case, you should download the openocd 0.8.0 package from [https://launchpad.net/ubuntu/vivid/+source/openocd](https://launchpad.net/ubuntu/vivid/+source/openocd). The direct link to the amd64 build is [http://launchpadlibrarian.net/188260097/openocd_0.8.0-4_amd64.deb](http://launchpadlibrarian.net/188260097/openocd_0.8.0-4_amd64.deb). 
+
+* Proceed to the [Building test code on simulator](#building-test-code-on-simulator) section.
+
+### Getting your Windows machine Ready
+
+
+#### Getting an account on GitHub
+
+* Get an account on GitHub. Make sure you have joined the "Newt Operating System" organization.
+
+#### Installing some prerequisites
+
+* You have to install the following if you do not have them already.  The steps below indicate specific folders where each of these programs should be installed. You can choose different locations, but the remainder of this
+tutorial for a Windows machine assumes the specified folders.    
+
+    * win-builds-i686
+    * win-builds-x86_64
+    * MSYS
+    * gcc for ARM
+    * openocd
+    * zadig
+    * git
+    * go
+
+        - *win-builds (mingw64) 1.5 for i686*
+        
+        Download from [http://win-builds.org/doku.php/download_and_installation_from_windows](http://win-builds.org/doku.php/download_and_installation_from_windows). Install at: "C:\win-builds-i686".
+        
+        Be sure to click the i686 option (not x86_64). The defaults for all other options are OK. The installer will want to download a bunch of additional packages. They are not all necessary, but it is simplest to just accept the defaults.
+
+        - *win-builds (mingw64) 1.5 for x86_64*
+        
+        Download from [http://win-builds.org/doku.php/download_and_installation_from_windows](http://win-builds.org/doku.php/download_and_installation_from_windows). Install at "C:\win-builds-x86_64"
+        
+        Run the installer a second time, but this time click the x86_64 option, NOT i686.  The defaults for all other options are OK.
+        
+        - *MSYS*
+        
+        Start your download from [http://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/MSYS-20111123.zip](http://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/MSYS-20111123.zip)
+        
+        Unzip to "C:\msys"
+        
+        - *gcc for ARM, 4.9.3*
+        
+        Download the Windows installer from [https://launchpad.net/gcc-arm-embedded/+download](https://launchpad.net/gcc-arm-embedded/+download) and install at "C:\Program Files (x86)\GNU Tools ARM Embedded\4.9 2015q3".
+
+        - OpenOCD 0.8.0
+        
+        Download OpenOCD 0.8.0 from [http://www.freddiechopin.info/en/download/category/4-openocd](http://www.freddiechopin.info/en/download/category/4-openocd). Unzip to "C:\openocd".
+        
+        - Zadig 2.1.2
+        
+        Download it from [http://zadig.akeo.ie](http://zadig.akeo.ie) and install it at "C:\zadig".
+        
+        - Git
+        
+        Click on [https://git-scm.com/download/win](https://git-scm.com/download/win) to start the download. Install at "C:\Program Files (x86)\Git". Specify the "Use Git from the Windows Command Prompt" option.  The defaults for all other options are OK.
+        
+        - Go
+        
+        Download the release for Microsoft Windows from [https://golang.org/dl/](https://golang.org/dl/) and install it "C:\Go".
+    
+        
+#### Creating local repository 
+
+* The directory structure must be first readied for using Go. Go code must be kept inside a workspace. A workspace is a directory hierarchy with three directories at its root:
+
+    * src contains Go source files organized into packages (one package per directory),
+
+    * pkg contains package objects, and
+
+    * bin contains executable commands.
+
+    The GOPATH environment variable specifies the location of your workspace. First create a 'dev' directory and then a 'go' directory under it. Set the GOPATH environment variable to this directory and then proceed to create the directory for cloning the newt tool repository.
+
+        $ cd c:\
+        $ mkdir dev\go
+        $ cd dev\go
+
+* Set the following user environment variables using the steps outlined here.
+
+    * GOPATH: C:\dev\go
+    * PATH: C:\Program Files (x86)\GNU Tools ARM Embedded\4.9 2015q3\bin;%GOPATH%\bin;C:\win-builds-x86_64\bin;C:\win-builds-i686\bin;C:\msys\bin
+    
+    Steps:
+    
+       1. Right-click the start button
+       2. Click "Control panel"
+       3. Click "System and Security"
+       4. Click "System"
+       5. Click "Advanced system settings" in the left panel
+       6. Click the "Envoronment Variables..." button
+       7. There will be two sets of environment variables: user variables
+      in the upper half of the screen, and system variables in the lower
+      half.  Configuring the user variables is recommended and tested 
+      (though system variables will work as well).
+
+ 
+* Next, install godep. Note that the following command produces no output.
+
+        $ go get github.com/tools/godep 
+
+* Set up the repository for the package building tool "newt" on your local machine. First create the appropriate directory for it and then clone the newt tool repository from the online apache repository (or its github.com mirror) into this newly created directory. Check the contents of the directory.
+
+        $ mkdir %GOPATH%\src\github.com\mynewt
+        $ cd %GOPATH%\src\github.com\mynewt
+        $ git clone https://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git newt
+        $ ls
+        newt
+        $ cd newt
+        $ ls
+        Godeps                  README.md               coding_style.txt        newt.go
+        LICENSE                 cli                     design.txt
+
+* Use the go command 'install' to compile and install packages and dependencies. Add go environment to path. Again, to make the export variable permanent, add it to your ~/.bashrc (or equivalent) file.
+
+        $ %GOPATH%\bin\godep restore 
+        $ go get 
+        $ go install 
+
+#### Building the newt tool
+
+* You will now use go to run the newt.go program to build the newt tool. You will have to use `go build` command which compiles and writes the resulting executable to an output file named `newt`. However, it does not install the results along with its dependencies in $GOPATH/bin (for that you will need to use `go install`). Now try running newt using the compiled binary. For example, check for the version number by typing 'newt version'. See all the possible commands available to a user of newt by typing 'newt -h'.
+
+    Note: If you are going to be be modifying the newt tool itself often and wish to compile the program every time you call it, you may want to define the newt environment variable that allows you to execute the command via `%newt%`. Use `set newt=go run %GOPATH%\src\github.com\mynewt\newt\newt.go` or set it from the GUI. Here, you use `go run` which runs the compiled binary directly without producing an executable.
+
+        $ go build %GOPATH%\src\github.com\mynewt\newt\newt.go
+        $ cd ~/dev/go/src/github.com/mynewt/newt
+        $ dir
+        Godeps			README.md		coding_style.txt	newt
+        LICENSE			cli			design.txt		newt.go
+        $ newt version
+        Newt version:  1.0
+        $ newt -h
+        Newt allows you to create your own embedded project based on the Mynewt
+        operating system. Newt provides both build and package management in a
+        single tool, which allows you to compose an embedded workspace, and set
+        of projects, and then build the necessary artifacts from those projects.
+        For more information on the Mynewt operating system, please visit
+        https://www.github.com/mynewt/documentation.
+
+        Please use the newt help command, and specify the name of the command
+        you want help for, for help on how to use a specific command
+
+        Usage:
+         newt [flags]
+         newt [command]
+
+        Examples:
+         newt
+         newt help [<command-name>]
+           For help on <command-name>.  If not specified, print this message.
+
+
+        Available Commands:
+         version     Display the Newt version number.
+         target      Set and view target information
+         egg         Commands to list and inspect eggs on a nest
+         nest        Commands to manage nests & clutches (remote egg repositories)
+         help        Help about any command
+
+        Flags:
+         -h, --help=false: help for newt
+         -l, --loglevel="WARN": Log level, defaults to WARN.
+         -q, --quiet=false: Be quiet; only display error output.
+         -s, --silent=false: Be silent; don't output anything.
+         -v, --verbose=false: Enable verbose output when executing commands.
+
+
+        Use "newt help [command]" for more information about a command.
+        
+* Without creating a project repository you can't do a whole lot with the Newt tool. So you'll have to wait till you have downloaded a nest to try out the tool. 
+
+#### Getting the debugger ready
+
+* Use Zadig to configure the USB driver for your Olimex debugger.  If your debugger is already set up, you can skip this step.
+
+    1. Plug in your Olimex debugger.
+    2. Start Zadig.
+    3. Check the Options -> List All Devices checkbox.
+    4. Select "Olimex OpenOCD JTAG ARM-USB-TINY-H" in the dropdown menu.
+    5. Select the "WinUSB" driver.
+    6. Click the "Install Driver" button.
+
+#### Proceed to the [Building test code on simulator on Windows machine](#building-test-code-on-simulator) section.
+
+Note: Currently, the simulator cannot be run in the Windows machine. We are still working on it. So you will go ahead and [make an LED blink](#making-an-led-blink) on the Olimex hardware directly. 
+
+However, before you skip to the hardware target, you still need to build your first nest as outlined in step 1 in the [Building test code on simulator](#building-test-code-on-simulator).
+
+
+### Building test code on simulator 
+
+Note: Currently, the simulator cannot be run in the Windows machine. We are working on it. If you are on a Windows machine, do step 1 below and then proceed to the [Making an LED blink](#making-an-led-blink) on the Olimex hardware directly.
+
+1.  First, you have to create a repository for the project i.e. build your first nest! Go to ~/dev and clone the larva repository from the apache git repository into a local directory named `larva`.
+
+    Substitute DOS commands for Unix commands as necessary in the following steps if your machine is running Windows. The newt tool commands do not change.
+
+ 
+        $ cd ~/dev 
+        $ git clone https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva.git larva
+        $ ls
+        go	larva
+        $ cd larva
+        $ ls
+        LICENSE		clutch.yml	hw		nest.yml      project
+        README.md	compiler	libs		net	      scripts
+
+2. You will now create a new target using the newt tool. You can either use the compiled binary `newt` or run the newt.go program using `$newt` (assuming you have stored the command in a variable in your .bash_profile or .bashrc). When you do a `newt target show` or `$newt target show` it should list all the projects you have created so far. 
+
+        $ newt target create sim_test
+        Creating target sim_test
+        Target sim_test sucessfully created!
+        $ newt target show
+        sim_test
+	        name: sim_test
+	        arch: sim
+
+3. Now continue to populate and build out the sim project.
+
+        $ newt target set sim_test project=test
+        Target sim_test successfully set project to test
+        $ newt target set sim_test compiler_def=debug
+        Target sim_test successfully set compiler_def to debug
+        $ newt target set sim_test bsp=hw/bsp/native
+        Target sim_test successfully set bsp to hw/bsp/native
+        $ newt target set sim_test compiler=sim
+        Target sim_test successfully set compiler to sim
+        $ newt target show sim_test
+        sim_test
+	        arch: sim
+	        project: test
+	        compiler_def: debug
+	        bsp: hw/bsp/native
+	        compiler: sim
+	        name: sim_test
+
+4. Configure newt to use the gnu build tools native to OS X or linux. In order for sim to work properly, it needs to be using 32-bit gcc (gcc-5). Replace 
+~/dev/larva/compiler/sim/compiler.yml with the compiler/sim/osx-compiler.yml or linux-compiler.yml file, depending on the system. 
+
+    For a Mac OS X environment:
+
+        $ cp compiler/sim/osx-compiler.yml compiler/sim/compiler.yml 
+        
+    For a Linux machine:
+        
+        $ cp compiler/sim/linux-compiler.yml compiler/sim/compiler.yml
+
+5. Next, create (hatch!) the eggs for this project using the newt tool - basically, build the packages for it. You can specify the VERBOSE option if you want to see the gory details. 
+
+        $ $newt target build sim_test
+        Successfully run!
+
+    You can specify the VERBOSE option if you want to see the gory details.
+
+        $newt -l VERBOSE target build sim_test
+        2015/09/29 09:46:12 [INFO] Building project test
+        2015/09/29 09:46:12 [INFO] Loading Package /Users/aditihilbert/dev/larva/libs//bootutil...
+        2015/09/29 09:46:12 [INFO] Loading Package /Users/aditihilbert/dev/larva/libs//cmsis-core...
+        2015/09/29 09:46:12 [INFO] Loading Package /Users/aditihilbert/dev/larva/libs//ffs..
+        ...
+        Successfully run!
+
+6. Try running the test suite executable inside this project and enjoy your first successful hatch.
+
+        $ ./project/test/bin/sim_test/test.elf
+        [pass] os_mempool_test_suite/os_mempool_test_case
+        [pass] os_mutex_test_suite/os_mutex_test_basic
+        [pass] os_mutex_test_suite/os_mutex_test_case_1
+        [pass] os_mutex_test_suite/os_mutex_test_case_2
+        [pass] os_sem_test_suite/os_sem_test_basic
+        [pass] os_sem_test_suite/os_sem_test_case_1
+        [pass] os_sem_test_suite/os_sem_test_case_2
+        [pass] os_sem_test_suite/os_sem_test_case_3
+        [pass] os_sem_test_suite/os_sem_test_case_4
+        [pass] os_mbuf_test_suite/os_mbuf_test_case_1
+        [pass] os_mbuf_test_suite/os_mbuf_test_case_2
+        [pass] os_mbuf_test_suite/os_mbuf_test_case_3
+        [pass] gen_1_1/ffs_test_unlink
+        [pass] gen_1_1/ffs_test_rename
+        [pass] gen_1_1/ffs_test_truncate
+        [pass] gen_1_1/ffs_test_append
+        [pass] gen_1_1/ffs_test_read
+        [pass] gen_1_1/ffs_test_overwrite_one
+        [pass] gen_1_1/ffs_test_overwrite_two
+        [pass] gen_1_1/ffs_test_overwrite_three
+        ...
+        ...
+        [pass] boot_test_main/boot_test_vb_ns_11
+
+### Building test code on simulator on Windows machine
+
+Coming soon.
+
+### Making an LED blink
+
+#### Preparing the Software
+
+1. Make sure the PATH environment variable includes the $HOME/dev/go/bin directory (or C:\%GOPATH%\bin on Windows machine). 
+
+    Substitute DOS commands for Unix commands as necessary in the following steps if your machine is running Windows. The newt tool commands do not change.
+
+
+2. You first have to create a repository for the project. Go to the ~dev/larva directory and build out a second project inside larva. The project name is "blinky", in keeping with the objective. Starting with the target name, you have to specify the different aspects of the project to pull the appropriate eggs and build the right package for the board. In this case that means setting the architecture (arch), compiler, board support package (bsp), project, and compiler mode.
+
+        $ newt target create blinky
+        Creating target blinky
+        Target blinky sucessfully created!
+        $ newt target set blinky arch=cortex_m4
+        Target blinky successfully set arch to arm
+        $ newt target set blinky compiler=arm-none-eabi-m4
+        Target blinky successfully set compiler to arm-none-eabi-m4
+        $ newt target set blinky project=blinky
+        Target blinky successfully set project to blinky
+        $ newt target set blinky compiler_def=debug
+        Target blinky successfully set compiler_def to debug
+        $ newt target set blinky bsp=hw/bsp/olimex_stm32-e407_devboard
+        Target blinky successfully set bsp to hw/bsp/olimex_stm32-e407_devboard
+        $ newt target show blinky
+        blinky
+	        compiler: arm-none-eabi-m4
+	        project: blinky
+	        compiler_def: debug
+	        bsp: hw/bsp/olimex_stm32-e407_devboard
+	        name: blinky
+	        arch: cortex_m4
+
+3. Now you have to build the image. The linker script within the `hw/bsp/olimex_stm32-e407_devboard` egg builds an image for flash memory by default. Therefore, you need to switch that script with `run_from_sram.ld` in order to get the egg to produce an image for SRAM. <font color="red"> We are working on making it easier to specify where the executable will be run from for a particular project and automatically choose the correct linker scripts and generate the appropriate image. It will be specified as a project identity e.g. bootloader, RAM, flash (default) and the target will build accordingly. </font>. 
+
+    Once the target is built, you can find the executable "blinky.elf" in the project directory at ~/dev/larva/project/blinky/bin/blinky. It's a good idea to take a little time to understand the directory structure.
+
+        $ cd ~/dev/larva/hw/bsp/olimex_stm32-e407_devboard
+        $ diff olimex_stm32-e407_devboard.ld run_from_sram.ld
+        $ cp run_from_sram.ld olimex_stm32-e407_devboard.ld
+        $ cd ~/dev/larva/project/blinky/bin/blinky
+        $ newt target build blinky
+        Building target blinky (project = blinky)
+        Compiling case.c
+        Compiling suite.c
+        ...
+        Successfully run!
+        $ ls
+        LICENSE		clutch.yml	hw		nest.yml	project
+        README.md	compiler	libs		net		scripts
+        $ cd project
+        $ ls
+        bin2img		bletest		blinky		boot		ffs2native	test
+        $ cd blinky
+        $ ls
+        bin		blinky.yml	egg.yml		src
+        $ cd bin
+        $ ls
+        blinky
+        $ cd blinky
+        $ ls
+        blinky.elf	blinky.elf.bin	blinky.elf.cmd	blinky.elf.lst	blinky.elf.map
+
+
+4. Check that you have all the scripts needed to get OpenOCD up and talking with the project's specific hardware. Check whether you already have the scripts in your `/usr/share/openocd/scripts/ ` directory as they may have been part of the openocd download. If yes, you are all set and can proceed to preparing the hardware. If not, continue with this step.
+
+    Currently, the following 5 files are required. They are likely to be packed into a .tar file and made available under mynewt on github.com. Unpack it in the blinky directory using `tar xvfz` command. Go into the openocd directory created and make sure that the gdb-8888.cfg file indicates the correct file ('blinky.elf' in this case) to load and its full path. Specifically, add 'load ~/dev/larva/project/main/bin/blink/main.elf' and 'symbol-file ~/larva/larva/project/main/bin/blink/main.elf' to this file. Alternatively, you could load these files from within the debugger (gdb) as explained later in the project when you connect to the board using openocd.   
+
+    * ocd-8888.cfg
+    * olimex-arm-usb-tiny-h-ftdi.cfg
+    * arm-gdb.cfg
+    * gdb-dev_test-8888.cfg
+    * stm32f4x.cfg  
+    
+    Check the arm-gdb.cfg file and see whether the executable you created in the previous step is specified as the file to be loaded to the board. You have the choice of specifying the target and load from within the gdb debugger (Section "Let's Go", Step 2) instead.
+    
+        $ cat gdb-8888.cfg
+        echo \n*** Set target charset ASCII\n
+        set target-charset ASCII
+        #set arm fallback-mode arm
+        #echo \n*** set arm fallback-mode arm ***\n
+        echo \n*** Connecting to OpenOCD over port #8888 ***\n
+        target remote localhost:8888
+        echo \n*** loading nic.out.elf ***\n
+        load ~/dev/larva/project/main/bin/blink/main.elf
+        symbol-file ~/dev/larva/project/main/bin/blink/main.elf 
+        #echo *** Set breakpoint and run to main() to sync with gdb ***\n
+        #b main
+        #continue
+        #delete 1
+
+        #set arm fallback-mode thumb
+        #echo \n*** set arm fallback-mode thumb ***\n\n
+
+
+    Note that an OpenOCD configuration script is available from Olimex for the STM32-E407 development board e.g. at [https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/stm32f4x.cfg](https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/stm32f4x.cfg), however getting it to work with different versions of OpenOCD and gcc could get tricky. [<span style="color:red">*This will be simplified eventually into a consolidated single action step instead of manual tweaks currently required*</span>]
+
+
+#### Preparing the hardware to boot from embedded SRAM
+
+1. Locate the boot jumpers on the board.
+![Alt Layout - Top View](pics/topview.png)
+![Alt Layout - Bottom View](pics/bottomview.png)
+
+2. B1_1/B1_0 and B0_1/B0_0 are PTH jumpers which can be moved relatively easy. Note that the markings on the board may not always be accurate. Always refer to the manual for the correct positioning of jumpers in case of doubt. The two jumpers must always be moved together – they are responsible for the boot mode if bootloader is present. The board can search for bootloader on three places – User Flash Memory, System Memory or the Embedded SRAM. We will configure it to boot from SRAM by jumpering B0_1 and B1_1.
+
+3. Connect USB-OTG#2 in the picture above to a USB port on your computer (or a powered USB hub to make sure there is enough power available to the board). 
+
+4. Connect the JTAG connector to the SWD/JTAG interface on the board. The other end of the cable should be connected to the USB port or hub of your computer.
+
+5. The red PWR LED should be lit. 
+
+#### Let's Go!
+
+1. Go into the openocd directory and start an OCD session. You should see some status messages are shown below. Check the value of the msp (main service pointer) register. If it is not 0x10010000 as indicated below, you will have to manually set it after you open the gdp tool to load the image on it (next step). Note the `-c "reset halt"` flag that tells it to halt after opening the session. It will now require a manual "continue" command from the GNU debugger in step 3. 
+
+        $ cd ~/dev/larva/project/blinky/bin/blinky/openocd
+        $ openocd -f olimex-arm-usb-tiny-h-ftdi.cfg -f ocd-8888.cfg -f stm32f4x.cfg -c "reset halt" 
+        Open On-Chip Debugger 0.8.0 (2015-09-22-18:21)
+        Licensed under GNU GPL v2
+        For bug reports, read
+	        http://openocd.sourceforge.net/doc/doxygen/bugs.html
+        Info : only one transport option; autoselect 'jtag'
+        adapter speed: 1000 kHz
+        adapter_nsrst_assert_width: 500
+        adapter_nsrst_delay: 100
+        jtag_ntrst_delay: 100
+        cortex_m reset_config sysresetreq
+        Info : clock speed 1000 kHz
+        Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
+        Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
+        Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
+        Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
+        Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
+        target state: halted
+        target halted due to debug-request, current mode: Thread 
+        xPSR: 0x01000000 pc: 0x2000053c msp: 0x10010000 
+        
+    If your scripts are in `/usr/share/openocd/scripts/ ` directory you may need to provide the full path information in the arguments.
+    
+        $ openocd -f /usr/share/openocd/scripts/interface/ftdi/olimex-arm-usb-tiny-h.cfg -f /usr/share/openocd/scripts/target/stm32f4x.cfg -c "gdb_port 8888; init; reset halt" 
+        
+    If you are on a Windows machine, connect to the board with openocd using the following:
+    
+        $ cd C:\openocd
+        $ bin\openocd-0.8.0.exe -f scripts\interface\ftdi\olimex-arm-usb-tiny-h.cfg -f scripts\target\stm32f4x.cfg -c "gdb_port 8888; init; reset halt"
+
+2. Open a new terminal window and run the GNU debugger for ARM. Specifying the script gdb-8888.cfg tells it what image to load. You should now have a (gdb) prompt inside the debugger.
+
+        $ cd ~/dev/larva/project/blinky/bin/blinky/openocd
+        $ arm-none-eabi-gdb -x gdb-8888.cfg 
+        GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
+        Copyright (C) 2014 Free Software Foundation, Inc.
+        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+        This is free software: you are free to change and redistribute it.
+        There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
+        and "show warranty" for details.
+        This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
+        Type "show configuration" for configuration details.
+        For bug reporting instructions, please see:
+        <http://www.gnu.org/software/gdb/bugs/>.
+        Find the GDB manual and other documentation resources online at:
+        <http://www.gnu.org/software/gdb/documentation/>.
+        For help, type "help".
+        Type "apropos word" to search for commands related to "word".
+         
+        *** Set target charset ASCII
+         
+        *** Connecting to OpenOCD over port #8888 ***
+        0x20000580 in ?? ()
+         
+        *** loading image ***
+        Loading section .text, size 0x65d4 lma 0x20000000
+        Loading section .ARM.extab, size 0x24 lma 0x200065dc
+        Loading section .ARM.exidx, size 0xd8 lma 0x20006600
+        Loading section .data, size 0x8f8 lma 0x200066d8
+        Start address 0x2000053c, load size 28624
+        Transfer rate: 78 KB/sec, 2862 bytes/write.
+        (gdb)
+        
+    Instead of the script, you could connect to the openocd process and tell the debugger what image to load from within gdb (which is 'blinky.elf' in this case). Below is an example input/output when doing it on a Windows machine. Note the forward slashes.
+    
+        C:\dev\larva>arm-none-eabi-gdb -q
+        (gdb) target remote localhost:8888
+        Remote debugging using localhost:8888
+        0xb064f054 in ?? ()
+        ...
+        (gdb) load C:/dev/larva/project/blinky/bin/blinky/blinky.elf
+        Loading section .text, size 0x6778 lma 0x20000000
+        Loading section .ARM.extab, size 0x18 lma 0x20006778
+        Loading section .ARM.exidx, size 0xc8 lma 0x20006790
+        Loading section .data, size 0x8f8 lma 0x20006858
+        Start address 0x20000528, load size 29008
+        Transfer rate: 72 KB/sec, 2900 bytes/write.
+        (gdb) symbol-file C:/dev/larva/project/blinky/bin/blinky/blinky.elf
+        Reading symbols from C:/dev/larva/project/blinky/bin/blinky/blinky.elf...done.
+    
+
+3. From within gdb check the registers. Set the msp register for the main stack pointer to the expected value as shown here. 
+    
+    Finally, hit `c` to continue... and your green LED should blink!
+
+        (gdb) info reg all
+         r0             0x0	0
+         r1             0x0	0
+         r2             0x0	0
+         r3             0x0	0
+         r4             0x0	0
+         r5             0x0	0
+         r6             0x0	0
+         r7             0x0	0
+         r8             0x0	0
+         r9             0x0	0
+         r10            0x0	0
+         r11            0x0	0
+         r12            0x0	0
+         sp             0x10010000	0x10010000
+         lr             0xffffffff	-1
+         pc             0x20000580	0x20000580 <Reset_Handler>
+         xPSR           0x1000000	16777216
+         msp            0x10010000	0x10010000
+         psp            0x0	0x0
+         primask        0x0	0
+         basepri        0x0	0
+         faultmask      0x0	0
+         control        0x0	0
+         (gdb) set $msp=0x10010000
+         (gdb) c
+         Continuing.
+         
+4. Voilà! The board's LED should be blinking at 1 Hz.
+
+### Using flash to make LED blink
+
+1. Configure the board to boot from flash by moving the two jumpers together to B0_0 and B1_0. 
+
+   You will have to reset the board once the image is uploaded to it.
+        
+2. By now you know that you have to build a new package that will run from flash. First, the olimex_stm32-e407_devboard.ld linker script which was previously made the same as run_from_sram.ld will now need the contents of run_from_flash.ld. Then the target has to be rebuilt. 
+
+        $ cd ~/dev/larva/hw/bsp/olimex_stm32-e407_devboard
+        $ diff olimex_stm32-e407_devboard.ld run_from_sram.ld
+        $ cp run_from_flash.ld olimex_stm32-e407_devboard.ld
+        $ cd ~/dev/larva/project/blinky/bin/blinky
+        $ newt target build blinky
+        
+        
+3. Go to the project directory and download the image to flash ... in a flash! 
+
+        $ cd ~/dev/larva/project/blinky/bin/blinky
+        $ newt target download blinky
+        Downloading with ~/dev/larva/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
+
+4. The LED should be blinking!
+
+5. But wait...let's double check that it is indeed booting from flash and making the LED blink from the image in flash. Pull the USB cable off the Olimex JTAG adaptor. The debug connection to the JTAG port is now severed. Next power off the Olimex board by pulling out the USB cable from the board. Wait for a couple of seconds and plug the USB cable back to the board. 
+
+    The LED light will start blinking again. Success!
+
+    Note #1: If you want to download the image to flash and a gdb session opened up, use `newt target debug blinky` instead of `newt target download blinky`.
+        
+        $ newt target debug blinky
+        Debugging with ~/dev/larva/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh blinky
+        Debugging ~/dev/larva/project/blinky/bin/blinky/blinky.elf
+        GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
+        Copyright (C) 2014 Free Software Foundation, Inc.
+        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+        This is free software: you are free to change and redistribute it.
+        There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
+        and "show warranty" for details.
+        This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
+        Type "show configuration" for configuration details.
+        For bug reporting instructions, please see:
+        <http://www.gnu.org/software/gdb/bugs/>.
+        Find the GDB manual and other documentation resources online at:
+        <http://www.gnu.org/software/gdb/documentation/>.
+        For help, type "help".
+        Type "apropos word" to search for commands related to "word"...
+        Reading symbols from /Users/aditihilbert/dev/larva/project/blinky/bin/blinky/blinky.elf...done.
+        Open On-Chip Debugger 0.8.0 (2015-09-22-18:21)
+        Licensed under GNU GPL v2
+        For bug reports, read
+	        http://openocd.sourceforge.net/doc/doxygen/bugs.html
+        Info : only one transport option; autoselect 'jtag'
+        adapter speed: 1000 kHz
+        adapter_nsrst_delay: 100
+        jtag_ntrst_delay: 100
+        Warn : target name is deprecated use: 'cortex_m'
+        DEPRECATED! use 'cortex_m' not 'cortex_m3'
+        cortex_m reset_config sysresetreq
+        Info : clock speed 1000 kHz
+        Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
+        Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
+        Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
+        Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
+        Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
+        target state: halted
+        target halted due to debug-request, current mode: Thread 
+        xPSR: 0x01000000 pc: 0x08000250 msp: 0x10010000
+        Info : accepting 'gdb' connection from 3333
+        Info : device id = 0x10036413
+        Info : flash size = 1024kbytes
+        Reset_Handler () at startup_STM32F40x.s:199
+        199	    ldr    r1, =__etext
+        (gdb)
+    
+    
+    Note #2: If you want to erase the flash and load the image again you may use the following commands from within gdb. `flash erase_sector 0 0 x` tells it to erase sectors 0 through x. When you ask it to display (in hex notation) the contents of the sector starting at location 'lma' you should therefore see all f's. The memory location 0x8000000 is the start or origin of the flash memory contents and is specified in the olimex_stm32-e407_devboard.ld linker script. The flash memory locations is specific to the processor.
+            
+        (gdb) monitor flash erase_sector 0 0 4
+        erased sectors 0 through 4 on flash bank 0 in 2.296712s
+        (gdb) x/32wx 0x8000000 
+        0x8000000 <__isr_vector>:	0xffffffff	0xffffffff 0xffffffff 0xffffffff 
+        0x8000010 <__isr_vector+16>:	0xffffffff 0xffffffff 0xffffffff 0xffffffff
+        ...
+        
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/50ce48b0/docs/chapter2/project2.md
----------------------------------------------------------------------
diff --git a/docs/chapter2/project2.md b/docs/chapter2/project2.md
new file mode 100644
index 0000000..a85fd03
--- /dev/null
+++ b/docs/chapter2/project2.md
@@ -0,0 +1,362 @@
+## Project 2 - Blinky on additional boards
+
+### Objective
+
+The goal of this tutorial is to download a generic firmware skeleton ("bootstrap image") that applies to any hardware and then throw in additional applicable eggs to generate a build for a specific board. 
+
+The following target hardware chips are covered:
+
+* [STM32F303VC MCU](#stm32f303vc-mcu) from STMicroelectronics
+* [nRF52 Series](#nrf52-series) from Nordic Semiconductors 
+
+
+### STM32F303VC MCU
+
+#### Hardware needed
+
+* Discovery kit with STM32F303VC MCU
+* Laptop running Mac OS
+
+
+#### Step by Step Instructions to build image
+
+* The first step is to download the generic skeleton of the project. The eggs installed are not hardware architecture specific.
+
+        [user:~/foo]$ newt nest create test_project
+        Downloading nest skeleton from https://www.github.com/mynewt/tadpole...   ok!
+        Nest test_project successfully created in ~/foo/test_project
+    
+        [user:~/foo]$ cd test_project/
+
+* Then, the clutch of eggs named larva is added from the nest (also named larva) on the github. This step simply downloads the clutch description file and does not actually install the eggs that constitute the clutch. The clutch description file (`clutch.yml`) will be used to check dependencies during the egg install to ensure completeness. It serves as a reference for all the eggs in the clutch that one can choose from and install.
+ 
+        [user:~/foo/test_project]$ newt nest add-clutch larva https://github.com/mynewt/larva
+        Downloading clutch.yml from https://github.com/mynewt/larva/master... ok!
+        Verifying clutch.yml format... ok!
+        Clutch larva successfully installed to Nest.
+
+* The next step is to install relevant eggs from the larva nest on github. The instructions assume that you know what application or project you are interested in (the blinky application, in this case), what hardware you are using (STM32F3DISCOVERY board, in this case) and hence, what board support package you need. 
+
+        [user:~/foo/test_projec]$ newt egg install project/blinky          
+        Downloading larva from https://github.com/mynewt/larva//master... ok!
+        Installing project/blinky
+        Installation was a success!
+    
+        [user:~/foo/test_project]$ newt egg install hw/bsp/stm32f3discovery
+        Downloading larva from https://github.com/mynewt/larva//master... ok!
+        Installing hw/bsp/stm32f3discovery
+        Installing hw/mcu/stm/stm32f3xx
+        Installing libs/cmsis-core
+        Installing compiler/arm-none-eabi-m4
+        Installation was a success!
+
+
+* It's time to create a target for the project and define the target attributes. 
+
+        [user:~/foo/test_project]$ newt target create blink_f3disc
+        Creating target blink_f3disc
+        Target blink_f3disc successfully created!
+
+        [user:~/foo/test_project]$ newt target set blink_f3disc project=blinky
+        Target blink_f3disc successfully set project to blinky
+
+        [user:~/foo/test_project]$ newt target set blink_f3disc bsp=hw/bsp/stm32f3discovery
+        Target blink_f3disc successfully set bsp to hw/bsp/stm32f3discovery
+
+        [marko@Markos-MacBook-Pro-2:~/foo/test_project]$ newt target set blink_f3disc compiler_def=debug
+        Target blink_f3disc successfully set compiler_def to debug
+
+        [user:~/foo/test_project]$ newt target set blink_f3disc compiler=arm-none-eabi-m4
+        Target blink_f3disc successfully set compiler to arm-none-eabi-m4
+        
+        [user:~/foo/test_project]$ newt target set blink_f3disc arch=cortex_m4
+        Target blink_f3disc successfully set arch to cortex_m4
+        
+        [user:~/foo/test_project]$ newt target show blink_f3disc
+        blink_f3disc
+	        arch: cortex_m4
+	        project: blinky
+	        bsp: hw/bsp/stm32f3discovery
+	        compiler_def: debug
+	        compiler: arm-none-eabi-m4
+	        name: blink_f3disc
+        
+* Finally, you get to build the target and generate an executable that can now be uploaded to the board via the JTAG port. You can go into the openocd directory and start an OCD session as you did in Project 1.
+        
+        [user:~/foo/test_project]$ newt target build         blink_f3disc
+        Building target blink_f3disc (project = blinky)
+        Compiling case.c
+        Compiling suite.c
+        Compiling testutil.c
+        Compiling testutil_arch_arm.c
+        Archiving libtestutil.a
+        Compiling os.c
+        Compiling os_callout.c
+        Compiling os_eventq.c
+        Compiling os_heap.c
+        Compiling os_mbuf.c
+        Compiling os_mempool.c
+        Compiling os_mutex.c
+        Compiling os_sanity.c
+        Compiling os_sched.c
+        Compiling os_sem.c
+        Compiling os_task.c
+        Compiling os_time.c
+        Compiling os_arch_arm.c
+        Assembling HAL_CM4.s
+        Assembling SVC_Table.s
+        Archiving libos.a
+        Compiling hal_gpio.c
+        Compiling stm32f3xx_hal_gpio.c
+        Archiving libstm32f3xx.a
+        Compiling cmsis_nvic.c
+        Compiling libc_stubs.c
+        Compiling os_bsp.c
+        Compiling sbrk.c
+        Compiling system_stm32f3xx.c
+        Assembling startup_stm32f303xc.s
+        Archiving libstm32f3discovery.a
+        Compiling main.c
+        Building project blinky
+        Linking blinky.elf
+        Successfully run!
+
+
+
+
+### nRF52 Series
+
+
+#### Hardware needed
+
+* nRF52 Development Kit
+* Laptop running Mac OS
+
+
+#### Step by Step Instructions to build image
+
+* The first step is to download the generic skeleton of the project. The eggs installed are not hardware architecture specific.
+
+        []user@~/dev]$ newt nest create nordic_blinky
+        Downloading nest skeleton from https://www.github.com/mynewt/tadpole... ok!
+        Nest nordic_blinky successfully created in ~dev/nordic_blinky
+        
+        user@~/dev$ cd nordic_blinky/
+
+
+* Then, the clutch of eggs named larva is added from the nest (also named larva) on the github. This step simply downloads the clutch description file and does not actually install the eggs that constitute the clutch. The clutch description file (`clutch.yml`) will be used to check dependencies during the egg install to ensure completeness. It serves as a reference for all the eggs in the clutch that one can choose from and install.
+ 
+        []user@~/dev/nordic_blinky]$ newt nest add-clutch larva https://github.com/mynewt/larva
+        Downloading clutch.yml from https://github.com/mynewt/larva/master... ok!
+        Verifying clutch.yml format...ok!
+        Clutch larva successfully installed to Nest.
+
+* The next step is to install relevant eggs from the larva nest on github. The instructions assume that you know what application or project you are interested in (the blinky application, in this case), what hardware you are using (STM32F3DISCOVERY board, in this case) and hence, what board support package you need. 
+
+        [user@~/dev/nordic_blinky]$ newt egg install project/blinky 
+        Downloading larva from https://github.com/mynewt/larva//master... ok!
+        Installing project/blinky
+        Installation was a success!
+
+    
+        [user@~/dev/nordic_blinky]$ newt egg install hw/bsp/nrf52pdk
+        Downloading larva from https://github.com/mynewt/larva//master... ok!
+        Installing hw/bsp/nrf52pdk
+        Installing hw/mcu/nordic/nrf52xxx
+        Installing libs/cmsis-core
+        Installing compiler/arm-none-eabi-m4
+        Installation was a success!
+
+
+* It's time to create a target for the project and define the target attributes. 
+
+        [user@~/dev/nordic_blinky]$ newt target create blink_nordic
+        Creating target blink_nordic
+        Target blink_nordic successfully created!
+        [user@~/dev/nordic_blinky]$ newt target set blink_nordic project=blinky
+        Target blink_nordic successfully set project to blinky
+        [user@~/dev/nordic_blinky]$ newt target set blink_nordic bsp=hw/bsp/nrf52pdk
+        Target blink_nordic successfully set bsp to hw/bsp/nrf52pdk
+        [user@~/dev/nordic_blinky]$ newt target set blink_nordic compiler_def=debug
+        Target blink_nordic successfully set compiler_def to debug
+        [user@~/dev/nordic_blinky]$ newt target set blink_nordic compiler=arm-none-eabi-m4
+        Target blink_nordic successfully set compiler to arm-none-eabi-m4
+        [user@~/dev/nordic_blinky]$ newt target set blink_nordic arch=cortex_m4
+        Target blink_nordic successfully set arch to cortex_m4
+        [user@~/dev/nordic_blinky]$ newt target show
+        blink_nordic
+        	compiler: arm-none-eabi-m4
+	    	name: blink_nordic
+	    	arch: cortex_m4
+	    	project: blinky
+	    	bsp: hw/bsp/nrf52pdk
+	    	compiler_def: debug
+
+        
+* Finally, you get to build the target and generate an executable that can now be uploaded to the board via the on-board SEGGER J-Link debugger. 
+
+        [user@~/dev/nordic_blinky]$ newt target build blink_nordic
+        Building target blink_nordic (project = blinky)
+        Compiling case.c
+        Compiling suite.c
+        Compiling testutil.c
+        Compiling testutil_arch_arm.c
+        Archiving libtestutil.a
+        Compiling os.c
+        Compiling os_callout.c
+        Compiling os_eventq.c
+        Compiling os_heap.c
+        Compiling os_mbuf.c
+        Compiling os_mempool.c
+        Compiling os_mutex.c
+        Compiling os_sanity.c
+        Compiling os_sched.c
+        Compiling os_sem.c
+        Compiling os_task.c
+        Compiling os_time.c
+        Compiling os_arch_arm.c
+        Assembling HAL_CM4.s
+        Assembling SVC_Table.s
+        Archiving libos.a
+        Compiling hal_cputime.c
+        Compiling hal_gpio.c
+        Compiling hal_uart.c
+        Archiving libnrf52xxx.a
+        Compiling cmsis_nvic.c
+        Compiling hal_bsp.c
+        Compiling libc_stubs.c
+        Compiling os_bsp.c
+        Compiling sbrk.c
+        Compiling system_nrf52.c
+        Assembling gcc_startup_nrf52.s
+        Archiving libnrf52pdk.a
+        Compiling main.c
+        Building project blinky
+        Linking blinky.elf
+        Successfully run!
+
+* In order to be able to communicate with the SEGGER J-Link debugger on the dev board, you have to download and install the J-Link GDB Server software on to your laptop. You may download the "Software and documentation pack for Mac OS X" from [https://www.segger.com/jlink-software.html](https://www.segger.com/jlink-software.html). The command line version of the server is used in the steps below. 
+
+* Open a new terminal and start a J-Link session.
+
+        [user@~/dev/nordic_blinky/project/blinky/bin]$ which JLinkGDBServer
+        /usr/local/bin/JLinkGDBServer
+        [user@~/dev/nordic_blinky/project/blinky/bin]$ JLinkGDBServer -if SWD
+        SEGGER J-Link GDB Server V5.02f Command Line Version
+
+        JLinkARM.dll V5.02f (DLL compiled Oct  2 2015 20:55:03)
+
+        -----GDB Server start settings-----
+        GDBInit file:                  none
+        GDB Server Listening port:     2331
+        SWO raw output listening port: 2332
+        Terminal I/O port:             2333
+        Accept remote connection:      yes
+        Generate logfile:              off
+        Verify download:               off
+        Init regs on start:            off
+        Silent mode:                   off
+        Single run mode:               off
+        Target connection timeout:     0 ms
+        ------J-Link related settings------
+        J-Link Host interface:         USB
+        J-Link script:                 none
+        J-Link settings file:          none
+        ------Target related settings------
+        Target device:                 unspecified
+        Target interface:              SWD
+        Target interface speed:        1000kHz
+        Target endian:                 little
+
+        Connecting to J-Link...
+        J-Link is connected.
+        Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Aug 28 2015 19:26:24
+        Hardware: V1.00
+        S/N: 682371959
+        Checking target voltage...
+        Target voltage: 3.30 V
+        Listening on TCP/IP port 2331
+        Connecting to target...Connected to target
+        Waiting for GDB connection...Connected to 127.0.0.1
+
+
+* You need a configuration file for the GDB session to be opened correctly and the image ("blinky.elf") you built for this target downloaded to flash. A sample config script is given below. Alternatively, you could choose to type each command at the gdb prompt.
+
+         [user@~/dev/nordic_blinky/project/blinky/bin/blink_nordic]$ cat jlink-gdb.cfg 
+         echo ***Setting up the environment for debugging gdb.***\n
+         set complaints 1
+         set prompt (gdb) 
+         set endian little
+         echo \n*** Set target charset ASCII\n
+         set target-charset ASCII
+         echo \n*** Connecting over port #2331 ***\n
+         target remote localhost:2331
+         echo \n*** Enable flash write and set device to nrf52 ***\n
+         monitor flash download=1
+         monitor flash device=nRF52
+         echo \n*** loading blinky.elf ***\n
+         load ~/dev/nordic_blinky/project/blinky/bin/blink_nordic/blinky.elf 
+         symbol-file ~/dev/nordic_blinky/project/blinky/bin/blink_nordic/blinky.elf
+         echo \n*** Resetting target ***\n
+         monitor reset
+         echo \n*** Halting target ***\n
+         monitor halt
+
+* Start the gdb session and monitor that it loads the image, resets the target, and halts for a command to continue. 
+
+        [user@~/dev/nordic_blinky/project/blinky/bin/blink_nordic]$ arm-none-eabi-gdb -x ~/dev/nordic_blinky/project/blinky/bin/blink_nordic/jlink-gdb.cfg
+        
+        GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
+        Copyright (C) 2014 Free Software Foundation, Inc.
+        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+        This is free software: you are free to change and redistribute it.
+        There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
+        and "show warranty" for details.
+        This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
+        Type "show configuration" for configuration details.
+        For bug reporting instructions, please see:
+        <http://www.gnu.org/software/gdb/bugs/>.
+        Find the GDB manual and other documentation resources online at:
+        <http://www.gnu.org/software/gdb/documentation/>.
+        For help, type "help".
+        Type "apropos word" to search for commands related to "word".
+        
+        ***Setting up the environment for debugging gdb.***
+        The target is assumed to be little endian
+
+        *** Set target charset ASCII
+
+        *** Connecting over port #2331 ***
+        0x00003c34 in ?? ()
+
+        *** Enable flash write and set device to nrf52 ***
+        Flash download enabled
+        Selecting device: nRF52
+
+        *** loading blinky.elf ***
+        Loading section .text, size 0x5c84 lma 0x0
+        Loading section .ARM.extab, size 0x24 lma 0x5c84
+        Loading section .ARM.exidx, size 0xd8 lma 0x5ca8
+        Loading section .data, size 0x8f8 lma 0x5d80
+        Start address 0x48c, load size 26232
+        Transfer rate: 12808 KB/sec, 2914 bytes/write.
+        During symbol reading, unexpected overlap between:
+         (A) section `.text' from `~/dev/nordic_blinky/project/blinky/bin/blink_nordic/blinky.elf' [0x0, 0x5c84)
+         (B) section `*COM*' from `~/dev/nordic_blinky/project/blinky/bin/blink_nordic/blinky.elf' [0x0, 0x0).
+        Will ignore section B.
+
+        *** Resetting target ***
+        Resetting target
+
+        *** Halting target ***
+
+* Type 'c' to continue. The LED on the board will start to blink. You will also see some activity in the terminal showing the open J-Link GDB server connection. The LED will continue to blink after you quit out of that connection.
+
+        (gdb) c
+        Continuing.
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/50ce48b0/docs/chapter2/project3.md
----------------------------------------------------------------------
diff --git a/docs/chapter2/project3.md b/docs/chapter2/project3.md
new file mode 100644
index 0000000..43e6a59
--- /dev/null
+++ b/docs/chapter2/project3.md
@@ -0,0 +1 @@
+## How to Test an Egg

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/50ce48b0/docs/chapter2/vocabulary.md
----------------------------------------------------------------------
diff --git a/docs/chapter2/vocabulary.md b/docs/chapter2/vocabulary.md
new file mode 100644
index 0000000..5e6b792
--- /dev/null
+++ b/docs/chapter2/vocabulary.md
@@ -0,0 +1,170 @@
+## Understanding Newt Terms
+
+### Nest
+
+The nest is the base directory of your embedded software. It is meant to be the workspace containing a logical collection of the source code for one or more of your projects. A nest can contain multiple projects, and reflect multiple end products. 
+
+As the base repository of your source code, the nest has a master branch and several other branches off it. You may choose any branch to nest on. Each project in your nest will typically consist of several [eggs](#egg). A project could be an egg itself as well. In addition to eggs, a local nest will contain additional items such as [target](#target) or build definitions, clutch description files, scripts etc.
+
+For example, a walk through the "larva" nest at [https://github.com/mynewt/larva.git](https://github.com/mynewt/larva.git) shows the following structure. The nest.yml file in the larva directory indicates that it is a nest. An egg will have the egg.yml file in it as shown below. By this nomenclature, each board support package for a particular chip is an egg, the API for the hardware abstraction layer is an egg, and so on. 
+
+```
+larva
+  |- nest.yml 
+  |- compiler
+        |- arm-none-eabi-m4
+        |- sim
+  |- hw (hardware)
+        |- bsp (board support package)
+                |- nrf52pdk (Nordic nRF52 series chip)
+                        |- egg.yml
+                        |- ...
+                |- olimex_stm32-e407_devboard (used in chapter1 project)
+                        |- egg.yml
+                        |- ...
+                |- stm32f3discovery (another board with stm32f3 mcu)
+                        |- egg.yml
+                        |- ...
+                |- yet another board
+                        |- egg.yml
+                        |- ...
+        |- hal (hardware abstraction layer APIs)
+                |- egg.yml
+                |- include
+                        |- hal_cputime.h
+                        |- hal_flash.h
+                        |- hal_gpio.h
+                        |- ... (header files for other peripherals)
+        |- mcu (microcontroller)
+                |- stm (STMicro family)
+                    |- stm32f3xx (STM32f3 series, 32-bit ARM Cortex-M4  core)
+                        |- egg.yml
+                        |- src
+                            |- hal_gpio.c (specific to the STM32f3 mcu)
+                            |- hal_cputime.c
+                            |- ... (code for other peripherals)
+                |- nordic (Nordic Semiconductor family)
+                    |- nrf52xxx (nRF52 Series SoC, Cortex-M4F core)
+                        |- egg.yml
+                        |- src
+                            |- hal_gpio.c (specific to the nRF52 mcu )
+                            |- hal_cputime.c
+                            |- ... (code for other peripherals)
+                |- yet another family of mcu
+                    |- ...
+  |- libs
+        |- bootutil (hw architecture independent boot loader library)
+                |- egg.yml
+                |- src
+                    |- loader.c
+                    |- ... (related source code files)
+        |- nffs (hw architecture independent Newtron Flash File System)
+                |- egg.yml
+                |- src
+                    |- nffs.c
+                    |- ... (related source code files)
+        |- another library 
+                |- egg.yml
+                |- src
+                    |- ... (related source code files)
+  |- project
+  |- scripts
+
+
+```
+
+The newt tool offers the `nest` command to create and manage nests. In general, commands represent actions and flags are modifiers for those actions. A command can have children commands and optionally run an action. A full description of the `nest` command can be found in the newt tool reference in Chapter 3.
+
+    newt nest [flags]
+    newt nest [child-commands] 
+
+A complete list of all the nest commands can be found in the newt tool reference in [Chapter 3](../chapter3/newt_tool_reference.md).
+
+### Project
+
+Projects represent the individual build configurations of your embedded system and essentially defines your application. The project files are what dictate the resulting binary that is generated. 
+
+Layout-wise, a project is a directory inside a nest and contains eggs required for a certain application. For example, the `blinky` egg sits in `project/blinky` directory of the `larva` nest. This egg is used in the blinky project (application) outlined in [Chapter 1](../chapter1/project1.md). <*Note: This Will Change*>
+
+A project has the following concepts or properties associated with it. You can find them in the `<project-name>.yml` file in the project directory. For example, the `project/blinky` directory has the `blinky.yml` file indicating some or all of the properties below. Only the name of a project is required for the project to exist, however additional properties may need to be specified for the eggs in it to compile properly and produce an executable. 
+
+* Project name
+* Base path of the project (nest/project/project-name by default)
+* Eggs belonging to the project
+* [Capabilities](#capabilities) that are required for the project or target 
+* [Identity](#identity) to classify the type of project or target
+* Compiler flags to call out any specific compiler requirement
+
+A project could itself be an egg if it is a distributable package for a specific application. 
+
+The newt tool offers various commands that you can use with a project. For example, if your project is an egg, you can use the following command to install a project from a nest.
+
+    newt egg install [flags] <project egg name>
+
+### Egg
+
+An egg is a distributable package of libraries. Just as an egg in nature has various parts each of which serves a certain purpose, the Mynewt egg consists of software parcels or modules that have different functions. However, unlike the egg in nature these software modules can exist by itself and may be distributed; therefore, they too are essentially eggs. Once this concept is grasped it is easy to see how an egg may consist of other eggs.
+
+The two main directories in an egg are `/include` and `/src`.
+
+The newt tool offers several egg commands to list, inspect, install, and do other operations on eggs. For example, the following command
+
+    newt egg list 
+    
+outputs all the eggs in the current nest where each egg has details on its version, path, and dependencies. A sample output for an egg is given below.
+
+    Egg libs/os, version 0.1.0
+    path: /Users/aditihilbert/dev/test_project/libs/os
+    deps: libs/testutil@none#stable 
+
+A complete list of all the egg commands can be found in the newt tool reference in [Chapter 3](../chapter3/newt_tool_reference.md).
+
+### Clutch
+
+A clutch is a snapshot of all eggs in a remote nest at any point in time. On any given github branch, a nest with a clutch of eggs will contain a `clutch.yml` file that specifies the version number, dependencies, and hash value for each constituent egg as well as the name of the entire clutch and the github url for it. [Note: Currently ]
+
+You may download multiple clutches into your local nest as long as the names of the clutches are different. This allows you to mix and match various features and functionality coming from different clutches of eggs. You can see all the clutches in the `.nest/clutches` directory in your nest.
+
+The newt tool offers clutch management commands within the `newt nest` command. For example, the following command creates a new clutch using all the eggs in the current directory. It requires that a clutch name be specified and the url for the location of that clutch in the online repository. These two inputs go into the `clutch.yml` file in the nest.
+
+    newt nest generate-clutch <name> <url>
+
+Note that a clutch merely defines the eggs belonging together and requires the eggs to be installed (hatched) for the source code to be populated in the project. 
+
+### Eggshell
+
+The term eggshell is used to refer to the eggs of a clutch in a remote repository. They are not useful on your local machine until you actually install them. So they are mere shells of themselves while sitting on the online repository. When you enter the following command outputs the total number of shells in each remote clutch.
+
+    newt nest list-clutches
+    
+So, if you had two clutches installed, the output could be:
+
+    Remote clutch larva (eggshells: 19)
+    Remote clutch ble_test (eggshells: 15)
+    
+### Target
+
+A target is the hardware build or its software equivalent (e.g. test, simulator) set for a project. It tells the newt tool how to build the source code within a given nest. Once a new target is created, its architecture and other details needs to be defined. An example of a defined target named "blink_f3disc" is given below.
+ 
+    blink_f3disc
+	         compiler_def: debug
+	         compiler: arm-none-eabi-m4
+	         name: blink_f3disc
+	         arch: cortex_m4
+	         project: blinky
+	         bsp: hw/bsp/stm32f3discovery
+ 
+The newt tool offers commands to create, set up and manipulate targets. For example, the create command below creates an empty target named `my_target1` and the set command sets one detail of its definition, namely the architecture.
+
+    newt target create my_target1
+    newt target set my_target1 arch=cortex_m4
+
+### Capability
+
+Capability is functionality that is exposed by an egg. A capability is tracked by its name and version. An egg may require capabilities exposed by another egg, thus establishing a dependency tracked through the egg.yml files. 
+
+The newt tool can ascertain a map of all the egg capabilities and use it to check dependencies and make sure all the necessary eggs are in a project for a particular target.
+
+### Identity
+
+Identity is a property of a target or project in the newt world. A target may inherit it from a project or vice versa. It may be used to determine what eggs to include or how an egg code should behave in a build or which linkerscripts to use. For example, the identity of a lock is different from the identity of a wearable monitor. Even if they were to be built on the same hardware target, different features and behavior are required. Their different identities result in differing sets of eggs in the projects and/or the same egg behaving differently depending on the identity.