[23/50] [abbrv] incubator-mynewt-newt git commit: This closes #41

2017-03-06 Thread marko
This closes #41


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

Branch: refs/heads/master
Commit: 5cb84eb4a0416c54db5a6422f7b2858e0061b13f
Parents: 8728a73 a986f67
Author: Sterling Hughes 
Authored: Mon Feb 27 18:59:02 2017 -0800
Committer: Sterling Hughes 
Committed: Mon Feb 27 18:59:02 2017 -0800

--
 newt/builder/symbol_tree.go | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)
--




[27/50] [abbrv] incubator-mynewt-newt git commit: newt; move targetSyscfgKVxxx() routines to be inside syscfg package.

2017-03-06 Thread marko
newt; move targetSyscfgKVxxx() routines to be inside syscfg package.


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

Branch: refs/heads/master
Commit: 1a50286fabdf32c92d6887be312f35fe30b98682
Parents: 2f4975d
Author: Marko Kiiskila 
Authored: Tue Feb 28 16:58:21 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 28 16:58:21 2017 -0800

--
 newt/cli/target_cmds.go | 54 ++--
 newt/syscfg/syscfg.go   | 50 
 2 files changed, 52 insertions(+), 52 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a50286f/newt/cli/target_cmds.go
--
diff --git a/newt/cli/target_cmds.go b/newt/cli/target_cmds.go
index 847..a6ea7df 100644
--- a/newt/cli/target_cmds.go
+++ b/newt/cli/target_cmds.go
@@ -121,7 +121,7 @@ func targetShowCmd(cmd *cobra.Command, args []string) {
}
 
// A few variables come from the base package rather than the 
target.
-   kvPairs["syscfg"] = targetSyscfgKVToStr(
+   kvPairs["syscfg"] = syscfg.KeyValueToStr(

target.Package().SyscfgV.GetStringMapString("syscfg.vals"))
kvPairs["cflags"] = pkgVarSliceString(target.Package(), 
"pkg.cflags")
kvPairs["lflags"] = pkgVarSliceString(target.Package(), 
"pkg.lflags")
@@ -142,56 +142,6 @@ func targetShowCmd(cmd *cobra.Command, args []string) {
}
 }
 
-func targetSyscfgKVFromStr(str string) (map[string]string, error) {
-   vals := map[string]string{}
-
-   if strings.TrimSpace(str) == "" {
-   return vals, nil
-   }
-
-   // Separate syscfg vals are delimited by ':'.
-   fields := strings.Split(str, ":")
-
-   // Key-value pairs are delimited by '='.  If no '=' is present, assume 
the
-   // string is the key name and the value is 1.
-   for _, f := range fields {
-   if _, err := util.AtoiNoOct(f); err == nil {
-   return nil, util.FmtNewtError(
-   "Invalid setting name \"%s\"; must not be a 
number", f)
-   }
-
-   kv := strings.SplitN(f, "=", 2)
-   switch len(kv) {
-   case 1:
-   vals[f] = "1"
-   case 2:
-   vals[kv[0]] = kv[1]
-   }
-   }
-
-   return vals, nil
-}
-
-func targetSyscfgKVToStr(syscfgKv map[string]string) string {
-   str := ""
-
-   names := make([]string, 0, len(syscfgKv))
-   for k, _ := range syscfgKv {
-   names = append(names, k)
-   }
-   sort.Strings(names)
-
-   for i, name := range names {
-   if i != 0 {
-   str += ":"
-   }
-
-   str += fmt.Sprintf("%s=%s", name, syscfgKv[name])
-   }
-
-   return str
-}
-
 func targetSetCmd(cmd *cobra.Command, args []string) {
if len(args) < 2 {
NewtUsage(cmd,
@@ -234,7 +184,7 @@ func targetSetCmd(cmd *cobra.Command, args []string) {
// instead of the target.
if kv[0] == "target.syscfg" {
t.Package().SyscfgV = viper.New()
-   kv, err := targetSyscfgKVFromStr(kv[1])
+   kv, err := syscfg.KeyValueFromStr(kv[1])
if err != nil {
NewtUsage(cmd, err)
}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1a50286f/newt/syscfg/syscfg.go
--
diff --git a/newt/syscfg/syscfg.go b/newt/syscfg/syscfg.go
index f5cef0e..cac298e 100644
--- a/newt/syscfg/syscfg.go
+++ b/newt/syscfg/syscfg.go
@@ -993,3 +993,53 @@ func EnsureWritten(cfg Cfg, includeDir string) error {
 
return nil
 }
+
+func KeyValueFromStr(str string) (map[string]string, error) {
+   vals := map[string]string{}
+
+   if strings.TrimSpace(str) == "" {
+   return vals, nil
+   }
+
+   // Separate syscfg vals are delimited by ':'.
+   fields := strings.Split(str, ":")
+
+   // Key-value pairs are delimited by '='.  If no '=' is present, assume 
the
+

[14/50] [abbrv] incubator-mynewt-newt git commit: Merge branch 'add-pkg-clone' into develop

2017-03-06 Thread marko
Merge branch 'add-pkg-clone' into develop


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

Branch: refs/heads/master
Commit: fbf2138b6edbfaa192b5ad650ed5dc14ad8edf8b
Parents: ec61f09 ef7a63f
Author: Sterling Hughes 
Authored: Sat Feb 18 10:28:46 2017 -0600
Committer: Sterling Hughes 
Committed: Sat Feb 18 10:28:46 2017 -0600

--
 newt/cli/pkg_cmds.go | 46 +-
 1 file changed, 33 insertions(+), 13 deletions(-)
--




[20/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-639 Add help text and check for pkg name 1) Update help text for "newt pkg new" to have package name input. 2) Error check that a package name

2017-03-06 Thread marko
MYNEWT-639 Add help text and check for pkg name
1) Update help text for "newt pkg new" to have package name input.
2) Error check that a package name is provided for the command.
3) Changed "libs/mylib" to "sys/mylib" in "newt pkg" help text to reflect 
latest source structure.
   (this change is not related to MYNEWT-639)
4) Added  argument to "newt pkg remove" Usage help text


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

Branch: refs/heads/master
Commit: 14b40595477fab94b099691ef7e18c37c7dcb606
Parents: 745efe9
Author: cwanda 
Authored: Fri Feb 24 22:15:46 2017 -0800
Committer: cwanda 
Committed: Sat Feb 25 11:44:35 2017 -0800

--
 newt/cli/pkg_cmds.go | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/14b40595/newt/cli/pkg_cmds.go
--
diff --git a/newt/cli/pkg_cmds.go b/newt/cli/pkg_cmds.go
index 0ddde3d..d17e81f 100644
--- a/newt/cli/pkg_cmds.go
+++ b/newt/cli/pkg_cmds.go
@@ -37,6 +37,15 @@ import (
 var NewTypeStr = "pkg"
 
 func pkgNewCmd(cmd *cobra.Command, args []string) {
+
+   if len(args) == 0 {
+   NewtUsage(cmd, util.NewNewtError("Must specify a package name"))
+   }
+
+   if len(args) != 1 {
+   NewtUsage(cmd, util.NewNewtError("Exactly one argument 
required"))
+   }
+
NewTypeStr = strings.ToUpper(NewTypeStr)
 
pw := project.NewPackageWriter()
@@ -51,11 +60,11 @@ func pkgNewCmd(cmd *cobra.Command, args []string) {
 type dirOperation func(string, string) error
 
 func pkgCloneCmd(cmd *cobra.Command, args []string) {
-   pkgCloneOrMoveCmd(cmd, args, util.CopyDir, "Cloning");
+   pkgCloneOrMoveCmd(cmd, args, util.CopyDir, "Cloning")
 }
 
 func pkgMoveCmd(cmd *cobra.Command, args []string) {
-   pkgCloneOrMoveCmd(cmd, args, util.MoveDir, "Moving");
+   pkgCloneOrMoveCmd(cmd, args, util.MoveDir, "Moving")
 }
 
 func pkgCloneOrMoveCmd(cmd *cobra.Command, args []string, dirOpFn 
dirOperation, opStr string) {
@@ -207,7 +216,7 @@ func AddPackageCommands(cmd *cobra.Command) {
 * keyed
 */
pkgHelpText := "Commands for creating and manipulating packages"
-   pkgHelpEx := "  newt pkg new --type=pkg libs/mylib"
+   pkgHelpEx := "  newt pkg new --type=pkg sys/mylib"
 
pkgCmd := &cobra.Command{
Use: "pkg",
@@ -226,8 +235,8 @@ func AddPackageCommands(cmd *cobra.Command) {
newCmdHelpEx := ""
 
newCmd := &cobra.Command{
-   Use: "new",
-   Short:   "Create a new package, from a template",
+   Use: "new ",
+   Short:   "Create a new package in the current directory, from a 
template",
Long:newCmdHelpText,
Example: newCmdHelpEx,
Run: pkgNewCmd,
@@ -268,7 +277,7 @@ func AddPackageCommands(cmd *cobra.Command) {
removeCmdHelpEx := ""
 
removeCmd := &cobra.Command{
-   Use: "remove",
+   Use: "remove ",
Short:   "Remove a package",
Long:removeCmdHelpText,
Example: removeCmdHelpEx,



[33/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-509 - Newt: fail on image flash overflow.

2017-03-06 Thread marko
MYNEWT-509 - Newt: fail on image flash overflow.

Ensure each generated image leaves sufficient room at the end of its
slot for a boot trailer.  Newt calculates the size of a boot trailer by
using the MCU_FLASH_MIN_WRITE_SIZE syscfg setting (newly added to each
MCU package).  If this setting is not defined, newt warns the user and
assumes a min-write-size of 1.

The "-f" (force) option causes newt to only warn about overflow.


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

Branch: refs/heads/master
Commit: 0a3ce8e9ff3331dca7ad11853563c6da6fced01a
Parents: a404a47
Author: Christopher Collins 
Authored: Thu Mar 2 16:09:01 2017 -0800
Committer: Christopher Collins 
Committed: Thu Mar 2 16:52:10 2017 -0800

--
 newt/builder/targetbuild.go | 113 +++
 newt/cli/image_cmds.go  |   7 ++-
 newt/cli/project_cmds.go|  20 +++
 newt/cli/run_cmds.go|   5 ++
 newt/cli/target_cmds.go |   7 ++-
 newt/image/image.go |   9 
 newt/newtutil/newtutil.go   |   1 +
 7 files changed, 149 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/0a3ce8e9/newt/builder/targetbuild.go
--
diff --git a/newt/builder/targetbuild.go b/newt/builder/targetbuild.go
index 2576764..c522597 100644
--- a/newt/builder/targetbuild.go
+++ b/newt/builder/targetbuild.go
@@ -31,8 +31,10 @@ import (
 
log "github.com/Sirupsen/logrus"
 
+   "mynewt.apache.org/newt/newt/flash"
"mynewt.apache.org/newt/newt/image"
"mynewt.apache.org/newt/newt/interfaces"
+   "mynewt.apache.org/newt/newt/newtutil"
"mynewt.apache.org/newt/newt/pkg"
"mynewt.apache.org/newt/newt/project"
"mynewt.apache.org/newt/newt/resolve"
@@ -645,6 +647,113 @@ func (t *TargetBuilder) augmentManifest(
return nil
 }
 
+// Calculates the size of a single boot trailer.  This is the amount of flash
+// that must be reserved at the end of each image slot.
+func (t *TargetBuilder) bootTrailerSize() int {
+   var minWriteSz int
+
+   entry, ok := t.res.Cfg.Settings["MCU_FLASH_MIN_WRITE_SIZE"]
+   if !ok {
+   util.StatusMessage(util.VERBOSITY_DEFAULT,
+   "* Warning: target does not define 
MCU_FLASH_MIN_WRITE_SIZE "+
+   "setting; assuming a value of 1.\n")
+   minWriteSz = 1
+   } else {
+   val, err := util.AtoiNoOct(entry.Value)
+   if err != nil {
+   util.StatusMessage(util.VERBOSITY_DEFAULT,
+   "* Warning: target specifies invalid 
non-integer "+
+   "MCU_FLASH_MIN_WRITE_SIZE setting; 
assuming a "+
+   "value of 1.\n")
+   minWriteSz = 1
+   } else {
+   minWriteSz = val
+   }
+   }
+
+   /* Mynewt boot trailer format:
+*
+*  0   1   2   3
+*  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+* ~   MAGIC (16 octets)   ~
+* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+* ~   ~
+* ~ Swap status (128 * min-write-size * 3)~
+* ~   ~
+* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+* |   Copy done   | 0xff padding (up to min-write-sz - 1) |
+* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+* |   Image OK| 0xff padding (up to min-write-sz - 1) |
+* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+*/
+
+   tsize := 16 + // Magic.
+   128*minWriteSz*3 + // Swap status.
+   minWriteSz + // Copy done.
+   minWriteSz // Image Ok.
+
+   log.Debugf("Min-write-size=%d; boot-trailer-size=%d", minWriteSz, tsize)
+
+   return tsize
+}
+
+// Calculates the size of the largest image that can be written to each image
+// slot.
+func (t *TargetBuilder) maxImgSizes() []int {
+   sz0 := t.bspPkg.FlashMap.Areas[flash.FLASH_AREA_NAME_IMAGE_0].Size
+   sz1 := t.bspPkg.FlashMap.Areas[flash.

[39/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-653 Use runtimeco gatt fork.

2017-03-06 Thread marko
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/abf65d3a/newtmgr/vendor/github.com/runtimeco/gatt/doc.go
--
diff --git a/newtmgr/vendor/github.com/runtimeco/gatt/doc.go 
b/newtmgr/vendor/github.com/runtimeco/gatt/doc.go
new file mode 100644
index 000..c34a3e9
--- /dev/null
+++ b/newtmgr/vendor/github.com/runtimeco/gatt/doc.go
@@ -0,0 +1,88 @@
+// Package gatt provides a Bluetooth Low Energy gatt implementation.
+//
+// Gatt (Generic Attribute Profile) is the protocol used to write
+// BLE peripherals (servers) and centrals (clients).
+//
+// STATUS
+//
+// This package is a work in progress. The API will change.
+//
+// As a peripheral, you can create services, characteristics, and descriptors,
+// advertise, accept connections, and handle requests.
+// As a central, you can scan, connect, discover services, and make requests.
+//
+// SETUP
+//
+// gatt supports both Linux and OS X.
+//
+// On Linux:
+// To gain complete and exclusive control of the HCI device, gatt uses
+// HCI_CHANNEL_USER (introduced in Linux v3.14) instead of HCI_CHANNEL_RAW.
+// Those who must use an older kernel may patch in these relevant commits
+// from Marcel Holtmann:
+//
+// Bluetooth: Introduce new HCI socket channel for user operation
+// Bluetooth: Introduce user channel flag for HCI devices
+// Bluetooth: Refactor raw socket filter into more readable code
+//
+// Note that because gatt uses HCI_CHANNEL_USER, once gatt has opened the
+// device no other program may access it.
+//
+// Before starting a gatt program, make sure that your BLE device is down:
+//
+// sudo hciconfig
+// sudo hciconfig hci0 down  # or whatever hci device you want to use
+//
+// If you have BlueZ 5.14+ (or aren't sure), stop the built-in
+// bluetooth server, which interferes with gatt, e.g.:
+//
+// sudo service bluetooth stop
+//
+// Because gatt programs administer network devices, they must
+// either be run as root, or be granted appropriate capabilities:
+//
+// sudo 
+// # OR
+// sudo setcap 'cap_net_raw,cap_net_admin=eip' 
+// 
+//
+// USAGE
+//
+// # Start a simple server.
+// sudo go run example/server.go
+//
+// # Discover surrounding peripherals.
+// sudo go run example/discoverer.go
+//
+// # Connect to and explorer a peripheral device.
+// sudo go run example/explorer.go 
+//
+// See the server.go, discoverer.go, and explorer.go in the examples/
+// directory for writing server or client programs that run on Linux
+// and OS X.
+//
+// Users, especially on Linux platforms, seeking finer-grained control
+// over the devices can see the examples/server_lnx.go for the usage
+// of Option, which are platform specific.
+//
+// See the rest of the docs for other options and finer-grained control.
+//
+// Note that some BLE central devices, particularly iOS, may aggressively
+// cache results from previous connections. If you change your services or
+// characteristics, you may need to reboot the other device to pick up the
+// changes. This is a common source of confusion and apparent bugs. For an
+// OS X central, see http://stackoverflow.com/questions/20553957.
+//
+//
+// REFERENCES
+//
+// gatt started life as a port of bleno, to which it is indebted:
+// https://github.com/sandeepmistry/bleno. If you are having
+// problems with gatt, particularly around installation, issues
+// filed with bleno might also be helpful references.
+//
+// To try out your GATT server, it is useful to experiment with a
+// generic BLE client. LightBlue is a good choice. It is available
+// free for both iOS and OS X.
+//
+package gatt

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/abf65d3a/newtmgr/vendor/github.com/runtimeco/gatt/known_uuid.go
--
diff --git a/newtmgr/vendor/github.com/runtimeco/gatt/known_uuid.go 
b/newtmgr/vendor/github.com/runtimeco/gatt/known_uuid.go
new file mode 100644
index 000..2146af5
--- /dev/null
+++ b/newtmgr/vendor/github.com/runtimeco/gatt/known_uuid.go
@@ -0,0 +1,122 @@
+package gatt
+
+// A dictionary of known service names and type (keyed by service uuid)
+var knownServices = map[string]struct{ Name, Type string }{
+   "1800": {Name: "Generic Access", Type: 
"org.bluetooth.service.generic_access"},
+   "1801": {Name: "Generic Attribute", Type: 
"org.bluetooth.service.generic_attribute"},
+   "1802": {Name: "Immediate Alert", Type: 
"org.bluetooth.service.immediate_alert"},
+   "1803": {Name: "Link Loss", Type: "org.bluetooth.service.link_loss"},
+   "1804": {Name: "Tx Power", Type: "org.bluetooth.service.tx_power"},
+   "1805": {Name: "Current Time Service", Type: 
"org.bluetooth.service.current_time"},
+   "1806": {Name: "Reference Time Update Service", Type: 
"org.bluetooth.service.reference_time_update"},
+   "1807": {Name: "Next DST Change Service"

[21/50] [abbrv] incubator-mynewt-newt git commit: This closes #40

2017-03-06 Thread marko
This closes #40

1) Update help text for `newt pkg new` to have package name input.
2) Error check that a package name provided for the command.
3) Changed `libs/mylib` to `sys/mylib` in `newt pkg` help text to reflect 
latest source structure.
   (this change is not related to MYNEWT-639)
4) Added  argument to
ewt pkg remove\ Usage help text


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

Branch: refs/heads/master
Commit: 8728a73e2f2cfc1ac280dfca0759dde55c80b05f
Parents: 745efe9 14b4059
Author: Sterling Hughes 
Authored: Sat Feb 25 13:53:56 2017 -0800
Committer: Sterling Hughes 
Committed: Sat Feb 25 13:53:56 2017 -0800

--
 newt/cli/pkg_cmds.go | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)
--




[34/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-653 Change Golang imports to runtimeco

2017-03-06 Thread marko
MYNEWT-653 Change Golang imports to runtimeco


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

Branch: refs/heads/master
Commit: 671a1541f0712f417dba98351dde71a65b68713f
Parents: 0a3ce8e
Author: Christopher Collins 
Authored: Thu Mar 2 19:12:22 2017 -0800
Committer: Christopher Collins 
Committed: Thu Mar 2 19:12:22 2017 -0800

--
 newtmgr/transport/connble.go| 10 +-
 newtmgr/transport/connble_darwin.go |  2 +-
 newtmgr/transport/connble_linux.go  |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/671a1541/newtmgr/transport/connble.go
--
diff --git a/newtmgr/transport/connble.go b/newtmgr/transport/connble.go
index e8bcb66..f19b0b8 100644
--- a/newtmgr/transport/connble.go
+++ b/newtmgr/transport/connble.go
@@ -22,7 +22,7 @@ import (
log "github.com/Sirupsen/logrus"
"time"
 
-   "github.com/runtimeinc/gatt"
+   "github.com/runtimeco/gatt"
 
"mynewt.apache.org/newt/newtmgr/config"
"mynewt.apache.org/newt/util"
@@ -119,7 +119,7 @@ func onPeriphConnected(p gatt.Peripheral, err error) {
for _, service := range services {
 
if service.UUID().Equal(newtmgrServiceId) ||
-  service.UUID().Equal(newtmgrCoapServiceId) {
+   service.UUID().Equal(newtmgrCoapServiceId) {
log.Debugf("Newtmgr Service Found %s", service.Name())
 
if service.UUID().Equal(newtmgrCoapServiceId) {
@@ -130,9 +130,9 @@ func onPeriphConnected(p gatt.Peripheral, err error) {
 
for _, c := range cs {
if (isCoap == false &&
-   c.UUID().Equal(newtmgrServiceCharId)) ||
-  (isCoap == true &&
-   c.UUID().Equal(newtmgrCoapServiceCharId)) {
+   c.UUID().Equal(newtmgrServiceCharId)) ||
+   (isCoap == true &&
+   
c.UUID().Equal(newtmgrCoapServiceCharId)) {
log.Debugf("Newtmgr Characteristic 
Found")
p.SetNotifyValue(c, newtmgrNotifyCB)
deviceChar = c

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/671a1541/newtmgr/transport/connble_darwin.go
--
diff --git a/newtmgr/transport/connble_darwin.go 
b/newtmgr/transport/connble_darwin.go
index 8708cb7..ebbdadd 100644
--- a/newtmgr/transport/connble_darwin.go
+++ b/newtmgr/transport/connble_darwin.go
@@ -18,6 +18,6 @@
  */
 package transport
 
-import "github.com/runtimeinc/gatt"
+import "github.com/runtimeco/gatt"
 
 var BleOptions = []gatt.Option{}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/671a1541/newtmgr/transport/connble_linux.go
--
diff --git a/newtmgr/transport/connble_linux.go 
b/newtmgr/transport/connble_linux.go
index 4074a5b..2c241f0 100644
--- a/newtmgr/transport/connble_linux.go
+++ b/newtmgr/transport/connble_linux.go
@@ -18,7 +18,7 @@
  */
 package transport
 
-import "github.com/runtimeinc/gatt"
+import "github.com/runtimeco/gatt"
 
 var BleOptions = []gatt.Option{
gatt.LnxMaxConnections(1),



[28/50] [abbrv] incubator-mynewt-newt git commit: newt; add target.syscfg to build's manifest file.

2017-03-06 Thread marko
newt; add target.syscfg to build's manifest file.


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

Branch: refs/heads/master
Commit: 2752197f7e179df944df58254e8d31154979a8e7
Parents: 1a50286
Author: Marko Kiiskila 
Authored: Tue Feb 28 16:58:58 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 28 16:58:58 2017 -0800

--
 newt/builder/targetbuild.go | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/2752197f/newt/builder/targetbuild.go
--
diff --git a/newt/builder/targetbuild.go b/newt/builder/targetbuild.go
index f6bc2f6..2576764 100644
--- a/newt/builder/targetbuild.go
+++ b/newt/builder/targetbuild.go
@@ -570,6 +570,13 @@ func (t *TargetBuilder) createManifest() error {
for _, k := range keys {
manifest.TgtVars = append(manifest.TgtVars, k+"="+vars[k])
}
+   syscfgKV := 
t.GetTarget().Package().SyscfgV.GetStringMapString("syscfg.vals")
+   if len(syscfgKV) > 0 {
+   tgtSyscfg := fmt.Sprintf("target.syscfg=%s",
+   syscfg.KeyValueToStr(syscfgKV))
+   manifest.TgtVars = append(manifest.TgtVars, tgtSyscfg)
+   }
+
file, err := os.Create(t.AppBuilder.ManifestPath())
if err != nil {
return util.FmtNewtError("Cannot create manifest file %s: %s",



[32/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-651; fix go formatting.

2017-03-06 Thread marko
MYNEWT-651; fix go formatting.


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

Branch: refs/heads/master
Commit: 9a13ff3082966622d0beb76c9a64d621f7fb30c3
Parents: 15cfc60
Author: Marko Kiiskila 
Authored: Thu Mar 2 15:37:47 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 15:37:47 2017 -0800

--
 newt/builder/size.go |  2 +-
 newt/image/image.go  | 10 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/9a13ff30/newt/builder/size.go
--
diff --git a/newt/builder/size.go b/newt/builder/size.go
index 70b4dc2..7cdcc45 100644
--- a/newt/builder/size.go
+++ b/newt/builder/size.go
@@ -405,7 +405,7 @@ func (t *TargetBuilder) Size() error {
 
 func (b *Builder) FindPkgNameByArName(arName string) string {
for rpkg, bpkg := range b.PkgMap {
-   if (b.ArchivePath(bpkg) == arName) {
+   if b.ArchivePath(bpkg) == arName {
return rpkg.Lpkg.FullName()
}
}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/9a13ff30/newt/image/image.go
--
diff --git a/newt/image/image.go b/newt/image/image.go
index 15ac916..44f428c 100644
--- a/newt/image/image.go
+++ b/newt/image/image.go
@@ -721,7 +721,7 @@ func NewImageManifestSizeCollector() 
*ImageManifestSizeCollector {
 }
 
 func (c *ImageManifestSizeCollector) AddPkg(pkg string) *ImageManifestSizePkg {
-   p := &ImageManifestSizePkg {
+   p := &ImageManifestSizePkg{
Name: pkg,
}
c.Pkgs = append(c.Pkgs, p)
@@ -730,7 +730,7 @@ func (c *ImageManifestSizeCollector) AddPkg(pkg string) 
*ImageManifestSizePkg {
 }
 
 func (c *ImageManifestSizePkg) AddSymbol(file string, sym string, area string,
-   symSz uint32) {
+   symSz uint32) {
f := c.addFile(file)
s := f.addSym(sym)
s.addArea(area, symSz)
@@ -742,7 +742,7 @@ func (p *ImageManifestSizePkg) addFile(file string) 
*ImageManifestSizeFile {
return f
}
}
-   f := &ImageManifestSizeFile {
+   f := &ImageManifestSizeFile{
Name: file,
}
p.Files = append(p.Files, f)
@@ -751,7 +751,7 @@ func (p *ImageManifestSizePkg) addFile(file string) 
*ImageManifestSizeFile {
 }
 
 func (f *ImageManifestSizeFile) addSym(sym string) *ImageManifestSizeSym {
-   s := &ImageManifestSizeSym {
+   s := &ImageManifestSizeSym{
Name: sym,
}
f.Syms = append(f.Syms, s)
@@ -760,7 +760,7 @@ func (f *ImageManifestSizeFile) addSym(sym string) 
*ImageManifestSizeSym {
 }
 
 func (s *ImageManifestSizeSym) addArea(area string, areaSz uint32) {
-   a := &ImageManifestSizeArea {
+   a := &ImageManifestSizeArea{
Name: area,
Size: areaSz,
}



[18/50] [abbrv] incubator-mynewt-newt git commit: newt: More detailed size report command

2017-03-06 Thread marko
newt: More detailed size report command

This patch improves the output of the size command. New flags
were added for this purpose:

Flags:
  -F, --flash   Print FLASH statistics
  -R, --ram Print RAM statistics

The size statistics are broken down into a tree-like structure, where
the leaves are symbols and branches are folders and files. For
each tree element there its size in bytes and percentage contribution
to the total size of the memory region.

Path   Size   %
=
(...)
libc 32 0.49%
  baselibc   32 0.49%
src  32 0.49%
  malloc.c   32 0.49%
__malloc_head24 0.37%
malloc_lock   4 0.06%
malloc_unlock 4 0.06%
(...)

Moreover, there is more memory region info available after specifying
verbose flag(-v):

Mem FLASH: 0x8000-0x00042000
Mem RAM:   0x2000-0x2001

Mem: FLASH
Name   Size
.ARM.extab0
.ARM.exidx   24
.imghdr  32
.text 18624
Total 18680

Mem: RAM
Name   Size
.bss   5656
.stack_dummy432
.vector_relocation  216
.data   256
.bssnz0
Total  6560


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

Branch: refs/heads/master
Commit: 4b91c272b2fa1c5ca68281165d87c6e7f59be3eb
Parents: 78d0066
Author: Michał Narajowski 
Authored: Tue Feb 7 12:34:37 2017 +0100
Committer: Michał Narajowski 
Committed: Thu Feb 23 15:21:52 2017 +0100

--
 newt/builder/size.go|  34 +++-
 newt/builder/size_report.go | 332 +++
 newt/builder/symbol_tree.go | 194 +++
 newt/cli/build_cmds.go  |  18 ++-
 4 files changed, 574 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4b91c272/newt/builder/size.go
--
diff --git a/newt/builder/size.go b/newt/builder/size.go
index 970db2d..5ce2939 100644
--- a/newt/builder/size.go
+++ b/newt/builder/size.go
@@ -106,8 +106,8 @@ func MakePkgSize(name string, memSections 
map[string]*MemSection) *PkgSize {
 /*
  * Go through GCC generated mapfile, and collect info about symbol sizes
  */
-func ParseMapFileSizes(fileName string) (map[string]*PkgSize, 
map[string]*MemSection,
-   error) {
+func ParseMapFileSizes(fileName string) (map[string]*PkgSize,
+   map[string]*MemSection, error) {
var state int = 0
 
file, err := os.Open(fileName)
@@ -375,3 +375,33 @@ func (b *Builder) Size() error {
 
return nil
 }
+
+func (t *TargetBuilder) SizeReport(ram, flash bool) error {
+
+   err := t.PrepBuild()
+
+   if err != nil {
+   return err
+   }
+
+   fmt.Printf("Size of Application Image: %s\n", t.AppBuilder.buildName)
+   err = t.AppBuilder.SizeReport(ram, flash)
+
+   if err == nil {
+   if t.LoaderBuilder != nil {
+   fmt.Printf("Size of Loader Image: %s\n", 
t.LoaderBuilder.buildName)
+   err = t.LoaderBuilder.SizeReport(ram, flash)
+   }
+   }
+
+   return err
+}
+
+func (b *Builder) SizeReport(ram, flash bool) error {
+   srcBase := b.targetBuilder.GetTarget().App().Repo().Path() + "/"
+   err := SizeReport(b.AppElfPath(), srcBase, ram, flash)
+   if err != nil {
+   return util.NewNewtError(err.Error())
+   }
+   return nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4b91c272/newt/builder/size_report.go
--
diff --git a/newt/builder/size_report.go b/newt/builder/size_report.go
new file mode 100644
index 000..5c9fa02
--- /dev/null
+++ b/newt/builder/size_report.go
@@ -0,0 +1,332 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICE

[15/50] [abbrv] incubator-mynewt-newt git commit: This closes #37

2017-03-06 Thread marko
This closes #37


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

Branch: refs/heads/master
Commit: 1666e0e7ab757454b4eaa764f03305d72baa5eab
Parents: fbf2138
Author: Sterling Hughes 
Authored: Sat Feb 18 10:29:25 2017 -0600
Committer: Sterling Hughes 
Committed: Sat Feb 18 10:29:25 2017 -0600

--

--




[40/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-653 Use runtimeco gatt fork.

2017-03-06 Thread marko
MYNEWT-653 Use runtimeco gatt fork.


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

Branch: refs/heads/master
Commit: abf65d3a748ee8b1078ecd13adef096fb863e413
Parents: 671a154
Author: Christopher Collins 
Authored: Thu Mar 2 19:12:27 2017 -0800
Committer: Christopher Collins 
Committed: Thu Mar 2 19:18:41 2017 -0800

--
 newtmgr/Godeps/Godeps.json  |  32 +-
 .../vendor/github.com/runtimeco/gatt/.gitignore |   3 +
 .../vendor/github.com/runtimeco/gatt/LICENSE.md |  27 +
 newtmgr/vendor/github.com/runtimeco/gatt/adv.go | 234 +
 .../vendor/github.com/runtimeco/gatt/attr.go| 160 +++
 .../vendor/github.com/runtimeco/gatt/central.go | 152 +++
 .../github.com/runtimeco/gatt/central_darwin.go |  70 ++
 .../github.com/runtimeco/gatt/central_linux.go  | 446 +
 .../vendor/github.com/runtimeco/gatt/common.go  | 399 
 .../vendor/github.com/runtimeco/gatt/const.go   | 153 +++
 .../vendor/github.com/runtimeco/gatt/device.go  | 161 +++
 .../github.com/runtimeco/gatt/device_darwin.go  | 513 ++
 .../github.com/runtimeco/gatt/device_linux.go   | 240 +
 newtmgr/vendor/github.com/runtimeco/gatt/doc.go |  88 ++
 .../github.com/runtimeco/gatt/known_uuid.go | 122 +++
 .../runtimeco/gatt/l2cap_writer_linux.go| 156 +++
 .../github.com/runtimeco/gatt/linux/cmd/cmd.go  | 995 +++
 .../github.com/runtimeco/gatt/linux/const.go|  21 +
 .../github.com/runtimeco/gatt/linux/device.go   | 109 ++
 .../github.com/runtimeco/gatt/linux/devices.go  |  58 ++
 .../github.com/runtimeco/gatt/linux/doc.go  |   5 +
 .../github.com/runtimeco/gatt/linux/evt/evt.go  | 382 +++
 .../runtimeco/gatt/linux/gioctl/LICENSE.md  |  22 +
 .../runtimeco/gatt/linux/gioctl/README.md   |  12 +
 .../runtimeco/gatt/linux/gioctl/ioctl.go|  57 ++
 .../github.com/runtimeco/gatt/linux/hci.go  | 400 
 .../github.com/runtimeco/gatt/linux/l2cap.go| 174 
 .../runtimeco/gatt/linux/socket/asm.s   |   8 +
 .../runtimeco/gatt/linux/socket/asm_linux_386.s |  33 +
 .../runtimeco/gatt/linux/socket/socket.go   | 121 +++
 .../gatt/linux/socket/socket_common.go  |  24 +
 .../gatt/linux/socket/socket_darwin.go  |   6 +
 .../runtimeco/gatt/linux/socket/socket_linux.go |   7 +
 .../gatt/linux/socket/socket_linux_386.go   |  31 +
 .../runtimeco/gatt/linux/util/util.go   |  16 +
 .../github.com/runtimeco/gatt/option_darwin.go  |  15 +
 .../github.com/runtimeco/gatt/option_linux.go   |  87 ++
 .../github.com/runtimeco/gatt/peripheral.go | 102 ++
 .../runtimeco/gatt/peripheral_darwin.go | 277 ++
 .../runtimeco/gatt/peripheral_linux.go  | 448 +
 .../vendor/github.com/runtimeco/gatt/readme.md  | 115 +++
 .../vendor/github.com/runtimeco/gatt/uuid.go|  86 ++
 .../github.com/runtimeco/gatt/xpc/LICENSE   |  21 +
 .../vendor/github.com/runtimeco/gatt/xpc/doc.go |   8 +
 .../github.com/runtimeco/gatt/xpc/xpc_darwin.go | 350 +++
 .../runtimeco/gatt/xpc/xpc_wrapper_darwin.c |  85 ++
 .../runtimeco/gatt/xpc/xpc_wrapper_darwin.h |  32 +
 .../github.com/runtimeinc/gatt/.gitignore   |   3 -
 .../github.com/runtimeinc/gatt/LICENSE.md   |  27 -
 .../vendor/github.com/runtimeinc/gatt/adv.go| 234 -
 .../vendor/github.com/runtimeinc/gatt/attr.go   | 160 ---
 .../github.com/runtimeinc/gatt/central.go   | 152 ---
 .../runtimeinc/gatt/central_darwin.go   |  70 --
 .../github.com/runtimeinc/gatt/central_linux.go | 446 -
 .../vendor/github.com/runtimeinc/gatt/common.go | 399 
 .../vendor/github.com/runtimeinc/gatt/const.go  | 153 ---
 .../vendor/github.com/runtimeinc/gatt/device.go | 161 ---
 .../github.com/runtimeinc/gatt/device_darwin.go | 513 --
 .../github.com/runtimeinc/gatt/device_linux.go  | 240 -
 .../vendor/github.com/runtimeinc/gatt/doc.go|  88 --
 .../github.com/runtimeinc/gatt/known_uuid.go| 122 ---
 .../runtimeinc/gatt/l2cap_writer_linux.go   | 156 ---
 .../github.com/runtimeinc/gatt/linux/cmd/cmd.go | 995 ---
 .../github.com/runtimeinc/gatt/linux/const.go   |  21 -
 .../github.com/runtimeinc/gatt/linux/device.go  | 109 --
 .../github.com/runtimeinc/gatt/linux/devices.go |  58 --
 .../github.com/runtimeinc/gatt/linux/doc.go |   5 -
 .../github.com/runtimeinc/gatt/linux/evt/evt.go | 382 ---
 .../runtimeinc/gatt/linux/gioctl/LICENSE.md |  22 -
 .../runtimeinc/gatt/linux/gioctl/README.md  |  12 -
 .../runtimeinc/gatt/linux/gioctl/ioctl.go   |  57 --
 .../github.com/runtimeinc/gatt/linux/hci.go | 400 
 .../github.com/runtimeinc/gatt/linu

[38/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-653 Use runtimeco gatt fork.

2017-03-06 Thread marko
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/abf65d3a/newtmgr/vendor/github.com/runtimeco/gatt/linux/hci.go
--
diff --git a/newtmgr/vendor/github.com/runtimeco/gatt/linux/hci.go 
b/newtmgr/vendor/github.com/runtimeco/gatt/linux/hci.go
new file mode 100644
index 000..967680d
--- /dev/null
+++ b/newtmgr/vendor/github.com/runtimeco/gatt/linux/hci.go
@@ -0,0 +1,400 @@
+package linux
+
+import (
+   "fmt"
+   "io"
+   "log"
+   "sync"
+
+   "github.com/runtimeco/gatt/linux/cmd"
+   "github.com/runtimeco/gatt/linux/evt"
+)
+
+type HCI struct {
+   AcceptMasterHandler  func(pd *PlatData)
+   AcceptSlaveHandler   func(pd *PlatData)
+   AdvertisementHandler func(pd *PlatData)
+
+   d io.ReadWriteCloser
+   c *cmd.Cmd
+   e *evt.Evt
+
+   plist   map[bdaddr]*PlatData
+   plistmu *sync.Mutex
+
+   bufCnt  chan struct{}
+   bufSize int
+
+   maxConn int
+   connsmu *sync.Mutex
+   conns   map[uint16]*conn
+
+   adv   bool
+   advmu *sync.Mutex
+}
+
+type bdaddr [6]byte
+
+type PlatData struct {
+   Namestring
+   AddressType uint8
+   Address [6]byte
+   Data[]byte
+   Connectable bool
+   RSSIint8
+
+   Conn io.ReadWriteCloser
+}
+
+func NewHCI(devID int, chk bool, maxConn int) (*HCI, error) {
+   d, err := newDevice(devID, chk)
+   if err != nil {
+   return nil, err
+   }
+   c := cmd.NewCmd(d)
+   e := evt.NewEvt()
+
+   h := &HCI{
+   d: d,
+   c: c,
+   e: e,
+
+   plist:   make(map[bdaddr]*PlatData),
+   plistmu: &sync.Mutex{},
+
+   bufCnt:  make(chan struct{}, 15-1),
+   bufSize: 27,
+
+   maxConn: maxConn,
+   connsmu: &sync.Mutex{},
+   conns:   map[uint16]*conn{},
+
+   advmu: &sync.Mutex{},
+   }
+
+   e.HandleEvent(evt.LEMeta, evt.HandlerFunc(h.handleLEMeta))
+   e.HandleEvent(evt.DisconnectionComplete, 
evt.HandlerFunc(h.handleDisconnectionComplete))
+   e.HandleEvent(evt.NumberOfCompletedPkts, 
evt.HandlerFunc(h.handleNumberOfCompletedPkts))
+   e.HandleEvent(evt.CommandComplete, evt.HandlerFunc(c.HandleComplete))
+   e.HandleEvent(evt.CommandStatus, evt.HandlerFunc(c.HandleStatus))
+
+   go h.mainLoop()
+   h.resetDevice()
+   return h, nil
+}
+
+func (h *HCI) Close() error {
+   for _, c := range h.conns {
+   c.Close()
+   }
+   return h.d.Close()
+}
+
+func (h *HCI) SetAdvertiseEnable(en bool) error {
+   h.advmu.Lock()
+   h.adv = en
+   h.advmu.Unlock()
+   return h.setAdvertiseEnable(en)
+}
+
+func (h *HCI) setAdvertiseEnable(en bool) error {
+   h.advmu.Lock()
+   defer h.advmu.Unlock()
+   if en && h.adv && (len(h.conns) == h.maxConn) {
+   return nil
+   }
+   return h.c.SendAndCheckResp(
+   cmd.LESetAdvertiseEnable{
+   AdvertisingEnable: btoi(en),
+   }, []byte{0x00})
+}
+
+func (h *HCI) SendCmdWithAdvOff(c cmd.CmdParam) error {
+   h.setAdvertiseEnable(false)
+   err := h.c.SendAndCheckResp(c, nil)
+   if h.adv {
+   h.setAdvertiseEnable(true)
+   }
+   return err
+}
+
+func (h *HCI) SetScanEnable(en bool, dup bool) error {
+   return h.c.SendAndCheckResp(
+   cmd.LESetScanEnable{
+   LEScanEnable: btoi(en),
+   FilterDuplicates: btoi(!dup),
+   }, []byte{0x00})
+}
+
+func (h *HCI) Connect(pd *PlatData) error {
+   h.c.Send(
+   cmd.LECreateConn{
+   LEScanInterval:0x0004, // N x 0.625ms
+   LEScanWindow:  0x0004, // N x 0.625ms
+   InitiatorFilterPolicy: 0x00,   // white list 
not used
+   PeerAddressType:   pd.AddressType, // public or 
random
+   PeerAddress:   pd.Address, //
+   OwnAddressType:0x00,   // public
+   ConnIntervalMin:   6, // N x 0.125ms
+   ConnIntervalMax:   7, // N x 0.125ms
+   ConnLatency:   0x, //
+   SupervisionTimeout:0x00100, // N x 10ms
+   MinimumCELength:   0x, // N x 0.625ms
+   MaximumCELength:   0x, // N x 0.625ms
+   })
+   return nil
+}
+
+func (h *HCI) CancelConnection(pd *PlatData) error {
+   return pd.Conn.Close()
+}
+
+func (h *HCI) SendRawCommand(c cmd.CmdParam) ([]byte, error) {
+   return h.c.Send(c)
+}
+
+func btoi(b bool) uint8 {
+   if b {
+   return 1

[30/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-651; newt - include package size info in manifest file.

2017-03-06 Thread marko
MYNEWT-651; newt - include package size info in manifest file.


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

Branch: refs/heads/master
Commit: 38d3bc222bcb190fb35861cfe3116a7ab1aee57a
Parents: a404a47
Author: Marko Kiiskila 
Authored: Thu Mar 2 12:59:43 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 12:59:43 2017 -0800

--
 newt/builder/size.go| 209 +++
 newt/builder/targetbuild.go |  10 ++
 newt/image/image.go |  80 ++-
 3 files changed, 257 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/38d3bc22/newt/builder/size.go
--
diff --git a/newt/builder/size.go b/newt/builder/size.go
index 5ce2939..70b4dc2 100644
--- a/newt/builder/size.go
+++ b/newt/builder/size.go
@@ -28,6 +28,7 @@ import (
"strconv"
"strings"
 
+   "mynewt.apache.org/newt/newt/image"
"mynewt.apache.org/newt/util"
 )
 
@@ -41,6 +42,8 @@ type MemSection struct {
 }
 type MemSectionArray []*MemSection
 
+var globalMemSections map[string]*MemSection
+
 func (array MemSectionArray) Len() int {
return len(array)
 }
@@ -71,11 +74,23 @@ func (m *MemSection) PartOf(addr uint64) bool {
 }
 
 /*
+ * Info about specific symbol size
+ */
+type SymbolData struct {
+   Namestring
+   ObjName string/* Which object file it came from */
+   Sizes   map[string]uint32 /* Sizes indexed by mem section name */
+}
+
+type SymbolDataArray []*SymbolData
+
+/*
  * We accumulate the size of libraries to elements in this.
  */
 type PkgSize struct {
Name  string
-   Sizes map[string]uint32 /* Sizes indexed by mem section name */
+   Sizes map[string]uint32  /* Sizes indexed by mem section name */
+   Syms  map[string]*SymbolData /* Symbols indexed by symbol name */
 }
 
 type PkgSizeArray []*PkgSize
@@ -92,33 +107,76 @@ func (array PkgSizeArray) Swap(i, j int) {
array[i], array[j] = array[j], array[i]
 }
 
-func MakePkgSize(name string, memSections map[string]*MemSection) *PkgSize {
+func (array SymbolDataArray) Len() int {
+   return len(array)
+}
+
+func (array SymbolDataArray) Less(i, j int) bool {
+   return array[i].Name < array[j].Name
+}
+
+func (array SymbolDataArray) Swap(i, j int) {
+   array[i], array[j] = array[j], array[i]
+}
+
+func MakeSymbolData(name string, objName string) *SymbolData {
+   sym := &SymbolData{
+   Name:name,
+   ObjName: objName,
+   }
+   sym.Sizes = make(map[string]uint32)
+   for _, sec := range globalMemSections {
+   sym.Sizes[sec.Name] = 0
+   }
+   return sym
+}
+
+func MakePkgSize(name string) *PkgSize {
pkgSize := &PkgSize{
Name: name,
}
pkgSize.Sizes = make(map[string]uint32)
-   for secName, _ := range memSections {
-   pkgSize.Sizes[secName] = 0
+   for _, sec := range globalMemSections {
+   pkgSize.Sizes[sec.Name] = 0
}
+   pkgSize.Syms = make(map[string]*SymbolData)
return pkgSize
 }
 
+func (ps *PkgSize) addSymSize(symName string, objName string, size uint32, 
addr uint64) {
+   for _, section := range globalMemSections {
+   if section.PartOf(addr) {
+   name := section.Name
+   size32 := uint32(size)
+   if size32 > 0 {
+   sym := ps.Syms[symName]
+   if sym == nil {
+   sym = MakeSymbolData(symName, objName)
+   ps.Syms[symName] = sym
+   }
+   ps.Sizes[name] += size32
+   sym.Sizes[name] += size32
+   }
+   break
+   }
+   }
+}
+
 /*
  * Go through GCC generated mapfile, and collect info about symbol sizes
  */
-func ParseMapFileSizes(fileName string) (map[string]*PkgSize,
-   map[string]*MemSection, error) {
+func ParseMapFileSizes(fileName string) (map[string]*PkgSize, error) {
var state int = 0
 
file, err := os.Open(fileName)
if err != nil {
-   return nil, nil,
-   util.NewNewtError("Mapfile failed: " + err.Error())
+   return nil, util.NewNewtError("Mapfile failed

[22/50] [abbrv] incubator-mynewt-newt git commit: newt: limit output width in size command to 80 columns

2017-03-06 Thread marko
newt: limit output width in size command to 80 columns


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

Branch: refs/heads/master
Commit: a986f673824155e517496138290f256d6e54e5aa
Parents: 8728a73
Author: Michał Narajowski 
Authored: Mon Feb 27 12:00:08 2017 +0100
Committer: Michał Narajowski 
Committed: Mon Feb 27 12:05:56 2017 +0100

--
 newt/builder/symbol_tree.go | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/a986f673/newt/builder/symbol_tree.go
--
diff --git a/newt/builder/symbol_tree.go b/newt/builder/symbol_tree.go
index ea6202b..2318da1 100644
--- a/newt/builder/symbol_tree.go
+++ b/newt/builder/symbol_tree.go
@@ -127,6 +127,8 @@ func (f *Folder) addSymbol(symbol *Symbol, path string) 
*Symbol {
return sym
 }
 
+var outputFormatting string = "%-59s %9d %8.2f%%\n"
+
 func (f *File) String(indent string, level int, total uint64) string {
var str string
if f.sumSize() <= 0 {
@@ -134,7 +136,7 @@ func (f *File) String(indent string, level int, total 
uint64) string {
}
size := f.sumSize()
percent := 100 * float64(size) / float64(total)
-   str += fmt.Sprintf("%-80s %20d %8.2f%%\n", strings.Repeat(indent, 
level)+
+   str += fmt.Sprintf(outputFormatting, strings.Repeat(indent, level)+
f.Name, size, percent)
 
var sorted []string
@@ -146,9 +148,8 @@ func (f *File) String(indent string, level int, total 
uint64) string {
size := f.Symbols[sym].Size
percent := 100 * float64(size) / float64(total)
if f.Symbols[sym].Size > 0 {
-   str += fmt.Sprintf("%-80s %20d %8.2f%%\n",
-   strings.Repeat(indent, level+1)+
-   f.Symbols[sym].Name,
+   str += fmt.Sprintf(outputFormatting,
+   strings.Repeat(indent, level+1)+ 
f.Symbols[sym].Name,
size, percent)
}
}
@@ -171,7 +172,7 @@ func (f *Folder) StringRec(indent string, level int, total 
uint64) string {
if folder, ok := f.Folders[name]; ok {
size := folder.sumSize()
percent := 100 * float64(size) / float64(total)
-   str += fmt.Sprintf("%-80s %20d %8.2f%%\n",
+   str += fmt.Sprintf(outputFormatting,
strings.Repeat(indent, level)+folder.Name, 
size, percent)
str += folder.StringRec(indent, level+1, total)
} else {
@@ -184,11 +185,11 @@ func (f *Folder) StringRec(indent string, level int, 
total uint64) string {
 func (f *Folder) ToString(total uint64) string {
indent := "  "
var str string
-   str += fmt.Sprintf("%-90s %10s %9s\n", "Path", "Size", "%")
-   str += strings.Repeat("=", 111) + "\n"
+   str += fmt.Sprintf("%-59s %9s %9s\n", "Path", "Size", "%")
+   str += strings.Repeat("=", 79) + "\n"
str += f.StringRec(indent, 0, total)
-   str += strings.Repeat("=", 111) + "\n"
-   str += fmt.Sprintf("%90s %10d\n",
-   "Total symbol size (i.e. excluding padding, etc.)", f.sumSize())
+   str += strings.Repeat("=", 79) + "\n"
+   str += fmt.Sprintf("%-59s %9d %9s\n",
+   "Total symbol size (i.e. excluding padding, etc.)", 
f.sumSize(), "")
return str
 }



[19/50] [abbrv] incubator-mynewt-newt git commit: This closes #39

2017-03-06 Thread marko
This closes #39

This patch improves the output of the size command. The output is now similar 
to `make ram_report` and `make rom_report` in Zephyr. New flags were added for 
this purpose:

Flags:
  -F, --flash   Print FLASH statistics
  -R, --ram Print RAM statistics

The size statistics are broken down into a tree-like structure, where
the leaves are symbols and branches are folders and files. For
each tree element there its size in bytes and percentage contribution
to the total size of the memory region.

```
Path   Size


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

Branch: refs/heads/master
Commit: 745efe95622cfb2e558b8c518230abf762e5cd05
Parents: 78d0066 4b91c27
Author: Sterling Hughes 
Authored: Thu Feb 23 09:59:37 2017 -0800
Committer: Sterling Hughes 
Committed: Thu Feb 23 09:59:37 2017 -0800

--
 newt/builder/size.go|  34 +++-
 newt/builder/size_report.go | 332 +++
 newt/builder/symbol_tree.go | 194 +++
 newt/cli/build_cmds.go  |  18 ++-
 4 files changed, 574 insertions(+), 4 deletions(-)
--




[41/50] [abbrv] incubator-mynewt-newt git commit: Add back "newt complete" and remove from help text. 1) Added "newt complete" support back. 2) Make the command hidden so it is not in the list of "Ava

2017-03-06 Thread marko
Add back "newt complete" and remove from help text.
1) Added "newt complete" support back.
2) Make the command hidden so it is not in the list of "Available Commands" in 
newt help.
3) Removed "newt complete" help text.


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

Branch: refs/heads/master
Commit: c24636335663b08a7583321ce64dc264e0c34454
Parents: abf65d3
Author: cwanda 
Authored: Thu Mar 2 20:25:57 2017 -0800
Committer: cwanda 
Committed: Thu Mar 2 20:51:08 2017 -0800

--
 newt/cli/complete_cmd.go | 14 +-
 newt/newt.go |  1 +
 2 files changed, 6 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/c2463633/newt/cli/complete_cmd.go
--
diff --git a/newt/cli/complete_cmd.go b/newt/cli/complete_cmd.go
index 272f928..ae3d39e 100644
--- a/newt/cli/complete_cmd.go
+++ b/newt/cli/complete_cmd.go
@@ -237,17 +237,13 @@ func completeRunCmd(cmd *cobra.Command, args []string) {
 }
 
 func AddCompleteCommands(cmd *cobra.Command) {
-   completeShortHelp := "Performs Bash Autocompletion (-C)"
-
-   completeLongHelp := completeShortHelp + ".\n\n" +
-   " this command reads environment variables COMP_LINE and 
COMP_POINT " +
-   " and will send completion options out stdout as one option per 
line  "
 
completeCmd := &cobra.Command{
-   Use:   "complete",
-   Short: completeShortHelp,
-   Long:  completeLongHelp,
-   Run:   completeRunCmd,
+   Use:"complete",
+   Short:  "",
+   Long:   "",
+   Run:completeRunCmd,
+   Hidden: true,
}
 
/* silence errors on the complete command because we have partial flags 
*/

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/c2463633/newt/newt.go
--
diff --git a/newt/newt.go b/newt/newt.go
index a09e57c..0dc8808 100644
--- a/newt/newt.go
+++ b/newt/newt.go
@@ -140,6 +140,7 @@ func main() {
cmd := newtCmd()
 
cli.AddBuildCommands(cmd)
+   cli.AddCompleteCommands(cmd)
cli.AddImageCommands(cmd)
cli.AddPackageCommands(cmd)
cli.AddProjectCommands(cmd)



[44/50] [abbrv] incubator-mynewt-newt git commit: 1) Fixed runtime exception when no argument is given to the "newtmgr conn add" and the "newtmgr conn delete" 2) Updated help texts.

2017-03-06 Thread marko
1) Fixed runtime exception when no argument is given to the
"newtmgr conn add" and the "newtmgr conn delete"
2) Updated help texts.


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

Branch: refs/heads/master
Commit: 56a2aed7bded17d7f11861e357c278e81d677b37
Parents: dce8b5c
Author: cwanda 
Authored: Fri Mar 3 00:23:44 2017 -0800
Committer: cwanda 
Committed: Fri Mar 3 17:56:47 2017 -0800

--
 newtmgr/cli/commands.go|  11 ++-
 newtmgr/cli/config.go  |   7 +-
 newtmgr/cli/connprofile.go |  14 ++-
 newtmgr/cli/crash.go   |   4 +-
 newtmgr/cli/datetime.go|   4 +-
 newtmgr/cli/echo.go|   4 +-
 newtmgr/cli/fs.go  |  10 +--
 newtmgr/cli/image.go   |  28 +++---
 newtmgr/cli/logs.go|  22 ++---
 newtmgr/cli/mpstats.go |   4 +-
 newtmgr/cli/reset.go   |   4 +-
 newtmgr/cli/runtest.go | 192 
 newtmgr/cli/stats.go   |   8 +-
 newtmgr/cli/taskstats.go   |   6 +-
 14 files changed, 167 insertions(+), 151 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/56a2aed7/newtmgr/cli/commands.go
--
diff --git a/newtmgr/cli/commands.go b/newtmgr/cli/commands.go
index e8f6c4e..8a5d526 100644
--- a/newtmgr/cli/commands.go
+++ b/newtmgr/cli/commands.go
@@ -29,12 +29,13 @@ import (
 
 var ConnProfileName string
 var NewtmgrLogLevel log.Level
+var NewtmgrHelp bool
 
 func Commands() *cobra.Command {
logLevelStr := ""
nmCmd := &cobra.Command{
Use:   "newtmgr",
-   Short: "Newtmgr helps you manage remote instances of the Mynewt 
OS.",
+   Short: "Newtmgr helps you manage devices running the Mynewt OS",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
NewtmgrLogLevel, err := log.ParseLevel(logLevelStr)
err = util.Init(NewtmgrLogLevel, "", 
util.VERBOSITY_DEFAULT)
@@ -48,14 +49,18 @@ func Commands() *cobra.Command {
}
 
nmCmd.PersistentFlags().StringVarP(&ConnProfileName, "conn", "c", "",
-   "connection profile to use.")
+   "connection profile to use")
 
nmCmd.PersistentFlags().StringVarP(&logLevelStr, "loglevel", "l", 
"info",
-   "log level to use (default INFO.)")
+   "log level to use")
 
nmCmd.PersistentFlags().BoolVarP(&nmutil.TraceLogEnabled, "trace", "t",
false, "print all bytes transmitted and received")
 
+   // Add the help flag so it shows up under Global Flags
+   nmCmd.PersistentFlags().BoolVarP(&NewtmgrHelp, "help", "h",
+   false, "Help for newtmgr commands")
+
nmCmd.AddCommand(configCmd())
nmCmd.AddCommand(connProfileCmd())
nmCmd.AddCommand(crashCmd())

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/56a2aed7/newtmgr/cli/config.go
--
diff --git a/newtmgr/cli/config.go b/newtmgr/cli/config.go
index 20f819d..a70d320 100644
--- a/newtmgr/cli/config.go
+++ b/newtmgr/cli/config.go
@@ -72,9 +72,12 @@ func configRunCmd(cmd *cobra.Command, args []string) {
 }
 
 func configCmd() *cobra.Command {
+   configCmdLongHelp := "Read or write a config value for  
variable on " +
+   "a device.\nSpecify a var-value to write a value to a device.\n"
statsCmd := &cobra.Command{
-   Use:   "config",
-   Short: "Read or write config value on target",
+   Use:   "config  [var-value] -c ",
+   Short: "Read or write a config value on a device",
+   Long:  configCmdLongHelp,
Run:   configRunCmd,
}
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/56a2aed7/newtmgr/cli/connprofile.go
--
diff --git a/newtmgr/cli/connprofile.go b/newtmgr/cli/connprofile.go
index fa90088..06d70e0 100644
--- a/newtmgr/cli/connprofile.go
+++ b/newtmgr/cli/connprofile.go
@@ -62,6 +62,11 @@ func connProfileAddCmd(cmd *cobra.Command, args []string) {
nmUsage(cmd, err)
}
 
+   // Connection Profile name required
+   if len(args) == 0 {
+   nmUsage(cmd, util.NewNewtError("Need connection profile name"))
+   }
+
name := args[0]
cp, err := config.NewConnProfile(name)
if err != nil {
@@ -161,6 +166,11 @@ func connProfileDelCmd(cmd *cobra.Command, args []string) 

[45/50] [abbrv] incubator-mynewt-newt git commit: Modified Newtmgr help text. It now says "Newtmgr helps you manage remote devices running the Mynewt OS"

2017-03-06 Thread marko
Modified Newtmgr help text.
It now says "Newtmgr helps you manage remote devices running the Mynewt OS"


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

Branch: refs/heads/master
Commit: ece9a763c5fe3f4d9b53f31020bcf351b3856d1d
Parents: 56a2aed
Author: cwanda 
Authored: Fri Mar 3 17:52:28 2017 -0800
Committer: cwanda 
Committed: Fri Mar 3 17:56:47 2017 -0800

--
 newtmgr/cli/commands.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/ece9a763/newtmgr/cli/commands.go
--
diff --git a/newtmgr/cli/commands.go b/newtmgr/cli/commands.go
index 8a5d526..2c957a7 100644
--- a/newtmgr/cli/commands.go
+++ b/newtmgr/cli/commands.go
@@ -35,7 +35,7 @@ func Commands() *cobra.Command {
logLevelStr := ""
nmCmd := &cobra.Command{
Use:   "newtmgr",
-   Short: "Newtmgr helps you manage devices running the Mynewt OS",
+   Short: "Newtmgr helps you manage remote devices running the 
Mynewt OS",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
NewtmgrLogLevel, err := log.ParseLevel(logLevelStr)
err = util.Init(NewtmgrLogLevel, "", 
util.VERBOSITY_DEFAULT)



[12/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-557 Warning override of undefined settings Added support to newt build command to print out warning message for override of undefined settings.

2017-03-06 Thread marko
MYNEWT-557 Warning override of undefined settings
Added support to newt build command to print out warning message for override 
of undefined settings.


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

Branch: refs/heads/master
Commit: efe36b3b7a9c742c1b023d7ac01ae68b8142
Parents: ec61f09
Author: cwanda 
Authored: Fri Feb 3 16:45:58 2017 -0800
Committer: cwanda 
Committed: Thu Feb 16 20:44:06 2017 -0800

--
 newt/builder/targetbuild.go | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/efe36b3a/newt/builder/targetbuild.go
--
diff --git a/newt/builder/targetbuild.go b/newt/builder/targetbuild.go
index 64710db..b8ac724 100644
--- a/newt/builder/targetbuild.go
+++ b/newt/builder/targetbuild.go
@@ -188,6 +188,13 @@ func (t *TargetBuilder) validateAndWriteCfg() error {
return util.NewNewtError(errText)
}
 
+   warningText := strings.TrimSpace(t.res.WarningText())
+   if warningText != "" {
+   for _, line := range strings.Split(warningText, "\n") {
+   log.Warn(line)
+   }
+   }
+
if err := syscfg.EnsureWritten(t.res.Cfg,
GeneratedIncludeDir(t.target.Name())); err != nil {
 



[01/50] [abbrv] incubator-mynewt-newt git commit: NOTICE; update copyright years to include 2017.

2017-03-06 Thread marko
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/master 16fb790ed -> d487ce62b


NOTICE; update copyright years to include 2017.


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

Branch: refs/heads/master
Commit: 60306bbac8d733d4166f0755d009e1f2c72268ee
Parents: 6f60a6c
Author: Marko Kiiskila 
Authored: Tue Feb 7 12:02:38 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 7 12:02:38 2017 -0800

--
 NOTICE | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/60306bba/NOTICE
--
diff --git a/NOTICE b/NOTICE
index 94bea73..8648ba9 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Apache Mynewt (incubating)
-Copyright 2015-2016 The Apache Software Foundation
+Copyright 2015-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).



[24/50] [abbrv] incubator-mynewt-newt git commit: MYNEWT-527; allow build machine OS dependent overrides in bsp.yml.

2017-03-06 Thread marko
MYNEWT-527; allow build machine OS dependent overrides in bsp.yml.


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

Branch: refs/heads/master
Commit: 0558e33c20f5be3551571bc65de9348d0eebb782
Parents: 5cb84eb
Author: Marko Kiiskila 
Authored: Mon Feb 27 21:02:51 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Feb 27 21:02:51 2017 -0800

--
 newt/pkg/bsp_package.go | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/0558e33c/newt/pkg/bsp_package.go
--
diff --git a/newt/pkg/bsp_package.go b/newt/pkg/bsp_package.go
index 572255c..146347f 100644
--- a/newt/pkg/bsp_package.go
+++ b/newt/pkg/bsp_package.go
@@ -20,6 +20,7 @@
 package pkg
 
 import (
+   "runtime"
"strings"
 
"mynewt.apache.org/newt/newt/flash"
@@ -101,6 +102,13 @@ func (bsp *BspPackage) resolveLinkerScriptSetting(
 func (bsp *BspPackage) Reload(features map[string]bool) error {
var err error
 
+   if features == nil {
+   features = map[string]bool{
+   strings.ToUpper(runtime.GOOS): true,
+   }
+   } else {
+   features[strings.ToUpper(runtime.GOOS)] = true
+   }
bsp.BspV, err = util.ReadConfig(bsp.BasePath(),
strings.TrimSuffix(BSP_YAML_FILENAME, ".yml"))
if err != nil {
@@ -131,7 +139,6 @@ func (bsp *BspPackage) Reload(features map[string]bool) 
error {
if err != nil {
return err
}
-
bsp.DebugScript, err = bsp.resolvePathSetting(
features, "bsp.debugscript")
if err != nil {



[17/50] [abbrv] incubator-mynewt-newt git commit: This closes #35.

2017-03-06 Thread marko
This closes #35.

MYNEWT-557 #close

Merge remote-tracking branch 'cwanda/MYNEWT-557' into develop

* cwanda/MYNEWT-557:
  MYNEWT-557 Print DEBUG message when overriding undefined setting
  MYNEWT-557 Warning override of undefined settings Added support to newt build 
command to print out warning message for override of undefined settings.


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

Branch: refs/heads/master
Commit: 78d0066724a4768773c0c5a0f2ddb74db055bffc
Parents: c0cd08d da53ca9
Author: Christopher Collins 
Authored: Sat Feb 18 08:58:20 2017 -0800
Committer: Christopher Collins 
Committed: Sat Feb 18 08:58:20 2017 -0800

--
 newt/builder/targetbuild.go | 7 +++
 1 file changed, 7 insertions(+)
--




[42/50] [abbrv] incubator-mynewt-newt git commit: This closes #46.

2017-03-06 Thread marko
This closes #46.

Merge branch 'newt' of https://github.com/cwanda/incubator-mynewt-newt into 
develop


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

Branch: refs/heads/master
Commit: 386c087891b3baec68c83bddae19ff6a6edcaeff
Parents: abf65d3 c246363
Author: Marko Kiiskila 
Authored: Thu Mar 2 21:00:14 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 21:00:14 2017 -0800

--
 newt/cli/complete_cmd.go | 14 +-
 newt/newt.go |  1 +
 2 files changed, 6 insertions(+), 9 deletions(-)
--




[43/50] [abbrv] incubator-mynewt-newt git commit: This closes #45.

2017-03-06 Thread marko
This closes #45.

Merge branch 'mynewt-651' of https://github.com/mkiiskila/incubator-mynewt-newt 
into develop


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

Branch: refs/heads/master
Commit: dce8b5cd06d280b98f65bae8d21702a70fc8bc38
Parents: 386c087 9a13ff3
Author: Marko Kiiskila 
Authored: Fri Mar 3 10:19:30 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Mar 3 10:19:30 2017 -0800

--
 newt/builder/size.go| 209 +++
 newt/builder/targetbuild.go |  10 ++
 newt/image/image.go |  80 ++-
 3 files changed, 257 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/dce8b5cd/newt/builder/targetbuild.go
--

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/dce8b5cd/newt/image/image.go
--



[48/50] [abbrv] incubator-mynewt-newt git commit: 1) Updated newtmgr crash Usage text: crash test argument required. 2) Updated datetime.go - Moved datetime format examples from error message to Help

2017-03-06 Thread marko
1) Updated newtmgr crash Usage text: crash test argument required.
2) Updated datetime.go - Moved datetime format examples from error message
   to Help Text examples.
3) Minor formatting for image.go help text
4) Update newtmgr stat command help text:
a) added stat_name argument in newtmgr stat usage text
b) updated list subcommand help text to say list of "Stat names" instead
   "statistics".
5) Added more help text  to newtmgr conn show command.
6) Updated help text for newtmgr log command.


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

Branch: refs/heads/master
Commit: b9ca647d6cf8996ca74dd96ddd9b589371ceea90
Parents: 7ecee8b
Author: cwanda 
Authored: Sun Mar 5 04:58:23 2017 -0800
Committer: cwanda 
Committed: Sun Mar 5 15:23:25 2017 -0800

--
 newtmgr/cli/connprofile.go |  9 +++--
 newtmgr/cli/crash.go   |  4 ++--
 newtmgr/cli/datetime.go| 34 +++---
 newtmgr/cli/image.go   |  6 +++---
 newtmgr/cli/logs.go|  2 +-
 newtmgr/cli/runtest.go | 13 +
 newtmgr/cli/stats.go   |  6 --
 7 files changed, 49 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b9ca647d/newtmgr/cli/connprofile.go
--
diff --git a/newtmgr/cli/connprofile.go b/newtmgr/cli/connprofile.go
index 06d70e0..547d185 100644
--- a/newtmgr/cli/connprofile.go
+++ b/newtmgr/cli/connprofile.go
@@ -190,7 +190,7 @@ func connProfileCmd() *cobra.Command {
}
 
addCmd := &cobra.Command{
-   Use:   "add  [varname=value ...] ",
+   Use:   "add   ",
Short: "Add a newtmgr connection profile",
Run:   connProfileAddCmd,
}
@@ -203,9 +203,14 @@ func connProfileCmd() *cobra.Command {
}
cpCmd.AddCommand(deleCmd)
 
+   connShowHelpText := "Show information for the conn_profile connection "
+   connShowHelpText += "profile or for all\nconnection profiles "
+   connShowHelpText += "if conn_profile is not specified.\n"
+
showCmd := &cobra.Command{
-   Use:   "show",
+   Use:   "show [conn_profile]",
Short: "Show newtmgr connection profiles",
+   Long:  connShowHelpText,
Run:   connProfileShowCmd,
}
cpCmd.AddCommand(showCmd)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b9ca647d/newtmgr/cli/crash.go
--
diff --git a/newtmgr/cli/crash.go b/newtmgr/cli/crash.go
index 941b6de..553572b 100644
--- a/newtmgr/cli/crash.go
+++ b/newtmgr/cli/crash.go
@@ -87,8 +87,8 @@ func crashCmd() *cobra.Command {
crashEx := "   newtmgr -c olimex crash div0\n"
 
crashCmd := &cobra.Command{
-   Use: "crash [div0|jump0|ref0|assert|wdog] -c 
",
-   Short:   "Send crash command to a device",
+   Use: "crash  -c 
",
+   Short:   "Send a crash command to a device",
Example: crashEx,
Run: crashRunCmd,
}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b9ca647d/newtmgr/cli/datetime.go
--
diff --git a/newtmgr/cli/datetime.go b/newtmgr/cli/datetime.go
index 34fd471..c71cb1b 100644
--- a/newtmgr/cli/datetime.go
+++ b/newtmgr/cli/datetime.go
@@ -61,14 +61,7 @@ func dateTimeCmd(cmd *cobra.Command, args []string) {
nmUsage(cmd, err)
}
 
-   err_str := "Command: datetime\n" +
-   "For writing datetime \n" +
-   "Need to specify a datetime in RFC 3339 format\n" +
-   "2016-03-02T22:44:00  UTC time (implicit)\n" +
-   "2016-03-02T22:44:00Z UTC time (explicit)\n" +
-   "2016-03-02T22:44:00-08:00PST timezone\n" +
-   "2016-03-02T22:44:00.1fractional seconds\n" +
-   "2016-03-02T22:44:00.101+05:30fractional seconds with 
timezone\n"
+   err_str := "Need to specify a datetime in RFC 3339 format\n"
 
if len(args) > 1 {
nmUsage(cmd, util.NewNewtError(err_str))
@@ -85,10 +78,29 @@ func dateTimeCmd(cmd *cobra.Command, args []string) {
 }
 
 func dTimeCmd() *cobra.Command {
+   dateTimeHelpText := "Display or set datetime on a device. "
+   dateTimeHelpText += "Specify a datetime-value\n"
+   dateTimeHelpText += 

[47/50] [abbrv] incubator-mynewt-newt git commit: There are two issues here:

2017-03-06 Thread marko
There are two issues here:

1. newtmgr tool always includes an extraneous rc:0 key-value pair in its
   outgoing datetime commands.
2. Server-side, the firmware parses the "rc" value and writes the result
   to null.

This commit addresses the first issue: Remove the rc entry from the
datetime request.


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

Branch: refs/heads/master
Commit: 7ecee8b5c805fe315f25ad163b89f9b7c74c3aae
Parents: 761cdc2
Author: Christopher Collins 
Authored: Sat Mar 4 14:27:45 2017 -0800
Committer: Christopher Collins 
Committed: Sat Mar 4 14:27:45 2017 -0800

--
 newtmgr/protocol/datetime.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7ecee8b5/newtmgr/protocol/datetime.go
--
diff --git a/newtmgr/protocol/datetime.go b/newtmgr/protocol/datetime.go
index 451b84a..3f213f6 100644
--- a/newtmgr/protocol/datetime.go
+++ b/newtmgr/protocol/datetime.go
@@ -28,7 +28,7 @@ import (
 
 type DateTime struct {
DateTime string `codec:"datetime"`
-   Return   uint64 `codec:"rc"`
+   Return   uint64 `codec:"rc,omitempty"`
 }
 
 func NewDateTime() (*DateTime, error) {



[50/50] [abbrv] incubator-mynewt-newt git commit: Bring in changes from develop branch.

2017-03-06 Thread marko
Bring in changes from develop branch.

Merge branch 'develop' of 
https://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt


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

Branch: refs/heads/master
Commit: d487ce62baeab4b19dbce077f24923abaafd3adf
Parents: 16fb790 1fb9697
Author: Marko Kiiskila 
Authored: Mon Mar 6 12:57:30 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Mar 6 12:57:30 2017 -0800

--
 NOTICE  |   2 +-
 newt/builder/build.go   | 393 
 newt/builder/buildpackage.go| 147 +--
 newt/builder/buildutil.go   |  60 +-
 newt/builder/depgraph.go| 174 
 newt/builder/library.go |   3 +-
 newt/builder/load.go|  49 +-
 newt/builder/paths.go   |  68 +-
 newt/builder/selftest.go| 174 
 newt/builder/size.go| 239 -
 newt/builder/size_report.go | 332 +++
 newt/builder/symbol_tree.go | 195 
 newt/builder/targetbuild.go | 387 +---
 newt/cli/build_cmds.go  | 141 +--
 newt/cli/complete_cmd.go|  97 +-
 newt/cli/image_cmds.go  |  23 +-
 newt/cli/mfg_cmds.go|  50 +-
 newt/cli/pkg_cmds.go| 218 +++-
 newt/cli/project_cmds.go|  32 +-
 newt/cli/run_cmds.go|  87 +-
 newt/cli/target_cmds.go | 407 ++--
 newt/cli/util.go| 141 ++-
 newt/cli/vals_cmds.go   |   2 +-
 newt/cli/vars.go|   3 -
 newt/downloader/downloader.go   |  36 +-
 newt/image/image.go | 336 ++-
 newt/interfaces/interfaces.go   |   1 +
 newt/mfg/create.go  |   2 +
 newt/mfg/mfg.go |   7 +
 newt/newt.go|  28 +-
 newt/newtutil/newtutil.go   |  64 +-
 newt/pkg/bsp_package.go |   9 +-
 newt/pkg/localpackage.go| 112 +--
 newt/pkg/package.go |  27 +-
 newt/pkg/packageutil.go |   2 +-
 newt/project/project.go |  31 +-
 newt/repo/repo.go   | 118 ++-
 newt/resolve/resolve.go | 466 +
 newt/resolve/resolveutil.go |  92 ++
 newt/syscfg/syscfg.go   | 176 +++-
 newt/sysinit/sysinit.go |  53 +-
 newt/toolchain/compiler.go  | 665 -
 newt/toolchain/deps.go  |  35 +-
 newt/vendor/mynewt.apache.org/newt/util/util.go | 120 ++-
 newtmgr/Godeps/Godeps.json  |  32 +-
 newtmgr/cli/commands.go |  26 +-
 newtmgr/cli/config.go   |   7 +-
 newtmgr/cli/connprofile.go  |  21 +-
 newtmgr/cli/crash.go|   4 +-
 newtmgr/cli/datetime.go |  34 +-
 newtmgr/cli/echo.go |   4 +-
 newtmgr/cli/fs.go   | 216 
 newtmgr/cli/image.go| 223 +
 newtmgr/cli/logs.go |  46 +-
 newtmgr/cli/mpstats.go  |  13 +-
 newtmgr/cli/reset.go|   4 +-
 newtmgr/cli/runtest.go  | 118 ++-
 newtmgr/cli/stats.go|  10 +-
 newtmgr/cli/taskstats.go|   6 +-
 newtmgr/protocol/coreerase.go   |   2 +-
 newtmgr/protocol/corelist.go|   2 +-
 newtmgr/protocol/coreload.go|   2 +-
 newtmgr/protocol/datetime.go|   2 +-
 newtmgr/protocol/defs.go|   3 +-
 newtmgr/protocol/fsdefs.go  |  24 +
 newtmgr/protocol/fsdownload.go  | 102 ++
 newtmgr/protocol/fsupload.go| 104 ++
 newtmgr/protocol/imagedefs.go   |   9 +-
 newtmgr/protocol/imagefiledownload.go   | 102 --
 newtmgr/protocol/imagefileupload.go | 104 --
 newtmgr/protocol/imagestate.go  |   5 +-
 newtmgr/protocol/imageupload.go

[49/50] [abbrv] incubator-mynewt-newt git commit: This closes #50.

2017-03-06 Thread marko
This closes #50.

Merge branch 'newtmgr' of https://github.com/cwanda/incubator-mynewt-newt into 
develop


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

Branch: refs/heads/master
Commit: 1fb9697cc64abc1b42ea6f037dbd245f29b904df
Parents: 7ecee8b b9ca647
Author: Marko Kiiskila 
Authored: Mon Mar 6 10:11:25 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Mar 6 10:11:25 2017 -0800

--
 newtmgr/cli/connprofile.go |  9 +++--
 newtmgr/cli/crash.go   |  4 ++--
 newtmgr/cli/datetime.go| 34 +++---
 newtmgr/cli/image.go   |  6 +++---
 newtmgr/cli/logs.go|  2 +-
 newtmgr/cli/runtest.go | 13 +
 newtmgr/cli/stats.go   |  6 --
 7 files changed, 49 insertions(+), 25 deletions(-)
--




[46/50] [abbrv] incubator-mynewt-newt git commit: This closes #47.

2017-03-06 Thread marko
This closes #47.

Merge branch 'newtmgr' of https://github.com/cwanda/incubator-mynewt-newt into 
develop


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

Branch: refs/heads/master
Commit: 761cdc25dea9f18d6deb4034fd518221861ed8e2
Parents: dce8b5c ece9a76
Author: Marko Kiiskila 
Authored: Fri Mar 3 22:18:31 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Mar 3 22:18:31 2017 -0800

--
 newtmgr/cli/commands.go|  11 ++-
 newtmgr/cli/config.go  |   7 +-
 newtmgr/cli/connprofile.go |  14 ++-
 newtmgr/cli/crash.go   |   4 +-
 newtmgr/cli/datetime.go|   4 +-
 newtmgr/cli/echo.go|   4 +-
 newtmgr/cli/fs.go  |  10 +--
 newtmgr/cli/image.go   |  28 +++---
 newtmgr/cli/logs.go|  22 ++---
 newtmgr/cli/mpstats.go |   4 +-
 newtmgr/cli/reset.go   |   4 +-
 newtmgr/cli/runtest.go | 192 
 newtmgr/cli/stats.go   |   8 +-
 newtmgr/cli/taskstats.go   |   6 +-
 14 files changed, 167 insertions(+), 151 deletions(-)
--




[2/2] incubator-mynewt-newt git commit: This closes #50.

2017-03-06 Thread marko
This closes #50.

Merge branch 'newtmgr' of https://github.com/cwanda/incubator-mynewt-newt into 
develop


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

Branch: refs/heads/develop
Commit: 1fb9697cc64abc1b42ea6f037dbd245f29b904df
Parents: 7ecee8b b9ca647
Author: Marko Kiiskila 
Authored: Mon Mar 6 10:11:25 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Mar 6 10:11:25 2017 -0800

--
 newtmgr/cli/connprofile.go |  9 +++--
 newtmgr/cli/crash.go   |  4 ++--
 newtmgr/cli/datetime.go| 34 +++---
 newtmgr/cli/image.go   |  6 +++---
 newtmgr/cli/logs.go|  2 +-
 newtmgr/cli/runtest.go | 13 +
 newtmgr/cli/stats.go   |  6 --
 7 files changed, 49 insertions(+), 25 deletions(-)
--




[1/2] incubator-mynewt-newt git commit: 1) Updated newtmgr crash Usage text: crash test argument required. 2) Updated datetime.go - Moved datetime format examples from error message to Help Text examp

2017-03-06 Thread marko
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 7ecee8b5c -> 1fb9697cc


1) Updated newtmgr crash Usage text: crash test argument required.
2) Updated datetime.go - Moved datetime format examples from error message
   to Help Text examples.
3) Minor formatting for image.go help text
4) Update newtmgr stat command help text:
a) added stat_name argument in newtmgr stat usage text
b) updated list subcommand help text to say list of "Stat names" instead
   "statistics".
5) Added more help text  to newtmgr conn show command.
6) Updated help text for newtmgr log command.


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

Branch: refs/heads/develop
Commit: b9ca647d6cf8996ca74dd96ddd9b589371ceea90
Parents: 7ecee8b
Author: cwanda 
Authored: Sun Mar 5 04:58:23 2017 -0800
Committer: cwanda 
Committed: Sun Mar 5 15:23:25 2017 -0800

--
 newtmgr/cli/connprofile.go |  9 +++--
 newtmgr/cli/crash.go   |  4 ++--
 newtmgr/cli/datetime.go| 34 +++---
 newtmgr/cli/image.go   |  6 +++---
 newtmgr/cli/logs.go|  2 +-
 newtmgr/cli/runtest.go | 13 +
 newtmgr/cli/stats.go   |  6 --
 7 files changed, 49 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b9ca647d/newtmgr/cli/connprofile.go
--
diff --git a/newtmgr/cli/connprofile.go b/newtmgr/cli/connprofile.go
index 06d70e0..547d185 100644
--- a/newtmgr/cli/connprofile.go
+++ b/newtmgr/cli/connprofile.go
@@ -190,7 +190,7 @@ func connProfileCmd() *cobra.Command {
}
 
addCmd := &cobra.Command{
-   Use:   "add  [varname=value ...] ",
+   Use:   "add   ",
Short: "Add a newtmgr connection profile",
Run:   connProfileAddCmd,
}
@@ -203,9 +203,14 @@ func connProfileCmd() *cobra.Command {
}
cpCmd.AddCommand(deleCmd)
 
+   connShowHelpText := "Show information for the conn_profile connection "
+   connShowHelpText += "profile or for all\nconnection profiles "
+   connShowHelpText += "if conn_profile is not specified.\n"
+
showCmd := &cobra.Command{
-   Use:   "show",
+   Use:   "show [conn_profile]",
Short: "Show newtmgr connection profiles",
+   Long:  connShowHelpText,
Run:   connProfileShowCmd,
}
cpCmd.AddCommand(showCmd)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b9ca647d/newtmgr/cli/crash.go
--
diff --git a/newtmgr/cli/crash.go b/newtmgr/cli/crash.go
index 941b6de..553572b 100644
--- a/newtmgr/cli/crash.go
+++ b/newtmgr/cli/crash.go
@@ -87,8 +87,8 @@ func crashCmd() *cobra.Command {
crashEx := "   newtmgr -c olimex crash div0\n"
 
crashCmd := &cobra.Command{
-   Use: "crash [div0|jump0|ref0|assert|wdog] -c 
",
-   Short:   "Send crash command to a device",
+   Use: "crash  -c 
",
+   Short:   "Send a crash command to a device",
Example: crashEx,
Run: crashRunCmd,
}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b9ca647d/newtmgr/cli/datetime.go
--
diff --git a/newtmgr/cli/datetime.go b/newtmgr/cli/datetime.go
index 34fd471..c71cb1b 100644
--- a/newtmgr/cli/datetime.go
+++ b/newtmgr/cli/datetime.go
@@ -61,14 +61,7 @@ func dateTimeCmd(cmd *cobra.Command, args []string) {
nmUsage(cmd, err)
}
 
-   err_str := "Command: datetime\n" +
-   "For writing datetime \n" +
-   "Need to specify a datetime in RFC 3339 format\n" +
-   "2016-03-02T22:44:00  UTC time (implicit)\n" +
-   "2016-03-02T22:44:00Z UTC time (explicit)\n" +
-   "2016-03-02T22:44:00-08:00PST timezone\n" +
-   "2016-03-02T22:44:00.1fractional seconds\n" +
-   "2016-03-02T22:44:00.101+05:30fractional seconds with 
timezone\n"
+   err_str := "Need to specify a datetime in RFC 3339 format\n"
 
if len(args) > 1 {
nmUsage(cmd, util.NewNewtError(err_str))
@@ -85,10 +78,29 @@ func dateTimeCmd(cmd *cobra.Command, args []string) {
 }
 
 func dTimeCmd() *cobra.Command {
+   dateTimeHelpText := "Display or set datetime o

incubator-mynewt-core git commit: MYNEWT-527; fix OVERRIDE -> OVERWRITE

2017-03-04 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 636150188 -> bc1c683f5


MYNEWT-527; fix OVERRIDE -> OVERWRITE


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

Branch: refs/heads/develop
Commit: bc1c683f5a1eb13cd2e10ed26f69238bff65b863
Parents: 6361501
Author: Marko Kiiskila 
Authored: Sat Mar 4 19:20:35 2017 -0800
Committer: Marko Kiiskila 
Committed: Sat Mar 4 19:20:35 2017 -0800

--
 hw/bsp/bmd200/bsp.yml | 2 +-
 hw/bsp/bmd300eval/bsp.yml | 4 ++--
 hw/bsp/frdm-k64f/bsp.yml  | 4 ++--
 hw/bsp/nrf51-arduino_101/bsp.yml  | 4 ++--
 hw/bsp/nrf51dk-16kbram/bsp.yml| 4 ++--
 hw/bsp/nrf51dk/bsp.yml| 4 ++--
 hw/bsp/nrf52840pdk/bsp.yml| 4 ++--
 hw/bsp/nrf52dk/bsp.yml| 4 ++--
 hw/bsp/nucleo-f401re/bsp.yml  | 4 ++--
 hw/bsp/olimex_stm32-e407_devboard/bsp.yml | 4 ++--
 hw/bsp/rb-nano2/bsp.yml   | 4 ++--
 hw/bsp/stm32f4discovery/bsp.yml   | 4 ++--
 hw/bsp/usbmkw41z/bsp.yml  | 4 ++--
 13 files changed, 25 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bc1c683f/hw/bsp/bmd200/bsp.yml
--
diff --git a/hw/bsp/bmd200/bsp.yml b/hw/bsp/bmd200/bsp.yml
index 3fe1275..388966d 100644
--- a/hw/bsp/bmd200/bsp.yml
+++ b/hw/bsp/bmd200/bsp.yml
@@ -28,7 +28,7 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
 bsp.part2linkerscript: "hw/bsp/bmd200/split-nrf51dk.ld"
 bsp.downloadscript: "hw/bsp/bmd200/nrf51dk_download.sh"
 bsp.debugscript: "hw/bsp/bmd200/nrf51dk_debug.sh"
-bsp.downloadscript.WINDOWS.OVERRIDE: "hw/bsp/bmd200/nrf51dk_download.cmd"
+bsp.downloadscript.WINDOWS.OVERWRITE: "hw/bsp/bmd200/nrf51dk_download.cmd"
 bsp.debugscript.WINDOWS.OVERWRITE: "hw/bsp/bmd200/nrf51dk_debug.cmd"
 
 bsp.flash_map:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bc1c683f/hw/bsp/bmd300eval/bsp.yml
--
diff --git a/hw/bsp/bmd300eval/bsp.yml b/hw/bsp/bmd300eval/bsp.yml
index f3a9a5d..68920b3 100644
--- a/hw/bsp/bmd300eval/bsp.yml
+++ b/hw/bsp/bmd300eval/bsp.yml
@@ -28,8 +28,8 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
 bsp.part2linkerscript: "hw/bsp/bmd300eval/split-bmd300eval.ld"
 bsp.downloadscript: "hw/bsp/bmd300eval/bmd300eval_download.sh"
 bsp.debugscript: "hw/bsp/bmd300eval/bmd300eval_debug.sh"
-bsp.downloadscript.WINDOWS.OVERRIDE: 
"hw/bsp/bmd300eval/bmd300eval_download.cmd"
-bsp.debugscript.WINDOWS.OVERRIDE: "hw/bsp/bmd300eval/bmd300eval_debug.cmd"
+bsp.downloadscript.WINDOWS.OVERWRITE: 
"hw/bsp/bmd300eval/bmd300eval_download.cmd"
+bsp.debugscript.WINDOWS.OVERWRITE: "hw/bsp/bmd300eval/bmd300eval_debug.cmd"
 
 bsp.flash_map:
 areas:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bc1c683f/hw/bsp/frdm-k64f/bsp.yml
--
diff --git a/hw/bsp/frdm-k64f/bsp.yml b/hw/bsp/frdm-k64f/bsp.yml
index a771696..0da1a9a 100644
--- a/hw/bsp/frdm-k64f/bsp.yml
+++ b/hw/bsp/frdm-k64f/bsp.yml
@@ -23,8 +23,8 @@ bsp.linkerscript: "hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld"
 bsp.linkerscript.BOOT_LOADER.OVERWRITE: 
"hw/bsp/frdm-k64f/boot-MK64FN1M0xxx12_flash.ld"
 bsp.downloadscript: "hw/bsp/frdm-k64f/frdm-k64_download.sh"
 bsp.debugscript: "hw/bsp/frdm-k64f/frdm-k64_debug.sh"
-bsp.downloadscript.WINDOWS.OVERRIDE: "hw/bsp/frdm-k64f/frdm-k64_download.cmd"
-bsp.debugscript.WINDOWS.OVERRIDE: "hw/bsp/frdm-k64f/frdm-k64_debug.cmd"
+bsp.downloadscript.WINDOWS.OVERWRITE: "hw/bsp/frdm-k64f/frdm-k64_download.cmd"
+bsp.debugscript.WINDOWS.OVERWRITE: "hw/bsp/frdm-k64f/frdm-k64_debug.cmd"
 
 bsp.flash_map:
 areas:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bc1c683f/hw/bsp/nrf51-arduino_101/bsp.yml
--
diff --git a/hw/bsp/nrf51-arduino_101/bsp.yml b/hw/bsp/nrf51-arduino_101/bsp.yml
index 7a75151..1b2cf94 100644
--- a/hw/bsp/nrf51-arduino_101/bsp.yml
+++ b/hw/bsp/nrf51-arduino_101/bsp.yml
@@ -27,8 +27,8 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
 - "hw/mcu/nordic/nrf51xxx/nrf51.ld"
 bsp.downloadscript: "hw/bsp/nrf51-arduino_101/nrf51dk-16kbram_download.sh"

[3/3] incubator-mynewt-newt git commit: This closes #47.

2017-03-03 Thread marko
This closes #47.

Merge branch 'newtmgr' of https://github.com/cwanda/incubator-mynewt-newt into 
develop


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

Branch: refs/heads/develop
Commit: 761cdc25dea9f18d6deb4034fd518221861ed8e2
Parents: dce8b5c ece9a76
Author: Marko Kiiskila 
Authored: Fri Mar 3 22:18:31 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Mar 3 22:18:31 2017 -0800

--
 newtmgr/cli/commands.go|  11 ++-
 newtmgr/cli/config.go  |   7 +-
 newtmgr/cli/connprofile.go |  14 ++-
 newtmgr/cli/crash.go   |   4 +-
 newtmgr/cli/datetime.go|   4 +-
 newtmgr/cli/echo.go|   4 +-
 newtmgr/cli/fs.go  |  10 +--
 newtmgr/cli/image.go   |  28 +++---
 newtmgr/cli/logs.go|  22 ++---
 newtmgr/cli/mpstats.go |   4 +-
 newtmgr/cli/reset.go   |   4 +-
 newtmgr/cli/runtest.go | 192 
 newtmgr/cli/stats.go   |   8 +-
 newtmgr/cli/taskstats.go   |   6 +-
 14 files changed, 167 insertions(+), 151 deletions(-)
--




[2/3] incubator-mynewt-newt git commit: 1) Fixed runtime exception when no argument is given to the "newtmgr conn add" and the "newtmgr conn delete" 2) Updated help texts.

2017-03-03 Thread marko
1) Fixed runtime exception when no argument is given to the
"newtmgr conn add" and the "newtmgr conn delete"
2) Updated help texts.


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

Branch: refs/heads/develop
Commit: 56a2aed7bded17d7f11861e357c278e81d677b37
Parents: dce8b5c
Author: cwanda 
Authored: Fri Mar 3 00:23:44 2017 -0800
Committer: cwanda 
Committed: Fri Mar 3 17:56:47 2017 -0800

--
 newtmgr/cli/commands.go|  11 ++-
 newtmgr/cli/config.go  |   7 +-
 newtmgr/cli/connprofile.go |  14 ++-
 newtmgr/cli/crash.go   |   4 +-
 newtmgr/cli/datetime.go|   4 +-
 newtmgr/cli/echo.go|   4 +-
 newtmgr/cli/fs.go  |  10 +--
 newtmgr/cli/image.go   |  28 +++---
 newtmgr/cli/logs.go|  22 ++---
 newtmgr/cli/mpstats.go |   4 +-
 newtmgr/cli/reset.go   |   4 +-
 newtmgr/cli/runtest.go | 192 
 newtmgr/cli/stats.go   |   8 +-
 newtmgr/cli/taskstats.go   |   6 +-
 14 files changed, 167 insertions(+), 151 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/56a2aed7/newtmgr/cli/commands.go
--
diff --git a/newtmgr/cli/commands.go b/newtmgr/cli/commands.go
index e8f6c4e..8a5d526 100644
--- a/newtmgr/cli/commands.go
+++ b/newtmgr/cli/commands.go
@@ -29,12 +29,13 @@ import (
 
 var ConnProfileName string
 var NewtmgrLogLevel log.Level
+var NewtmgrHelp bool
 
 func Commands() *cobra.Command {
logLevelStr := ""
nmCmd := &cobra.Command{
Use:   "newtmgr",
-   Short: "Newtmgr helps you manage remote instances of the Mynewt 
OS.",
+   Short: "Newtmgr helps you manage devices running the Mynewt OS",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
NewtmgrLogLevel, err := log.ParseLevel(logLevelStr)
err = util.Init(NewtmgrLogLevel, "", 
util.VERBOSITY_DEFAULT)
@@ -48,14 +49,18 @@ func Commands() *cobra.Command {
}
 
nmCmd.PersistentFlags().StringVarP(&ConnProfileName, "conn", "c", "",
-   "connection profile to use.")
+   "connection profile to use")
 
nmCmd.PersistentFlags().StringVarP(&logLevelStr, "loglevel", "l", 
"info",
-   "log level to use (default INFO.)")
+   "log level to use")
 
nmCmd.PersistentFlags().BoolVarP(&nmutil.TraceLogEnabled, "trace", "t",
false, "print all bytes transmitted and received")
 
+   // Add the help flag so it shows up under Global Flags
+   nmCmd.PersistentFlags().BoolVarP(&NewtmgrHelp, "help", "h",
+   false, "Help for newtmgr commands")
+
nmCmd.AddCommand(configCmd())
nmCmd.AddCommand(connProfileCmd())
nmCmd.AddCommand(crashCmd())

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/56a2aed7/newtmgr/cli/config.go
--
diff --git a/newtmgr/cli/config.go b/newtmgr/cli/config.go
index 20f819d..a70d320 100644
--- a/newtmgr/cli/config.go
+++ b/newtmgr/cli/config.go
@@ -72,9 +72,12 @@ func configRunCmd(cmd *cobra.Command, args []string) {
 }
 
 func configCmd() *cobra.Command {
+   configCmdLongHelp := "Read or write a config value for  
variable on " +
+   "a device.\nSpecify a var-value to write a value to a device.\n"
statsCmd := &cobra.Command{
-   Use:   "config",
-   Short: "Read or write config value on target",
+   Use:   "config  [var-value] -c ",
+   Short: "Read or write a config value on a device",
+   Long:  configCmdLongHelp,
Run:   configRunCmd,
}
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/56a2aed7/newtmgr/cli/connprofile.go
--
diff --git a/newtmgr/cli/connprofile.go b/newtmgr/cli/connprofile.go
index fa90088..06d70e0 100644
--- a/newtmgr/cli/connprofile.go
+++ b/newtmgr/cli/connprofile.go
@@ -62,6 +62,11 @@ func connProfileAddCmd(cmd *cobra.Command, args []string) {
nmUsage(cmd, err)
}
 
+   // Connection Profile name required
+   if len(args) == 0 {
+   nmUsage(cmd, util.NewNewtError("Need connection profile name"))
+   }
+
name := args[0]
cp, err := config.NewConnProfile(name)
if err != nil {
@@ -161,6 +166,11 @@ func connProfileDelCmd(cmd *cobra.Command, args []string)

[1/3] incubator-mynewt-newt git commit: Modified Newtmgr help text. It now says "Newtmgr helps you manage remote devices running the Mynewt OS"

2017-03-03 Thread marko
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop dce8b5cd0 -> 761cdc25d


Modified Newtmgr help text.
It now says "Newtmgr helps you manage remote devices running the Mynewt OS"


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

Branch: refs/heads/develop
Commit: ece9a763c5fe3f4d9b53f31020bcf351b3856d1d
Parents: 56a2aed
Author: cwanda 
Authored: Fri Mar 3 17:52:28 2017 -0800
Committer: cwanda 
Committed: Fri Mar 3 17:56:47 2017 -0800

--
 newtmgr/cli/commands.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/ece9a763/newtmgr/cli/commands.go
--
diff --git a/newtmgr/cli/commands.go b/newtmgr/cli/commands.go
index 8a5d526..2c957a7 100644
--- a/newtmgr/cli/commands.go
+++ b/newtmgr/cli/commands.go
@@ -35,7 +35,7 @@ func Commands() *cobra.Command {
logLevelStr := ""
nmCmd := &cobra.Command{
Use:   "newtmgr",
-   Short: "Newtmgr helps you manage devices running the Mynewt OS",
+   Short: "Newtmgr helps you manage remote devices running the 
Mynewt OS",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
NewtmgrLogLevel, err := log.ParseLevel(logLevelStr)
err = util.Init(NewtmgrLogLevel, "", 
util.VERBOSITY_DEFAULT)



incubator-mynewt-core git commit: MYNEWT-527; nrf51-blenano fix typo in bsp.yml.

2017-03-03 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop b2ea1dc2c -> 84edc0e89


MYNEWT-527; nrf51-blenano fix typo in bsp.yml.


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

Branch: refs/heads/develop
Commit: 84edc0e894866bf4b27de4cb05dddfa418a00445
Parents: b2ea1dc
Author: Marko Kiiskila 
Authored: Fri Mar 3 22:00:00 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Mar 3 22:00:00 2017 -0800

--
 hw/bsp/nrf51-blenano/bsp.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/84edc0e8/hw/bsp/nrf51-blenano/bsp.yml
--
diff --git a/hw/bsp/nrf51-blenano/bsp.yml b/hw/bsp/nrf51-blenano/bsp.yml
index ee95b51..c72efec 100644
--- a/hw/bsp/nrf51-blenano/bsp.yml
+++ b/hw/bsp/nrf51-blenano/bsp.yml
@@ -28,8 +28,8 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
 bsp.part2linkerscript: "hw/bsp/nrf51-blenano/split-nrf51dk.ld"
 bsp.downloadscript: "hw/bsp/nrf51-blenano/nrf51dk_download.sh"
 bsp.debugscript: "hw/bsp/nrf51-blenano/nrf51dk_debug.sh"
-bsp.downloadscript.WINDOWS.OVERRIDE: 
"hw/bsp/nrf51-blenano/nrf51dk_download.cmd"
-bsp.debugscript.WINDOWS.OVERRIDE: "hw/bsp/nrf51-blenano/nrf51dk_debug.cmd"
+bsp.downloadscript.WINDOWS.OVERWRITE: 
"hw/bsp/nrf51-blenano/nrf51dk_download.cmd"
+bsp.debugscript.WINDOWS.OVERWRITE: "hw/bsp/nrf51-blenano/nrf51dk_debug.cmd"
 
 bsp.flash_map:
 areas:



[3/4] incubator-mynewt-newt git commit: MYNEWT-651; fix go formatting.

2017-03-03 Thread marko
MYNEWT-651; fix go formatting.


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

Branch: refs/heads/develop
Commit: 9a13ff3082966622d0beb76c9a64d621f7fb30c3
Parents: 15cfc60
Author: Marko Kiiskila 
Authored: Thu Mar 2 15:37:47 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 15:37:47 2017 -0800

--
 newt/builder/size.go |  2 +-
 newt/image/image.go  | 10 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/9a13ff30/newt/builder/size.go
--
diff --git a/newt/builder/size.go b/newt/builder/size.go
index 70b4dc2..7cdcc45 100644
--- a/newt/builder/size.go
+++ b/newt/builder/size.go
@@ -405,7 +405,7 @@ func (t *TargetBuilder) Size() error {
 
 func (b *Builder) FindPkgNameByArName(arName string) string {
for rpkg, bpkg := range b.PkgMap {
-   if (b.ArchivePath(bpkg) == arName) {
+   if b.ArchivePath(bpkg) == arName {
return rpkg.Lpkg.FullName()
}
}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/9a13ff30/newt/image/image.go
--
diff --git a/newt/image/image.go b/newt/image/image.go
index 15ac916..44f428c 100644
--- a/newt/image/image.go
+++ b/newt/image/image.go
@@ -721,7 +721,7 @@ func NewImageManifestSizeCollector() 
*ImageManifestSizeCollector {
 }
 
 func (c *ImageManifestSizeCollector) AddPkg(pkg string) *ImageManifestSizePkg {
-   p := &ImageManifestSizePkg {
+   p := &ImageManifestSizePkg{
Name: pkg,
}
c.Pkgs = append(c.Pkgs, p)
@@ -730,7 +730,7 @@ func (c *ImageManifestSizeCollector) AddPkg(pkg string) 
*ImageManifestSizePkg {
 }
 
 func (c *ImageManifestSizePkg) AddSymbol(file string, sym string, area string,
-   symSz uint32) {
+   symSz uint32) {
f := c.addFile(file)
s := f.addSym(sym)
s.addArea(area, symSz)
@@ -742,7 +742,7 @@ func (p *ImageManifestSizePkg) addFile(file string) 
*ImageManifestSizeFile {
return f
}
}
-   f := &ImageManifestSizeFile {
+   f := &ImageManifestSizeFile{
Name: file,
}
p.Files = append(p.Files, f)
@@ -751,7 +751,7 @@ func (p *ImageManifestSizePkg) addFile(file string) 
*ImageManifestSizeFile {
 }
 
 func (f *ImageManifestSizeFile) addSym(sym string) *ImageManifestSizeSym {
-   s := &ImageManifestSizeSym {
+   s := &ImageManifestSizeSym{
Name: sym,
}
f.Syms = append(f.Syms, s)
@@ -760,7 +760,7 @@ func (f *ImageManifestSizeFile) addSym(sym string) 
*ImageManifestSizeSym {
 }
 
 func (s *ImageManifestSizeSym) addArea(area string, areaSz uint32) {
-   a := &ImageManifestSizeArea {
+   a := &ImageManifestSizeArea{
Name: area,
Size: areaSz,
}



[2/4] incubator-mynewt-newt git commit: MYNEWT-651; was using uppercase names in json for memory region data.

2017-03-03 Thread marko
MYNEWT-651; was using uppercase names in json for memory region data.


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

Branch: refs/heads/develop
Commit: 15cfc6028d3d5ccd7ebf2a4727c002103ea49a08
Parents: 38d3bc2
Author: Marko Kiiskila 
Authored: Thu Mar 2 13:40:00 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 13:40:00 2017 -0800

--
 newt/image/image.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/15cfc602/newt/image/image.go
--
diff --git a/newt/image/image.go b/newt/image/image.go
index f396d7c..15ac916 100644
--- a/newt/image/image.go
+++ b/newt/image/image.go
@@ -118,8 +118,8 @@ const (
  * Data that's going to go to build manifest file
  */
 type ImageManifestSizeArea struct {
-   Name string
-   Size uint32
+   Name string `json:"name"`
+   Size uint32 `json:"size"`
 }
 
 type ImageManifestSizeSym struct {



[1/4] incubator-mynewt-newt git commit: MYNEWT-651; newt - include package size info in manifest file.

2017-03-03 Thread marko
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 386c08789 -> dce8b5cd0


MYNEWT-651; newt - include package size info in manifest file.


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

Branch: refs/heads/develop
Commit: 38d3bc222bcb190fb35861cfe3116a7ab1aee57a
Parents: a404a47
Author: Marko Kiiskila 
Authored: Thu Mar 2 12:59:43 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 12:59:43 2017 -0800

--
 newt/builder/size.go| 209 +++
 newt/builder/targetbuild.go |  10 ++
 newt/image/image.go |  80 ++-
 3 files changed, 257 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/38d3bc22/newt/builder/size.go
--
diff --git a/newt/builder/size.go b/newt/builder/size.go
index 5ce2939..70b4dc2 100644
--- a/newt/builder/size.go
+++ b/newt/builder/size.go
@@ -28,6 +28,7 @@ import (
"strconv"
"strings"
 
+   "mynewt.apache.org/newt/newt/image"
"mynewt.apache.org/newt/util"
 )
 
@@ -41,6 +42,8 @@ type MemSection struct {
 }
 type MemSectionArray []*MemSection
 
+var globalMemSections map[string]*MemSection
+
 func (array MemSectionArray) Len() int {
return len(array)
 }
@@ -71,11 +74,23 @@ func (m *MemSection) PartOf(addr uint64) bool {
 }
 
 /*
+ * Info about specific symbol size
+ */
+type SymbolData struct {
+   Namestring
+   ObjName string/* Which object file it came from */
+   Sizes   map[string]uint32 /* Sizes indexed by mem section name */
+}
+
+type SymbolDataArray []*SymbolData
+
+/*
  * We accumulate the size of libraries to elements in this.
  */
 type PkgSize struct {
Name  string
-   Sizes map[string]uint32 /* Sizes indexed by mem section name */
+   Sizes map[string]uint32  /* Sizes indexed by mem section name */
+   Syms  map[string]*SymbolData /* Symbols indexed by symbol name */
 }
 
 type PkgSizeArray []*PkgSize
@@ -92,33 +107,76 @@ func (array PkgSizeArray) Swap(i, j int) {
array[i], array[j] = array[j], array[i]
 }
 
-func MakePkgSize(name string, memSections map[string]*MemSection) *PkgSize {
+func (array SymbolDataArray) Len() int {
+   return len(array)
+}
+
+func (array SymbolDataArray) Less(i, j int) bool {
+   return array[i].Name < array[j].Name
+}
+
+func (array SymbolDataArray) Swap(i, j int) {
+   array[i], array[j] = array[j], array[i]
+}
+
+func MakeSymbolData(name string, objName string) *SymbolData {
+   sym := &SymbolData{
+   Name:name,
+   ObjName: objName,
+   }
+   sym.Sizes = make(map[string]uint32)
+   for _, sec := range globalMemSections {
+   sym.Sizes[sec.Name] = 0
+   }
+   return sym
+}
+
+func MakePkgSize(name string) *PkgSize {
pkgSize := &PkgSize{
Name: name,
}
pkgSize.Sizes = make(map[string]uint32)
-   for secName, _ := range memSections {
-   pkgSize.Sizes[secName] = 0
+   for _, sec := range globalMemSections {
+   pkgSize.Sizes[sec.Name] = 0
}
+   pkgSize.Syms = make(map[string]*SymbolData)
return pkgSize
 }
 
+func (ps *PkgSize) addSymSize(symName string, objName string, size uint32, 
addr uint64) {
+   for _, section := range globalMemSections {
+   if section.PartOf(addr) {
+   name := section.Name
+   size32 := uint32(size)
+   if size32 > 0 {
+   sym := ps.Syms[symName]
+   if sym == nil {
+   sym = MakeSymbolData(symName, objName)
+   ps.Syms[symName] = sym
+   }
+   ps.Sizes[name] += size32
+   sym.Sizes[name] += size32
+   }
+   break
+   }
+   }
+}
+
 /*
  * Go through GCC generated mapfile, and collect info about symbol sizes
  */
-func ParseMapFileSizes(fileName string) (map[string]*PkgSize,
-   map[string]*MemSection, error) {
+func ParseMapFileSizes(fileName string) (map[string]*PkgSize, error) {
var state int = 0
 
file, err := os.Open(fileName)
if err != nil {
-   return nil, nil,
-   util.NewNewtError(&qu

[4/4] incubator-mynewt-newt git commit: This closes #45.

2017-03-03 Thread marko
This closes #45.

Merge branch 'mynewt-651' of https://github.com/mkiiskila/incubator-mynewt-newt 
into develop


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

Branch: refs/heads/develop
Commit: dce8b5cd06d280b98f65bae8d21702a70fc8bc38
Parents: 386c087 9a13ff3
Author: Marko Kiiskila 
Authored: Fri Mar 3 10:19:30 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Mar 3 10:19:30 2017 -0800

--
 newt/builder/size.go| 209 +++
 newt/builder/targetbuild.go |  10 ++
 newt/image/image.go |  80 ++-
 3 files changed, 257 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/dce8b5cd/newt/builder/targetbuild.go
--

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/dce8b5cd/newt/image/image.go
--



incubator-mynewt-core git commit: MYNEWT-527; add Windows wrapper script to nrf51-blenano.

2017-03-03 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 4a9cb5128 -> e3241525f


MYNEWT-527; add Windows wrapper script to nrf51-blenano.


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

Branch: refs/heads/develop
Commit: e3241525f37c3d72506a6e8f2ccd2bde24540c60
Parents: 4a9cb51
Author: Marko Kiiskila 
Authored: Fri Mar 3 08:10:38 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Mar 3 08:10:38 2017 -0800

--
 hw/bsp/nrf51-blenano/bsp.yml  | 2 ++
 hw/bsp/nrf51-blenano/nrf51dk_debug.cmd| 3 +++
 hw/bsp/nrf51-blenano/nrf51dk_download.cmd | 3 +++
 3 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e3241525/hw/bsp/nrf51-blenano/bsp.yml
--
diff --git a/hw/bsp/nrf51-blenano/bsp.yml b/hw/bsp/nrf51-blenano/bsp.yml
index c174892..ee95b51 100644
--- a/hw/bsp/nrf51-blenano/bsp.yml
+++ b/hw/bsp/nrf51-blenano/bsp.yml
@@ -28,6 +28,8 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
 bsp.part2linkerscript: "hw/bsp/nrf51-blenano/split-nrf51dk.ld"
 bsp.downloadscript: "hw/bsp/nrf51-blenano/nrf51dk_download.sh"
 bsp.debugscript: "hw/bsp/nrf51-blenano/nrf51dk_debug.sh"
+bsp.downloadscript.WINDOWS.OVERRIDE: 
"hw/bsp/nrf51-blenano/nrf51dk_download.cmd"
+bsp.debugscript.WINDOWS.OVERRIDE: "hw/bsp/nrf51-blenano/nrf51dk_debug.cmd"
 
 bsp.flash_map:
 areas:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e3241525/hw/bsp/nrf51-blenano/nrf51dk_debug.cmd
--
diff --git a/hw/bsp/nrf51-blenano/nrf51dk_debug.cmd 
b/hw/bsp/nrf51-blenano/nrf51dk_debug.cmd
new file mode 100755
index 000..d6cfc11
--- /dev/null
+++ b/hw/bsp/nrf51-blenano/nrf51dk_debug.cmd
@@ -0,0 +1,3 @@
+@rem Execute a shell with a script of the same name and .sh extension
+
+@bash "%~dp0%~n0.sh"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e3241525/hw/bsp/nrf51-blenano/nrf51dk_download.cmd
--
diff --git a/hw/bsp/nrf51-blenano/nrf51dk_download.cmd 
b/hw/bsp/nrf51-blenano/nrf51dk_download.cmd
new file mode 100755
index 000..d6cfc11
--- /dev/null
+++ b/hw/bsp/nrf51-blenano/nrf51dk_download.cmd
@@ -0,0 +1,3 @@
+@rem Execute a shell with a script of the same name and .sh extension
+
+@bash "%~dp0%~n0.sh"



[2/2] incubator-mynewt-core git commit: This closes #189.

2017-03-03 Thread marko
This closes #189.

Merge branch 'mynewt-652' of https://github.com/mkiiskila/incubator-mynewt-core 
into develop


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

Branch: refs/heads/develop
Commit: 4a9cb51282816109479cbf9f08498e3dd916e7e6
Parents: 389d7f4 0b037a6
Author: Marko Kiiskila 
Authored: Fri Mar 3 08:00:49 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Mar 3 08:00:49 2017 -0800

--
 net/oic/src/messaging/coap/observe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[1/2] incubator-mynewt-core git commit: MYNEWT-652; net/oic - remove check of OC_PERIODIC when deciding whether to send notify or not.

2017-03-03 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 389d7f4ad -> 4a9cb5128


MYNEWT-652; net/oic - remove check of OC_PERIODIC when deciding
whether to send notify or not.


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

Branch: refs/heads/develop
Commit: 0b037a6c72040d2fbe153f48e2da0e063cd4b7d4
Parents: 58378cc
Author: Marko Kiiskila 
Authored: Thu Mar 2 14:41:13 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 14:41:13 2017 -0800

--
 net/oic/src/messaging/coap/observe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0b037a6c/net/oic/src/messaging/coap/observe.c
--
diff --git a/net/oic/src/messaging/coap/observe.c 
b/net/oic/src/messaging/coap/observe.c
index 24ddd2a..ed88682 100644
--- a/net/oic/src/messaging/coap/observe.c
+++ b/net/oic/src/messaging/coap/observe.c
@@ -206,7 +206,7 @@ coap_notify_observers(oc_resource_t *resource,
 num_observers = resource->num_observers;
 }
 response.separate_response = 0;
-if (!response_buf && resource && (resource->properties & OC_PERIODIC)) {
+if (!response_buf && resource) {
 OC_LOG_DEBUG("coap_notify_observers: Issue GET request to resource\n");
 /* performing GET on the resource */
 m = os_msys_get_pkthdr(0, 0);



[1/2] incubator-mynewt-core git commit: net/oic; support IPv4.

2017-03-03 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 8d757705f -> 389d7f4ad


net/oic; support IPv4.


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

Branch: refs/heads/develop
Commit: 9064dbafc0fab24833c1bae77c52755e02108ea6
Parents: a42c0c1
Author: Marko Kiiskila 
Authored: Tue Feb 21 10:09:25 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 10:09:25 2017 -0800

--
 net/oic/src/api/oc_client_api.c   |  61 -
 net/oic/src/port/mynewt/adaptor.c |  32 ++-
 net/oic/src/port/mynewt/adaptor.h |  16 +-
 net/oic/src/port/mynewt/ip4_adaptor.c | 354 +
 net/oic/src/port/mynewt/ip_adaptor.c  |  96 
 net/oic/src/port/oc_connectivity.h|  15 +-
 net/oic/syscfg.yml|   6 +
 net/oic/test/syscfg.yml   |   2 +
 8 files changed, 512 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9064dbaf/net/oic/src/api/oc_client_api.c
--
diff --git a/net/oic/src/api/oc_client_api.c b/net/oic/src/api/oc_client_api.c
index 692e0f6..d87683c 100644
--- a/net/oic/src/api/oc_client_api.c
+++ b/net/oic/src/api/oc_client_api.c
@@ -263,22 +263,16 @@ oc_stop_observe(const char *uri, oc_server_handle_t 
*server)
 return status;
 }
 
-bool
-oc_do_ip_discovery(const char *rt, oc_discovery_cb_t handler)
+#if MYNEWT_VAL(OC_TRANSPORT_IP)
+static bool
+oc_send_ip_discovery(oc_server_handle_t *handle, const char *rt,
+ oc_discovery_cb_t handler)
 {
-oc_server_handle_t handle;
 oc_client_cb_t *cb;
 bool status = false;
 oc_string_t query;
 
-oc_make_ip_endpoint(mcast, IP | MULTICAST, 5683,
-   0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0xfd);
-mcast.oe_ip.v6.scope = 0;
-
-memcpy(&handle.endpoint, &mcast, sizeof(oc_endpoint_t));
-
-cb = oc_ri_alloc_client_cb("/oic/res", &handle, OC_GET, handler, LOW_QOS);
-
+cb = oc_ri_alloc_client_cb("/oic/res", handle, OC_GET, handler, LOW_QOS);
 if (!cb) {
 return false;
 }
@@ -297,4 +291,49 @@ oc_do_ip_discovery(const char *rt, oc_discovery_cb_t 
handler)
 }
 return status;
 }
+
+#if MYNEWT_VAL(OC_TRANSPORT_IPV6)
+bool
+oc_do_ip6_discovery(const char *rt, oc_discovery_cb_t handler)
+{
+oc_server_handle_t handle;
+
+oc_make_ip_endpoint(mcast, IP | MULTICAST, 5683,
+   0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0xfd);
+mcast.oe_ip.v6.scope = 0;
+memcpy(&handle.endpoint, &mcast, sizeof(oc_endpoint_t));
+
+return oc_send_ip_discovery(&handle, rt, handler);
+
+}
+#endif
+
+#if MYNEWT_VAL(OC_TRANSPORT_IPV4)
+bool
+oc_do_ip4_discovery(const char *rt, oc_discovery_cb_t handler)
+{
+oc_server_handle_t handle;
+
+oc_make_ip4_endpoint(mcast, IP4 | MULTICAST, 5683, 0xe0, 0, 0x01, 0xbb);
+memcpy(&handle.endpoint, &mcast, sizeof(oc_endpoint_t));
+
+return oc_send_ip_discovery(&handle, rt, handler);
+}
+#endif
+
+bool
+oc_do_ip_discovery(const char *rt, oc_discovery_cb_t handler)
+{
+bool status = false;
+
+#if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1) && (MYNEWT_VAL(OC_TRANSPORT_IPV6) == 1)
+status = oc_do_ip6_discovery(rt, handler);
+#endif
+#if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1) && (MYNEWT_VAL(OC_TRANSPORT_IPV4) == 1)
+status = oc_do_ip4_discovery(rt, handler);
+#endif
+return status;
+}
+#endif
+
 #endif /* OC_CLIENT */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9064dbaf/net/oic/src/port/mynewt/adaptor.c
--
diff --git a/net/oic/src/port/mynewt/adaptor.c 
b/net/oic/src/port/mynewt/adaptor.c
index 0212592..dd6b986 100644
--- a/net/oic/src/port/mynewt/adaptor.c
+++ b/net/oic/src/port/mynewt/adaptor.c
@@ -51,9 +51,14 @@ oc_send_buffer(struct os_mbuf *m)
 oe = OC_MBUF_ENDPOINT(m);
 
 switch (oe->oe.flags) {
-#if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1)
+#if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1) && (MYNEWT_VAL(OC_TRANSPORT_IPV6) == 1)
 case IP:
-oc_send_buffer_ip(m);
+oc_send_buffer_ip6(m);
+break;
+#endif
+#if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1) && (MYNEWT_VAL(OC_TRANSPORT_IPV4) == 1)
+case IP4:
+oc_send_buffer_ip4(m);
 break;
 #endif
 #if (MYNEWT_VAL(OC_TRANSPORT_GATT) == 1)
@@ -79,8 +84,11 @@ oc_send_multicast_message(struct os_mbuf *m)
  * Send on all the transpor

[2/2] incubator-mynewt-core git commit: This closes #188.

2017-03-03 Thread marko
This closes #188.

Merge branch 'oci_ipv4' of https://github.com/mkiiskila/incubator-mynewt-core 
into develop


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

Branch: refs/heads/develop
Commit: 389d7f4adf4d3966946974f46db9294f63800e1e
Parents: 8d75770 9064dba
Author: Marko Kiiskila 
Authored: Fri Mar 3 07:56:35 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Mar 3 07:56:35 2017 -0800

--
 net/oic/src/api/oc_client_api.c   |  61 -
 net/oic/src/port/mynewt/adaptor.c |  32 ++-
 net/oic/src/port/mynewt/adaptor.h |  16 +-
 net/oic/src/port/mynewt/ip4_adaptor.c | 354 +
 net/oic/src/port/mynewt/ip_adaptor.c  |  96 
 net/oic/src/port/oc_connectivity.h|  15 +-
 net/oic/syscfg.yml|   6 +
 net/oic/test/syscfg.yml   |   2 +
 8 files changed, 512 insertions(+), 70 deletions(-)
--




[2/2] incubator-mynewt-newt git commit: This closes #46.

2017-03-02 Thread marko
This closes #46.

Merge branch 'newt' of https://github.com/cwanda/incubator-mynewt-newt into 
develop


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

Branch: refs/heads/develop
Commit: 386c087891b3baec68c83bddae19ff6a6edcaeff
Parents: abf65d3 c246363
Author: Marko Kiiskila 
Authored: Thu Mar 2 21:00:14 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 21:00:14 2017 -0800

--
 newt/cli/complete_cmd.go | 14 +-
 newt/newt.go |  1 +
 2 files changed, 6 insertions(+), 9 deletions(-)
--




[1/2] incubator-mynewt-newt git commit: Add back "newt complete" and remove from help text. 1) Added "newt complete" support back. 2) Make the command hidden so it is not in the list of "Available Com

2017-03-02 Thread marko
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop abf65d3a7 -> 386c08789


Add back "newt complete" and remove from help text.
1) Added "newt complete" support back.
2) Make the command hidden so it is not in the list of "Available Commands" in 
newt help.
3) Removed "newt complete" help text.


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

Branch: refs/heads/develop
Commit: c24636335663b08a7583321ce64dc264e0c34454
Parents: abf65d3
Author: cwanda 
Authored: Thu Mar 2 20:25:57 2017 -0800
Committer: cwanda 
Committed: Thu Mar 2 20:51:08 2017 -0800

--
 newt/cli/complete_cmd.go | 14 +-
 newt/newt.go |  1 +
 2 files changed, 6 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/c2463633/newt/cli/complete_cmd.go
--
diff --git a/newt/cli/complete_cmd.go b/newt/cli/complete_cmd.go
index 272f928..ae3d39e 100644
--- a/newt/cli/complete_cmd.go
+++ b/newt/cli/complete_cmd.go
@@ -237,17 +237,13 @@ func completeRunCmd(cmd *cobra.Command, args []string) {
 }
 
 func AddCompleteCommands(cmd *cobra.Command) {
-   completeShortHelp := "Performs Bash Autocompletion (-C)"
-
-   completeLongHelp := completeShortHelp + ".\n\n" +
-   " this command reads environment variables COMP_LINE and 
COMP_POINT " +
-   " and will send completion options out stdout as one option per 
line  "
 
completeCmd := &cobra.Command{
-   Use:   "complete",
-   Short: completeShortHelp,
-   Long:  completeLongHelp,
-   Run:   completeRunCmd,
+   Use:"complete",
+   Short:  "",
+   Long:   "",
+   Run:completeRunCmd,
+   Hidden: true,
}
 
/* silence errors on the complete command because we have partial flags 
*/

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/c2463633/newt/newt.go
--
diff --git a/newt/newt.go b/newt/newt.go
index a09e57c..0dc8808 100644
--- a/newt/newt.go
+++ b/newt/newt.go
@@ -140,6 +140,7 @@ func main() {
cmd := newtCmd()
 
cli.AddBuildCommands(cmd)
+   cli.AddCompleteCommands(cmd)
cli.AddImageCommands(cmd)
cli.AddPackageCommands(cmd)
cli.AddProjectCommands(cmd)



[2/2] incubator-mynewt-core git commit: This closes #187.

2017-03-02 Thread marko
This closes #187.

Merge branch 'mynewt-634' of https://github.com/sjanc/incubator-mynewt-core 
into develop


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

Branch: refs/heads/develop
Commit: 58378ccfad173af6bebda22c5cf1d5f2b7d80d46
Parents: 3828470 259d2a8
Author: Marko Kiiskila 
Authored: Thu Mar 2 12:32:20 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 2 12:32:20 2017 -0800

--
 apps/blecent/src/main.c | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/58378ccf/apps/blecent/src/main.c
--



[1/2] incubator-mynewt-core git commit: blecent: Fix not setting initial BLE address

2017-03-02 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 382847055 -> 58378ccfa


blecent: Fix not setting initial BLE address

Application needs to set correct public address if it want to use it.

MYNEWT-634


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

Branch: refs/heads/develop
Commit: 259d2a8d3af8af0958bc7137be8a2bd90c1244a4
Parents: de35d23
Author: Szymon Janc 
Authored: Tue Feb 28 12:39:17 2017 +0100
Committer: Szymon Janc 
Committed: Tue Feb 28 13:42:21 2017 +0100

--
 apps/blecent/src/main.c | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/259d2a8d/apps/blecent/src/main.c
--
diff --git a/apps/blecent/src/main.c b/apps/blecent/src/main.c
index 18f7045..f00d7ca 100755
--- a/apps/blecent/src/main.c
+++ b/apps/blecent/src/main.c
@@ -465,6 +465,9 @@ main(void)
 {
 int rc;
 
+/* Set initial BLE device address. */
+memcpy(g_dev_addr, (uint8_t[6]){0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a}, 6);
+
 /* Initialize OS */
 sysinit();
 



[2/2] incubator-mynewt-core git commit: This closes #183.

2017-02-28 Thread marko
This closes #183.

Merge branch 'os_dev_lookup_export' of 
https://github.com/sterlinghughes/incubator-mynewt-core into develop


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

Branch: refs/heads/develop
Commit: b3be6f034169efaa53511b9da0905c4bba014608
Parents: 10388ed 9528e48
Author: Marko Kiiskila 
Authored: Tue Feb 28 14:51:01 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 28 14:51:01 2017 -0800

--
 kernel/os/include/os/os_dev.h | 1 +
 kernel/os/src/os_dev.c| 7 +--
 2 files changed, 6 insertions(+), 2 deletions(-)
--




[1/2] incubator-mynewt-core git commit: Expose os_dev_loookup()

2017-02-28 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 10388edf3 -> b3be6f034


Expose os_dev_loookup()

This enables users who want to share a OS device during init to
access it using the device name.  This should not be called at
runtime.


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

Branch: refs/heads/develop
Commit: 9528e487960f022e5541cfa4986cc01877ed133c
Parents: a42c0c1
Author: Sterling Hughes 
Authored: Tue Feb 21 16:39:03 2017 -0800
Committer: Sterling Hughes 
Committed: Tue Feb 21 16:39:03 2017 -0800

--
 kernel/os/include/os/os_dev.h | 1 +
 kernel/os/src/os_dev.c| 7 +--
 2 files changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9528e487/kernel/os/include/os/os_dev.h
--
diff --git a/kernel/os/include/os/os_dev.h b/kernel/os/include/os/os_dev.h
index 5af06b2..ed65a08 100644
--- a/kernel/os/include/os/os_dev.h
+++ b/kernel/os/include/os/os_dev.h
@@ -108,6 +108,7 @@ os_dev_resume(struct os_dev *dev)
 
 int os_dev_create(struct os_dev *dev, char *name, uint8_t stage,
 uint8_t priority, os_dev_init_func_t od_init, void *arg);
+struct os_dev *os_dev_lookup(char *name);
 int os_dev_initialize_all(uint8_t stage);
 int os_dev_suspend_all(os_time_t, uint8_t);
 int os_dev_resume_all(void);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9528e487/kernel/os/src/os_dev.c
--
diff --git a/kernel/os/src/os_dev.c b/kernel/os/src/os_dev.c
index 139fe13..07b1c54 100644
--- a/kernel/os/src/os_dev.c
+++ b/kernel/os/src/os_dev.c
@@ -232,13 +232,16 @@ err:
 }
 
 /**
- * Lookup a device by name, internal function only.
+ * Lookup a device by name.
+ *
+ * WARNING: This should be called before any locking on the device is done, or
+ * the device list itself is modified in any context.  There is no locking.
  *
  * @param name The name of the device to look up.
  *
  * @return A pointer to the device corresponding to name, or NULL if not found.
  */
-static struct os_dev *
+struct os_dev *
 os_dev_lookup(char *name)
 {
 struct os_dev *dev;



incubator-mynewt-newt git commit: MYNEWT-527; allow build machine OS dependent overrides in bsp.yml.

2017-02-27 Thread marko
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 5cb84eb4a -> 0558e33c2


MYNEWT-527; allow build machine OS dependent overrides in bsp.yml.


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

Branch: refs/heads/develop
Commit: 0558e33c20f5be3551571bc65de9348d0eebb782
Parents: 5cb84eb
Author: Marko Kiiskila 
Authored: Mon Feb 27 21:02:51 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Feb 27 21:02:51 2017 -0800

--
 newt/pkg/bsp_package.go | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/0558e33c/newt/pkg/bsp_package.go
--
diff --git a/newt/pkg/bsp_package.go b/newt/pkg/bsp_package.go
index 572255c..146347f 100644
--- a/newt/pkg/bsp_package.go
+++ b/newt/pkg/bsp_package.go
@@ -20,6 +20,7 @@
 package pkg
 
 import (
+   "runtime"
"strings"
 
"mynewt.apache.org/newt/newt/flash"
@@ -101,6 +102,13 @@ func (bsp *BspPackage) resolveLinkerScriptSetting(
 func (bsp *BspPackage) Reload(features map[string]bool) error {
var err error
 
+   if features == nil {
+   features = map[string]bool{
+   strings.ToUpper(runtime.GOOS): true,
+   }
+   } else {
+   features[strings.ToUpper(runtime.GOOS)] = true
+   }
bsp.BspV, err = util.ReadConfig(bsp.BasePath(),
strings.TrimSuffix(BSP_YAML_FILENAME, ".yml"))
if err != nil {
@@ -131,7 +139,6 @@ func (bsp *BspPackage) Reload(features map[string]bool) 
error {
if err != nil {
return err
}
-
bsp.DebugScript, err = bsp.resolvePathSetting(
features, "bsp.debugscript")
if err != nil {



incubator-mynewt-core git commit: MYNEWT-527; add wrapper for shell scripts when running on Windows.

2017-02-27 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 6af948086 -> 10388edf3


MYNEWT-527; add wrapper for shell scripts when running on Windows.


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

Branch: refs/heads/develop
Commit: 10388edf366ba670f94a3c15393a1dcc2b765c3f
Parents: 6af9480
Author: Marko Kiiskila 
Authored: Mon Feb 27 20:59:50 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Feb 27 20:59:50 2017 -0800

--
 hw/bsp/ada_feather_nrf52/ada_feather_nrf52_debug.cmd   | 3 +++
 hw/bsp/ada_feather_nrf52/ada_feather_nrf52_download.cmd| 3 +++
 hw/bsp/ada_feather_nrf52/bsp.yml   | 2 ++
 hw/bsp/arduino_primo_nrf52/bsp.yml | 2 ++
 hw/bsp/arduino_primo_nrf52/primo_debug.cmd | 3 +++
 hw/bsp/arduino_primo_nrf52/primo_download.cmd  | 3 +++
 hw/bsp/bbc_microbit/bsp.yml| 6 --
 hw/bsp/bbc_microbit/microbit_debug.cmd | 3 +++
 hw/bsp/bbc_microbit/microbit_download.cmd  | 3 +++
 hw/bsp/bmd200/bsp.yml  | 2 ++
 hw/bsp/bmd200/nrf51dk_debug.cmd| 3 +++
 hw/bsp/bmd200/nrf51dk_download.cmd | 3 +++
 hw/bsp/bmd300eval/bmd300eval_debug.cmd | 3 +++
 hw/bsp/bmd300eval/bmd300eval_download.cmd  | 3 +++
 hw/bsp/bmd300eval/bsp.yml  | 2 ++
 hw/bsp/frdm-k64f/bsp.yml   | 2 ++
 hw/bsp/frdm-k64f/frdm-k64_debug.cmd| 3 +++
 hw/bsp/frdm-k64f/frdm-k64_download.cmd | 3 +++
 hw/bsp/nrf51-arduino_101/bsp.yml   | 2 ++
 hw/bsp/nrf51-arduino_101/nrf51dk-16kbram_debug.cmd | 3 +++
 hw/bsp/nrf51-arduino_101/nrf51dk-16kbram_download.cmd  | 3 +++
 hw/bsp/nrf51dk-16kbram/bsp.yml | 2 ++
 hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_debug.cmd   | 3 +++
 hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.cmd| 3 +++
 hw/bsp/nrf51dk/bsp.yml | 2 ++
 hw/bsp/nrf51dk/nrf51dk_debug.cmd   | 3 +++
 hw/bsp/nrf51dk/nrf51dk_download.cmd| 3 +++
 hw/bsp/nrf52840pdk/bsp.yml | 2 ++
 hw/bsp/nrf52840pdk/nrf52840pdk_debug.cmd   | 3 +++
 hw/bsp/nrf52840pdk/nrf52840pdk_download.cmd| 3 +++
 hw/bsp/nrf52dk/bsp.yml | 2 ++
 hw/bsp/nrf52dk/nrf52dk_debug.cmd   | 3 +++
 hw/bsp/nrf52dk/nrf52dk_download.cmd| 3 +++
 hw/bsp/nucleo-f401re/bsp.yml   | 2 ++
 hw/bsp/nucleo-f401re/nucleo-f401re_debug.cmd   | 3 +++
 hw/bsp/nucleo-f401re/nucleo-f401re_download.cmd| 3 +++
 hw/bsp/olimex_stm32-e407_devboard/bsp.yml  | 2 ++
 .../olimex_stm32-e407_devboard_debug.cmd   | 3 +++
 .../olimex_stm32-e407_devboard_download.cmd| 3 +++
 hw/bsp/rb-nano2/bsp.yml| 2 ++
 hw/bsp/rb-nano2/rb-nano2_debug.cmd | 3 +++
 hw/bsp/rb-nano2/rb-nano2_download.cmd  | 3 +++
 hw/bsp/stm32f4discovery/bsp.yml| 2 ++
 hw/bsp/stm32f4discovery/stm32f4discovery_debug.cmd | 3 +++
 hw/bsp/stm32f4discovery/stm32f4discovery_download.cmd  | 3 +++
 hw/bsp/usbmkw41z/bsp.yml   | 2 ++
 hw/bsp/usbmkw41z/usbkw41z_debug.cmd| 3 +++
 hw/bsp/usbmkw41z/usbkw41z_download.cmd | 3 +++
 48 files changed, 130 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/10388edf/hw/bsp/ada_feather_nrf52/ada_feather_nrf52_debug.cmd
--
diff --git a/hw/bsp/ada_feather_nrf52/ada_feather_nrf52_debug.cmd 
b/hw/bsp/ada_feather_nrf52/ada_feather_nrf52_debug.cmd
new file mode 100755
index 000..d6cfc11
--- /dev/null
+++ b/hw/bsp/ada_feather_nrf52/ada_feather_nrf52_debug.cmd
@@ -0,0 +1,3 @@
+@rem Execute a shell with a script of the same name and .sh extension
+
+@bash "%~dp0%~n0.sh"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/10

[2/2] incubator-mynewt-core git commit: net/oic; fix mbuf leak. Noticed in inspection.

2017-02-27 Thread marko
net/oic; fix mbuf leak. Noticed in inspection.


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

Branch: refs/heads/develop
Commit: c9de6b3118b65081a1640bfb1107eb6f59d06aa3
Parents: 5000e8d
Author: Marko Kiiskila 
Authored: Mon Feb 27 14:23:50 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Feb 27 14:26:31 2017 -0800

--
 net/oic/src/messaging/coap/observe.c | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c9de6b31/net/oic/src/messaging/coap/observe.c
--
diff --git a/net/oic/src/messaging/coap/observe.c 
b/net/oic/src/messaging/coap/observe.c
index 234b2da..24ddd2a 100644
--- a/net/oic/src/messaging/coap/observe.c
+++ b/net/oic/src/messaging/coap/observe.c
@@ -224,6 +224,7 @@ coap_notify_observers(oc_resource_t *resource,
 response_buf = &response_buffer;
 if (response_buf->code == OC_IGNORE) {
 OC_LOG_ERROR("coap_notify_observers: Resource ignored request\n");
+os_mbuf_free_chain(m);
 return num_observers;
 }
 }



[1/2] incubator-mynewt-core git commit: net/oic; notifications were not working. memset() in coap_receive_packet() was overwriting too many bytes, running into observer memory pool area.

2017-02-27 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 5000e8d68 -> d3dbe78cb


net/oic; notifications were not working.
memset() in coap_receive_packet() was overwriting too many bytes,
running into observer memory pool area.


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

Branch: refs/heads/develop
Commit: d3dbe78cbd566a97d676c60f37c1448d0a8b7757
Parents: c9de6b3
Author: Marko Kiiskila 
Authored: Mon Feb 27 14:24:48 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Feb 27 14:26:31 2017 -0800

--
 net/oic/src/messaging/coap/coap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d3dbe78c/net/oic/src/messaging/coap/coap.c
--
diff --git a/net/oic/src/messaging/coap/coap.c 
b/net/oic/src/messaging/coap/coap.c
index 17df8f8..30d72e5 100644
--- a/net/oic/src/messaging/coap/coap.c
+++ b/net/oic/src/messaging/coap/coap.c
@@ -555,7 +555,7 @@ coap_parse_message(struct coap_packet_rx *pkt, struct 
os_mbuf **mp)
 
 m = *mp;
 /* initialize packet */
-memset(pkt, 0, sizeof(coap_packet_t));
+memset(pkt, 0, sizeof(*pkt));
 
 STATS_INC(coap_stats, iframe);
 



incubator-mynewt-core git commit: MYNEWT-636; return error if there's magic mismatch on any fcb sector.

2017-02-23 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 1449ffcdb -> 2bbb29106


MYNEWT-636; return error if there's magic mismatch on any fcb sector.


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

Branch: refs/heads/develop
Commit: 2bbb291068d8fe75c4df5f723c7d0d374dffee2b
Parents: 1449ffc
Author: Marko Kiiskila 
Authored: Thu Feb 23 15:40:15 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 23 15:40:15 2017 -0800

--
 fs/fcb/src/fcb.c  | 5 -
 fs/fcb/test/src/testcases/fcb_test_init.c | 5 +
 2 files changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2bbb2910/fs/fcb/src/fcb.c
--
diff --git a/fs/fcb/src/fcb.c b/fs/fcb/src/fcb.c
index 0a68be0..30c76b5 100644
--- a/fs/fcb/src/fcb.c
+++ b/fs/fcb/src/fcb.c
@@ -47,7 +47,10 @@ fcb_init(struct fcb *fcb)
 max_align = flash_area_align(fap);
 }
 rc = fcb_sector_hdr_read(fcb, fap, &fda);
-if (rc <= 0) {
+if (rc < 0) {
+return rc;
+}
+if (rc == 0) {
 continue;
 }
 if (oldest < 0) {

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2bbb2910/fs/fcb/test/src/testcases/fcb_test_init.c
--
diff --git a/fs/fcb/test/src/testcases/fcb_test_init.c 
b/fs/fcb/test/src/testcases/fcb_test_init.c
index d3c33b4..68f3618 100644
--- a/fs/fcb/test/src/testcases/fcb_test_init.c
+++ b/fs/fcb/test/src/testcases/fcb_test_init.c
@@ -35,6 +35,11 @@ TEST_CASE(fcb_test_init)
 TEST_ASSERT(rc == FCB_ERR_ARGS);
 
 fcb->f_sector_cnt = 2;
+fcb->f_magic = 0x12345678;
+rc = fcb_init(fcb);
+TEST_ASSERT(rc == FCB_ERR_MAGIC);
+
+fcb->f_magic = 0;
 rc = fcb_init(fcb);
 TEST_ASSERT(rc == 0);
 }



[3/5] incubator-mynewt-core git commit: MYNEWT-492; TBD -> descriptions.

2017-02-21 Thread marko
MYNEWT-492; TBD -> descriptions.


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

Branch: refs/heads/develop
Commit: cb6d0cbc9cc3e3a1346184a4015c40a3abb79120
Parents: e2dd539
Author: Marko Kiiskila 
Authored: Tue Feb 21 17:36:29 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 17:36:29 2017 -0800

--
 hw/bsp/olimex_stm32-e407_devboard/syscfg.yml | 21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/cb6d0cbc/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml
--
diff --git a/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml 
b/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml
index d1d19fd..7b2fe59 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml
+++ b/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml
@@ -21,39 +21,32 @@
 syscfg.defs:
 ADC_1:
 description: "ADC_1"
-value:  1
+value:  0
 ADC_2:
 description: "ADC_2"
 value:  0
 ADC_3:
 description: "ADC_3"
-value:  1
+value:  0
 UART_0:
-description: 'TBD'
+description: 'Whether to enable UART0'
 value:  1
-UART_1:
-description: 'TBD'
-value:  0
 
 I2C_0:
 description: 'I2C0'
 value: 0
 
-SPI_0:
-description: 'TBD'
-value:  0
-
 SPI_0_MASTER:
-description: 'TBD'
+description: 'Whether to enable SPI 0 in master mode'
 value:  0
 restrictions:
-- SPI_0
+- "!SPI_0_SLAVE"
 
 SPI_0_SLAVE:
-description: 'TBD'
+description: 'Whether to enable SPI 0 in slave mode'
 value:  0
 restrictions:
-- SPI_0
+- "!SPI_0_MASTER"
 
 TIMER_0:
 description: 'TIMER_0'



[1/5] incubator-mynewt-core git commit: MYNEWT-492; TBD -> descriptions.

2017-02-21 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop fa6cc192e -> 4ef28


MYNEWT-492; TBD -> descriptions.


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

Branch: refs/heads/develop
Commit: 0112f46afa912d63c8560e68dd41e739256f9346
Parents: fa6cc19
Author: Marko Kiiskila 
Authored: Tue Feb 21 16:36:20 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 16:36:20 2017 -0800

--
 hw/bsp/arduino_primo_nrf52/syscfg.yml | 36 -
 hw/bsp/bbc_microbit/syscfg.yml| 28 +-
 hw/bsp/bmd200/syscfg.yml  | 21 ++
 hw/bsp/bmd300eval/syscfg.yml  | 22 +++
 hw/bsp/ci40/syscfg.yml|  4 +-
 hw/bsp/frdm-k64f/syscfg.yml   | 62 +++---
 hw/bsp/nrf51-arduino_101/syscfg.yml   | 27 -
 7 files changed, 91 insertions(+), 109 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0112f46a/hw/bsp/arduino_primo_nrf52/syscfg.yml
--
diff --git a/hw/bsp/arduino_primo_nrf52/syscfg.yml 
b/hw/bsp/arduino_primo_nrf52/syscfg.yml
index 01d2ded..fdbd00b 100644
--- a/hw/bsp/arduino_primo_nrf52/syscfg.yml
+++ b/hw/bsp/arduino_primo_nrf52/syscfg.yml
@@ -21,51 +21,45 @@
 
 syscfg.defs:
 OPENOCD_DEBUG:
-description: 'TBD'
+description: 'Use OpenOCD for JTAG access.'
 value: 0
 
 BSP_NRF52:
-description: 'TBD'
+description: 'Set to indicate that BSP has NRF52'
 value: 1
 
 XTAL_32768:
-description: 'TBD'
+description: 'External 32k oscillator available.'
 value: 1
 
 UART_0:
-description: 'TBD'
+description: 'Whether to enable UART0'
 value:  1
 UART_0_PIN_TX:
-description: 'TBD'
+description: 'TX pin for UART0'
 value:  12
 UART_0_PIN_RX:
-description: 'TBD'
+description: 'RX pin for UART0'
 value:  11
 UART_0_PIN_RTS:
-description: 'TBD'
+description: 'RTS pin for UART0'
 value:  0
 UART_0_PIN_CTS:
-description: 'TBD'
+description: 'CTS pin for UART0'
 value:  0
 
 UART_1:
-description: 'Bitbanger UART'
+description: 'Whether to enable bitbanger UART1'
 value:  1
 UART_1_PIN_TX:
-description: 'TBD'
+description: 'TX pin for UART1'
 value:  6
 UART_1_PIN_RX:
-description: 'TBD'
+description: 'RX pin for UART1'
 value:  5
-UART_1_PIN_RTS:
-description: 'TBD'
-value:  0
-UART_1_PIN_CTS:
-description: 'TBD'
-value:  0
 
 SPI_0_MASTER:
-description: 'SPI 0 master'
+description: 'Whether to enable SPI 0 in master mode'
 value:  1
 restrictions:
 - "!SPI_0_SLAVE"
@@ -73,7 +67,7 @@ syscfg.defs:
 description: 'SPI 0 (master) SS pin number.'
 value:  19
 SPI_1_MASTER:
-description: 'SPI 1 master'
+description: 'Whether to enable SPI 1 in master mode'
 value:  0
 restrictions:
 - "!SPI_1_SLAVE"
@@ -81,12 +75,12 @@ syscfg.defs:
 description: 'SPI 1 (master) SS pin number.'
 value:  -1
 SPI_0_SLAVE:
-description: 'SPI 0 slave'
+description: 'Whether to enable SPI 0 in slave mode'
 value:  0
 restrictions:
 - "!SPI_0_MASTER"
 SPI_1_SLAVE:
-description: 'SPI 1 slave'
+description: 'Whether to enable SPI 1 in slave mode'
 value:  0
 restrictions:
 - "!SPI_1_MASTER"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0112f46a/hw/bsp/bbc_microbit/syscfg.yml
--
diff --git a/hw/bsp/bbc_microbit/syscfg.yml b/hw/bsp/bbc_microbit/syscfg.yml
index ff9cee3..0a2d051 100644
--- a/hw/bsp/bbc_microbit/syscfg.yml
+++ b/hw/bsp/bbc_microbit/syscfg.yml
@@ -21,48 +21,38 @@
 
 syscfg.defs:
 BSP_NRF51:
-description: 'TBD'
+description: 'Set to indicate that BSP has NRF5

[4/5] incubator-mynewt-core git commit: bsp/olimex_stm32-e407_devboard; allow building BSP without ADCs, UART0.

2017-02-21 Thread marko
bsp/olimex_stm32-e407_devboard; allow building BSP without ADCs, UART0.


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

Branch: refs/heads/develop
Commit: c9fdcc0e984567347b036f92ed6bc7a019866e86
Parents: cb6d0cb
Author: Marko Kiiskila 
Authored: Tue Feb 21 17:36:52 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 17:36:52 2017 -0800

--
 hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c | 48 ++--
 1 file changed, 23 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c9fdcc0e/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
--
diff --git a/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c 
b/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
index 9d50e8c..d0bcc39 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
+++ b/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
@@ -26,9 +26,13 @@
 #include "stm32f4xx_hal_adc.h"
 #include "flash_map/flash_map.h"
 #include "os/os_dev.h"
+#if MYNEWT_VAL(UART_0)
 #include "uart/uart.h"
 #include "uart_hal/uart_hal.h"
+#endif
+#if MYNEWT_VAL(ADC_1) || MYNEWT_VAL(ADC_2) || MYNEWT_VAL(ADC_3)
 #include "adc_stm32f4/adc_stm32f4.h"
+#endif
 #include "hal/hal_i2c.h"
 #include "hal/hal_timer.h"
 #include "hal/hal_bsp.h"
@@ -40,7 +44,9 @@
 #include "mcu/stm32f4_bsp.h"
 #include "mcu/stm32f4xx_mynewt_hal.h"
 
-static struct uart_dev hal_uart0;
+#if MYNEWT_VAL(UART_0)
+struct uart_dev hal_uart0;
+#endif
 
 /* XXX should not be here */
 
@@ -54,8 +60,6 @@ struct adc_dev my_dev_adc2;
 struct adc_dev my_dev_adc3;
 #endif
 
-struct stm32f4_uart_cfg;
-
 #if MYNEWT_VAL(ADC_1)
 /*
  * adc_handle is defined earlier because the DMA handle's
@@ -269,21 +273,19 @@ struct stm32f4_hal_spi_cfg spi0_cfg = {
 .irq_prio = 2
 };
 #endif
-
-static const struct stm32f4_uart_cfg uart_cfg[UART_CNT] = {
-[0] = {
-.suc_uart = USART6,
-.suc_rcc_reg = &RCC->APB2ENR,
-.suc_rcc_dev = RCC_APB2ENR_USART6EN,
-.suc_pin_tx = MCU_GPIO_PORTC(6),   /* PC6 */
-.suc_pin_rx = MCU_GPIO_PORTC(7),   /* PC7 */
-.suc_pin_rts = -1,
-.suc_pin_cts = -1,
-.suc_pin_af = GPIO_AF8_USART6,
-.suc_irqn = USART6_IRQn
-}
+#if MYNEWT_VAL(UART_0)
+static const struct stm32f4_uart_cfg uart_cfg0 = {
+.suc_uart = USART6,
+.suc_rcc_reg = &RCC->APB2ENR,
+.suc_rcc_dev = RCC_APB2ENR_USART6EN,
+.suc_pin_tx = MCU_GPIO_PORTC(6),   /* PC6 */
+.suc_pin_rx = MCU_GPIO_PORTC(7),   /* PC7 */
+.suc_pin_rts = -1,
+.suc_pin_cts = -1,
+.suc_pin_af = GPIO_AF8_USART6,
+.suc_irqn = USART6_IRQn
 };
-
+#endif
 static const struct hal_bsp_mem_dump dump_cfg[] = {
 [0] = {
 .hbmd_start = &_ram_start,
@@ -295,13 +297,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
 }
 };
 
-const struct stm32f4_uart_cfg *
-bsp_uart_config(int port)
-{
-assert(port < UART_CNT);
-return &uart_cfg[port];
-}
-
 const struct hal_flash *
 hal_bsp_flash_dev(uint8_t id)
 {
@@ -348,6 +343,7 @@ hal_bsp_init(void)
 {
 int rc;
 
+(void)rc;
 #if MYNEWT_VAL(SPI_0_MASTER)
 rc = hal_spi_init(0, &spi0_cfg, HAL_SPI_TYPE_MASTER);
 assert(rc == 0);
@@ -358,9 +354,11 @@ hal_bsp_init(void)
 assert(rc == 0);
 #endif
 
+#if MYNEWT_VAL(UART_0)
 rc = os_dev_create((struct os_dev *) &hal_uart0, CONSOLE_UART,
-  OS_DEV_INIT_PRIMARY, 0, uart_hal_init, (void *)bsp_uart_config(0));
+  OS_DEV_INIT_PRIMARY, 0, uart_hal_init, (void *)&uart_cfg0);
 assert(rc == 0);
+#endif
 
 #if MYNEWT_VAL(ADC_1)
 rc = os_dev_create((struct os_dev *) &my_dev_adc1, "adc1",



[5/5] incubator-mynewt-core git commit: bsp/rb-nano2; configure SPI0 if syscfg says so.

2017-02-21 Thread marko
bsp/rb-nano2; configure SPI0 if syscfg says so.


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

Branch: refs/heads/develop
Commit: 4ef287fc24325a34f17ffe97fa2c9a594595
Parents: c9fdcc0
Author: Marko Kiiskila 
Authored: Tue Feb 21 17:37:35 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 17:37:35 2017 -0800

--
 hw/bsp/rb-nano2/src/hal_bsp.c | 12 
 1 file changed, 12 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4ef28aaa/hw/bsp/rb-nano2/src/hal_bsp.c
--
diff --git a/hw/bsp/rb-nano2/src/hal_bsp.c b/hw/bsp/rb-nano2/src/hal_bsp.c
index cdcc354..4686167 100644
--- a/hw/bsp/rb-nano2/src/hal_bsp.c
+++ b/hw/bsp/rb-nano2/src/hal_bsp.c
@@ -30,8 +30,10 @@
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_watchdog.h"
+#if MYNEWT_VAL(UART_0)
 #include "uart/uart.h"
 #include "uart_hal/uart_hal.h"
+#endif
 #include "os/os_dev.h"
 
 #if MYNEWT_VAL(UART_0)
@@ -165,4 +167,14 @@ hal_bsp_init(void)
   OS_DEV_INIT_PRIMARY, 0, uart_hal_init, (void *)&os_bsp_uart0_cfg);
 assert(rc == 0);
 #endif
+
+#if MYNEWT_VAL(SPI_0_MASTER)
+rc = hal_spi_init(0, (void *)&os_bsp_spi0m_cfg, HAL_SPI_TYPE_MASTER);
+assert(rc == 0);
+#endif
+
+#if MYNEWT_VAL(SPI_0_SLAVE)
+rc = hal_spi_init(0, (void *)&os_bsp_spi0s_cfg, HAL_SPI_TYPE_SLAVE);
+assert(rc == 0);
+#endif
 }



[2/5] incubator-mynewt-core git commit: MYNEWT-492; TBD -> descriptions.

2017-02-21 Thread marko
MYNEWT-492; TBD -> descriptions.


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

Branch: refs/heads/develop
Commit: e2dd5391101c41140b17e2b7bcaae1f63a2ab278
Parents: 0112f46
Author: Marko Kiiskila 
Authored: Tue Feb 21 17:33:43 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 17:33:43 2017 -0800

--
 hw/bsp/nrf51-blenano/syscfg.yml| 24 +++---
 hw/bsp/nrf51dk-16kbram/syscfg.yml  | 24 +++---
 hw/bsp/nrf51dk/syscfg.yml  | 24 +++---
 hw/bsp/nrf52840pdk/syscfg.yml  | 33 ---
 hw/bsp/nrf52dk/syscfg.yml  | 35 +
 hw/bsp/nucleo-f401re/syscfg.yml| 14 +
 hw/bsp/rb-nano2/syscfg.yml | 27 +++--
 hw/bsp/stm32f4discovery/syscfg.yml |  5 -
 hw/bsp/usbmkw41z/syscfg.yml|  2 +-
 9 files changed, 69 insertions(+), 119 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e2dd5391/hw/bsp/nrf51-blenano/syscfg.yml
--
diff --git a/hw/bsp/nrf51-blenano/syscfg.yml b/hw/bsp/nrf51-blenano/syscfg.yml
index 6ff8328..8908bb0 100644
--- a/hw/bsp/nrf51-blenano/syscfg.yml
+++ b/hw/bsp/nrf51-blenano/syscfg.yml
@@ -21,27 +21,27 @@
 
 syscfg.defs:
 BSP_NRF51:
-description: 'TBD'
+description: 'Set to indicate that BSP has NRF51'
 value: 1
 
 XTAL_32768:
-description: 'TBD'
+description: 'External 32k oscillator available.'
 value: 1
 
 UART_0:
-description: 'TBD'
+description: 'Whether to enable UART0'
 value: 1
 UART_0_PIN_TX:
-description: 'TBD'
+description: 'TX pin for UART0'
 value: 9
 UART_0_PIN_RX:
-description: 'TBD'
+description: 'TX pin for UART0'
 value: 11
 UART_0_PIN_RTS:
-description: 'TBD'
+description: 'RTS pin for UART0'
 value: 8
 UART_0_PIN_CTS:
-description: 'TBD'
+description: 'CTS pin for UART0'
 value: 10
 
 SPI_0_MASTER:
@@ -50,19 +50,9 @@ syscfg.defs:
 SPI_0_MASTER_SS_PIN:
 description: 'SPI 0 (master) SS pin number.'
 value:  24
-SPI_1_MASTER:
-description: 'SPI 1 master'
-value:  0
-restrictions:
-- "!SPI_1_SLAVE"
-SPI_1_MASTER_SS_PIN:
-description: 'SPI 1 (master) SS pin number.'
-value:  -1
 SPI_1_SLAVE:
 description: 'SPI 1 slave'
 value:  0
-restrictions:
-- "!SPI_1_MASTER"
 
 TIMER_0:
 description: 'NRF51 Timer 0'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e2dd5391/hw/bsp/nrf51dk-16kbram/syscfg.yml
--
diff --git a/hw/bsp/nrf51dk-16kbram/syscfg.yml 
b/hw/bsp/nrf51dk-16kbram/syscfg.yml
index 9794dcf..83f29d2 100644
--- a/hw/bsp/nrf51dk-16kbram/syscfg.yml
+++ b/hw/bsp/nrf51dk-16kbram/syscfg.yml
@@ -21,27 +21,27 @@
 
 syscfg.defs:
 BSP_NRF51:
-description: 'TBD'
+description: 'Set to indicate that BSP has NRF51'
 value: 1
 
 XTAL_32768:
-description: 'TBD'
+description: 'External 32k oscillator available.'
 value: 1
 
 UART_0:
-description: 'TBD'
+description: 'Whether to enable UART0'
 value: 1
 UART_0_PIN_TX:
-description: 'TBD'
+description: 'TX pin for UART0'
 value: 9
 UART_0_PIN_RX:
-description: 'TBD'
+description: 'RX pin for UART0'
 value: 11
 UART_0_PIN_RTS:
-description: 'TBD'
+description: 'RTS pin for UART0'
 value: 8
 UART_0_PIN_CTS:
-description: 'TBD'
+description: 'CTS pin for UART0'
 value: 10
 
 SPI_0_MASTER:
@@ -50,19 +50,9 @@ syscfg.defs:
 SPI_0_MASTER_SS_PIN:
 description: 'SPI 0 (master) SS pin number.'
 value:  24
-SPI_1_MASTER:
-description: 'SPI 1 master'
-value:  0
-restrictions:
-- "!SPI_1_SLAVE"

[3/3] incubator-mynewt-core git commit: mgmt/imgmgr; clean up unused function prototypes.

2017-02-21 Thread marko
mgmt/imgmgr; clean up unused function prototypes.


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

Branch: refs/heads/develop
Commit: fa6cc192e2af81a6b968292089da42accfb6a06b
Parents: d232170
Author: Marko Kiiskila 
Authored: Tue Feb 21 15:21:33 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 15:21:33 2017 -0800

--
 mgmt/imgmgr/src/imgmgr_priv.h | 7 ---
 1 file changed, 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/fa6cc192/mgmt/imgmgr/src/imgmgr_priv.h
--
diff --git a/mgmt/imgmgr/src/imgmgr_priv.h b/mgmt/imgmgr/src/imgmgr_priv.h
index dbedd53..11b73e2 100644
--- a/mgmt/imgmgr/src/imgmgr_priv.h
+++ b/mgmt/imgmgr/src/imgmgr_priv.h
@@ -93,9 +93,6 @@ struct imgr_state {
 uint32_t off;
 uint32_t size;
 const struct flash_area *fa;
-#if MYNEWT_VAL(IMGMGR_FS)
-struct fs_file *file;
-#endif
 } upload;
 };
 
@@ -103,13 +100,9 @@ extern struct imgr_state imgr_state;
 
 struct nmgr_jbuf;
 
-int imgr_boot2_read(struct mgmt_cbuf *);
-int imgr_boot2_write(struct mgmt_cbuf *);
 int imgr_core_list(struct mgmt_cbuf *);
 int imgr_core_load(struct mgmt_cbuf *);
 int imgr_core_erase(struct mgmt_cbuf *);
-int imgr_splitapp_read(struct mgmt_cbuf *);
-int imgr_splitapp_write(struct mgmt_cbuf *);
 int imgmgr_state_read(struct mgmt_cbuf *cb);
 int imgmgr_state_write(struct mgmt_cbuf *njb);
 int imgr_find_by_ver(struct image_version *find, uint8_t *hash);



[2/3] incubator-mynewt-core git commit: MYNEWT-492; TBD -> descriptions.

2017-02-21 Thread marko
MYNEWT-492; TBD -> descriptions.


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

Branch: refs/heads/develop
Commit: d2321704587ec6e97dc7cb97fd007e65534f0de6
Parents: bca362c
Author: Marko Kiiskila 
Authored: Tue Feb 21 15:21:04 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 15:21:04 2017 -0800

--
 apps/boot/syscfg.yml  |  4 ++--
 boot/bootutil/syscfg.yml  |  6 +++---
 fs/fs/syscfg.yml  |  2 +-
 fs/nffs/syscfg.yml|  4 ++--
 kernel/os/syscfg.yml  | 22 +++---
 mgmt/imgmgr/syscfg.yml|  7 ++-
 net/wifi/wifi_mgmt/syscfg.yml |  2 +-
 test/crash_test/syscfg.yml|  4 ++--
 test/runtest/syscfg.yml   |  4 ++--
 9 files changed, 26 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/apps/boot/syscfg.yml
--
diff --git a/apps/boot/syscfg.yml b/apps/boot/syscfg.yml
index f543fbf..47bd1c5 100644
--- a/apps/boot/syscfg.yml
+++ b/apps/boot/syscfg.yml
@@ -20,10 +20,10 @@
 
 syscfg.defs:
 BOOT_LOADER:
-description: 'TBD'
+description: 'Set to indicate that this app is a bootloader.'
 value: 1
 BOOT_SERIAL:
-description: 'TBD'
+description: 'Support image upgrade over serial within bootloader'
 value: 0
 
 syscfg.vals:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/boot/bootutil/syscfg.yml
--
diff --git a/boot/bootutil/syscfg.yml b/boot/bootutil/syscfg.yml
index e896bf9..80fca9f 100644
--- a/boot/bootutil/syscfg.yml
+++ b/boot/bootutil/syscfg.yml
@@ -20,11 +20,11 @@
 
 syscfg.defs:
 BOOTUTIL_SIGN_RSA:
-description: 'TBD'
+description: 'Images are signed using RSA2048.'
 value: '0'
 BOOTUTIL_SIGN_EC:
-description: 'TBD'
+description: 'Images are signed using ECDSA NIST P-224.'
 value: '0'
 BOOTUTIL_SIGN_EC256:
-description: 'TBD'
+description: 'Images are signed using ECDSA NIST P-256.'
 value: '0'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/fs/fs/syscfg.yml
--
diff --git a/fs/fs/syscfg.yml b/fs/fs/syscfg.yml
index d919f35..3cf5a35 100644
--- a/fs/fs/syscfg.yml
+++ b/fs/fs/syscfg.yml
@@ -20,7 +20,7 @@
 
 syscfg.defs:
 FS_CLI:
-description: 'TBD'
+description: 'CLI commands to interact with files.'
 value: 0
 restrictions:
 - SHELL_TASK

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/fs/nffs/syscfg.yml
--
diff --git a/fs/nffs/syscfg.yml b/fs/nffs/syscfg.yml
index 5602e4b..85be568 100644
--- a/fs/nffs/syscfg.yml
+++ b/fs/nffs/syscfg.yml
@@ -20,12 +20,12 @@
 
 syscfg.defs:
 NFFS_FLASH_AREA:
-description: 'TBD'
+description: 'Flash area to use for NFFS.'
 type: flash_owner
 value:
 restrictions:
 - $notnull
 
 NFFS_DETECT_FAIL:
-description: 'TBD'
+description: 'Controls behaviour when encountering corrupt NFFS area.'
 value: 'NFFS_DETECT_FAIL_FORMAT'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/kernel/os/syscfg.yml
--
diff --git a/kernel/os/syscfg.yml b/kernel/os/syscfg.yml
index a45fc96..b5d9128 100644
--- a/kernel/os/syscfg.yml
+++ b/kernel/os/syscfg.yml
@@ -26,7 +26,7 @@ syscfg.defs:
 description: 'Stack size of initialization and main task'
 value: 1024
 OS_CLI:
-description: 'TBD'
+description: 'CLI commands to inspect OS'
 value: 0
 restrictions:
 - SHELL_TASK
@@ -49,32 +49,32 @@ syscfg.defs:
 description: 'The interval (in milliseconds) at which the watchdog 
should reset if not tickled, in ms'
 value: 3
 MSYS_1_BLOCK_COUNT:
-description: 'TBD'
+description: '1st system pool of mbufs; number of entries'
 value: 12
 MSYS_1_BLOCK_SIZE:
-description: 'TBD'
+  

[1/3] incubator-mynewt-core git commit: stats/stub; coding style nit.

2017-02-21 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 4b7bd1949 -> fa6cc192e


stats/stub; coding style nit.


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

Branch: refs/heads/develop
Commit: bca362caaf5e48ce4a5cb4d5a00dc601338de8ec
Parents: 4b7bd19
Author: Marko Kiiskila 
Authored: Tue Feb 21 14:52:51 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 14:52:51 2017 -0800

--
 sys/stats/stub/include/stats/stats.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bca362ca/sys/stats/stub/include/stats/stats.h
--
diff --git a/sys/stats/stub/include/stats/stats.h 
b/sys/stats/stub/include/stats/stats.h
index 0e5f55f..bd0b4a3 100644
--- a/sys/stats/stub/include/stats/stats.h
+++ b/sys/stats/stub/include/stats/stats.h
@@ -44,7 +44,7 @@ struct stats_hdr {
 STAILQ_ENTRY(stats_hdr) s_next;
 };
 
-#define STATS_SECT_DECL(__name) \
+#define STATS_SECT_DECL(__name) \
 struct stats_ ## __name
 #define STATS_SECT_END };
 



incubator-mynewt-core git commit: MYNEWT-492; TBD -> descriptions.

2017-02-21 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop c007c -> 4b7bd1949


MYNEWT-492; TBD -> descriptions.


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

Branch: refs/heads/develop
Commit: 4b7bd194906df264e43a7c333a7e326ca83f20c7
Parents: c00
Author: Marko Kiiskila 
Authored: Tue Feb 21 14:16:09 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 14:16:09 2017 -0800

--
 sys/flash_map/syscfg.yml | 2 +-
 sys/log/full/syscfg.yml  | 2 +-
 sys/reboot/syscfg.yml| 8 
 sys/shell/syscfg.yml | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4b7bd194/sys/flash_map/syscfg.yml
--
diff --git a/sys/flash_map/syscfg.yml b/sys/flash_map/syscfg.yml
index 8f49d44..2dfc91a 100644
--- a/sys/flash_map/syscfg.yml
+++ b/sys/flash_map/syscfg.yml
@@ -17,5 +17,5 @@
 
 syscfg.defs:
 FLASH_MAP_MAX_AREAS:
-description: 'TBD'
+description: 'Maximum number of expected flash areas'
 value: 10

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4b7bd194/sys/log/full/syscfg.yml
--
diff --git a/sys/log/full/syscfg.yml b/sys/log/full/syscfg.yml
index 6a2721b..7d58a4d 100644
--- a/sys/log/full/syscfg.yml
+++ b/sys/log/full/syscfg.yml
@@ -19,7 +19,7 @@
 
 syscfg.defs:
 LOG_LEVEL:
-description: 'TBD'
+description: 'Limits what level log messages are compiled in.'
 value: 0
 
 LOG_FCB:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4b7bd194/sys/reboot/syscfg.yml
--
diff --git a/sys/reboot/syscfg.yml b/sys/reboot/syscfg.yml
index a1884ca..012e1a3 100644
--- a/sys/reboot/syscfg.yml
+++ b/sys/reboot/syscfg.yml
@@ -20,23 +20,23 @@
 
 syscfg.defs:
 REBOOT_LOG_FCB:
-description: 'TBD'
+description: 'Set reboot log target to be FCB.'
 value: 0
 restrictions:
 - LOG_FCB
 - REBOOT_LOG_FLASH_AREA
 
 REBOOT_LOG_CONSOLE:
-description: 'TBD'
+description: 'Set reboot log target to be console.'
 value: 1
 restrictions:
 - LOG_CONSOLE
 
 REBOOT_LOG_FLASH_AREA:
-description: 'TBD'
+description: 'Flash area where reboot log is stored.'
 type: flash_owner
 value:
 
 REBOOT_LOG_ENTRY_COUNT:
-description: 'TBD'
+description: 'Minimum number of reboot log entries retained'
 value: 10

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4b7bd194/sys/shell/syscfg.yml
--
diff --git a/sys/shell/syscfg.yml b/sys/shell/syscfg.yml
index c495c58..c6929e6 100644
--- a/sys/shell/syscfg.yml
+++ b/sys/shell/syscfg.yml
@@ -20,10 +20,10 @@
 
 syscfg.defs:
 SHELL_TASK:
-description: 'TBD'
+description: 'Controls whether shell is enabled or not.'
 value: 0
 SHELL_MAX_INPUT_LEN:
-description: 'TBD'
+description: 'Maximum input line length'
 value: 256
 SHELL_DEBUG:
 description: Enables additional error checking in the shell package.



[1/2] incubator-mynewt-core git commit: MYNEWT-492; sys/config - TBD -> descriptions.

2017-02-21 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop a42c0c109 -> c007c


MYNEWT-492; sys/config - TBD -> descriptions.


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

Branch: refs/heads/develop
Commit: 7944913eb3f8f8931cc52471dd47bc5dacf8b091
Parents: a42c0c1
Author: Marko Kiiskila 
Authored: Tue Feb 21 13:50:28 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 13:50:28 2017 -0800

--
 sys/config/syscfg.yml | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7944913e/sys/config/syscfg.yml
--
diff --git a/sys/config/syscfg.yml b/sys/config/syscfg.yml
index 1a80d61..462f168 100644
--- a/sys/config/syscfg.yml
+++ b/sys/config/syscfg.yml
@@ -20,43 +20,43 @@
 
 syscfg.defs:
 CONFIG_FCB:
-description: 'TBD'
+description: 'Config default storage is in FCB'
 value: 0
 restrictions:
 - '!CONFIG_NFFS'
 - 'CONFIG_FCB_FLASH_AREA'
 CONFIG_NFFS:
-description: 'TBD'
+description: 'Config default storage is in NFFS'
 value: 0
 restrictions:
 - '!CONFIG_FCB'
 CONFIG_NEWTMGR:
-description: 'TBD'
+description: 'Newtmgr access to config'
 value: 0
 
 CONFIG_CLI:
-description: 'TBD'
+description: 'CLI commands for accessing config'
 value: 0
 restrictions:
 - 'SHELL_TASK'
 
 syscfg.defs.CONFIG_FCB:
 CONFIG_FCB_FLASH_AREA:
-description: 'TBD'
+description: 'BSP flash area for config'
 type: 'flash_owner'
 value:
 CONFIG_FCB_MAGIC:
-description: 'TBD'
-value: 0xc09f6e5e
+description: 'Magic to identify valid configuration area'
+value: 0xc0ff
 
 syscfg.defs.CONFIG_NFFS:
 CONFIG_NFFS_DIR:
-description: 'TBD'
+description: 'Directory where config is stored'
 value: '"/cfg"'
 CONFIG_NFFS_FILE:
-description: 'TBD'
+description: 'Name for the default config file'
 value: '"/cfg/run"'
 CONFIG_NFFS_MAX_LINES:
-description: 'TBD'
+description: 'Limit how many items stored in file before compressing'
 value: 32
 



[2/2] incubator-mynewt-core git commit: MYNEWT-560; conf_fcb_src() always set f_magic.

2017-02-21 Thread marko
MYNEWT-560; conf_fcb_src() always set f_magic.


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

Branch: refs/heads/develop
Commit: c007c4cdbe5dd474b03b95c8870d7eda20c9
Parents: 7944913
Author: Marko Kiiskila 
Authored: Tue Feb 21 13:54:23 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 21 13:54:23 2017 -0800

--
 sys/config/src/config_fcb.c| 2 --
 sys/config/test-fcb/src/testcases/config_test_compress_reset.c | 2 ++
 sys/config/test-fcb/src/testcases/config_test_empty_fcb.c  | 1 +
 sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c | 1 +
 sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c | 1 +
 sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c | 1 +
 sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c   | 1 +
 7 files changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c007/sys/config/src/config_fcb.c
--
diff --git a/sys/config/src/config_fcb.c b/sys/config/src/config_fcb.c
index 334ae58..080ad45 100644
--- a/sys/config/src/config_fcb.c
+++ b/sys/config/src/config_fcb.c
@@ -29,7 +29,6 @@
 #include "config/config_fcb.h"
 #include "config_priv.h"
 
-#define CONF_FCB_MAGIC 0xc0ff
 #define CONF_FCB_VERS  1
 
 struct conf_fcb_load_cb_arg {
@@ -51,7 +50,6 @@ conf_fcb_src(struct conf_fcb *cf)
 {
 int rc;
 
-cf->cf_fcb.f_magic = CONF_FCB_MAGIC;
 cf->cf_fcb.f_version = CONF_FCB_VERS;
 cf->cf_fcb.f_scratch_cnt = 1;
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c007/sys/config/test-fcb/src/testcases/config_test_compress_reset.c
--
diff --git a/sys/config/test-fcb/src/testcases/config_test_compress_reset.c 
b/sys/config/test-fcb/src/testcases/config_test_compress_reset.c
index 46606f2..123d151 100644
--- a/sys/config/test-fcb/src/testcases/config_test_compress_reset.c
+++ b/sys/config/test-fcb/src/testcases/config_test_compress_reset.c
@@ -30,6 +30,7 @@ TEST_CASE(config_test_compress_reset)
 config_wipe_srcs();
 config_wipe_fcb(fcb_areas, sizeof(fcb_areas) / sizeof(fcb_areas[0]));
 
+cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC);
 cf.cf_fcb.f_sectors = fcb_areas;
 cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]);
 
@@ -72,6 +73,7 @@ TEST_CASE(config_test_compress_reset)
 
 memset(&cf, 0, sizeof(cf));
 
+cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC);
 cf.cf_fcb.f_sectors = fcb_areas;
 cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c007/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c
--
diff --git a/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c 
b/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c
index a72d1c5..d6c1fd9 100644
--- a/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c
+++ b/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c
@@ -26,6 +26,7 @@ TEST_CASE(config_test_empty_fcb)
 config_wipe_srcs();
 config_wipe_fcb(fcb_areas, sizeof(fcb_areas) / sizeof(fcb_areas[0]));
 
+cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC);
 cf.cf_fcb.f_sectors = fcb_areas;
 cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c007/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c
--
diff --git a/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c 
b/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c
index 68dc711..e49386a 100644
--- a/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c
+++ b/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c
@@ -25,6 +25,7 @@ TEST_CASE(config_test_save_1_fcb)
 
 config_wipe_srcs();
 
+cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC);
 cf.cf_fcb.f_sectors = fcb_areas;
 cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c007/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c
--
diff --git a/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c 
b/

incubator-mynewt-core git commit: BSP for BBC micro:bit. See http://tech.microbit.org/hardware.

2017-02-17 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 868f79dfa -> 5f5e19ff8


BSP for BBC micro:bit. See http://tech.microbit.org/hardware.


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

Branch: refs/heads/develop
Commit: 5f5e19ff8e78a819b3ee0c4422dbbd915af984c6
Parents: 868f79d
Author: Marko Kiiskila 
Authored: Fri Feb 17 17:39:01 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Feb 17 17:40:58 2017 -0800

--
 README.md   |   1 +
 hw/bsp/bbc_microbit/boot-nrf51xxac.ld   |  27 ++
 hw/bsp/bbc_microbit/bsp.yml |  62 
 hw/bsp/bbc_microbit/include/bsp/bsp.h   |  50 
 hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h|  30 ++
 hw/bsp/bbc_microbit/microbit_debug.sh   |  37 +++
 hw/bsp/bbc_microbit/microbit_download.sh|  42 +++
 hw/bsp/bbc_microbit/nrf51xxac.ld|  30 ++
 hw/bsp/bbc_microbit/pkg.yml |  88 ++
 hw/bsp/bbc_microbit/split-microbit.ld   | 185 
 .../src/arch/cortex_m0/gcc_startup_nrf51.s  | 280 +++
 .../arch/cortex_m0/gcc_startup_nrf51_split.s| 182 
 hw/bsp/bbc_microbit/src/hal_bsp.c   | 176 
 hw/bsp/bbc_microbit/src/sbrk.c  |  57 
 hw/bsp/bbc_microbit/syscfg.yml  |  84 ++
 15 files changed, 1331 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/README.md
--
diff --git a/README.md b/README.md
index 29c7beb..44f6b74 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,7 @@ It currently supports the following hardware platforms:
 * Arduino Primo NRF52 (Cortex-M4)
 * NUCLEO-F401RE (Cortex-M4)
 * FRDM-K64F from NXP (Cortex-M4)
+* BBC micro:bit (Nordic nrf51822; Cortex-M0)
 
 Apache Mynewt uses the
 [Newt](https://www.github.com/apache/incubator-mynewt-newt) build and package

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/boot-nrf51xxac.ld
--
diff --git a/hw/bsp/bbc_microbit/boot-nrf51xxac.ld 
b/hw/bsp/bbc_microbit/boot-nrf51xxac.ld
new file mode 100755
index 000..9285807
--- /dev/null
+++ b/hw/bsp/bbc_microbit/boot-nrf51xxac.ld
@@ -0,0 +1,27 @@
+/* Linker script for Nordic Semiconductor nRF5 devices
+ *
+ * Version: Sourcery G++ 4.5-1
+ * Support: https://support.codesourcery.com/GNUToolchain/
+ *
+ * Copyright (c) 2007, 2008, 2009, 2010 CodeSourcery, Inc.
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions.  No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+MEMORY
+{
+  FLASH (rx) : ORIGIN = 0x, LENGTH = 0x4000
+  RAM (rwx) :  ORIGIN = 0x2000, LENGTH = 0x4000
+}
+
+/* The bootloader does not contain an image header */
+_imghdr_size = 0x0;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/bsp.yml
--
diff --git a/hw/bsp/bbc_microbit/bsp.yml b/hw/bsp/bbc_microbit/bsp.yml
new file mode 100644
index 000..ee9bdf1
--- /dev/null
+++ b/hw/bsp/bbc_microbit/bsp.yml
@@ -0,0 +1,62 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and l

incubator-mynewt-core git commit: MYNEWT-632; uart1 pin <-> syscfg reversed.

2017-02-17 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 6b55b72c2 -> 868f79dfa


MYNEWT-632; uart1 pin <-> syscfg reversed.


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

Branch: refs/heads/develop
Commit: 868f79dfaf7b25eeb5e740dde82cab2c830b59e0
Parents: 6b55b72
Author: Marko Kiiskila 
Authored: Fri Feb 17 16:20:30 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Feb 17 16:20:30 2017 -0800

--
 hw/bsp/arduino_primo_nrf52/src/hal_bsp.c | 4 ++--
 hw/bsp/arduino_primo_nrf52/syscfg.yml| 4 ++--
 hw/bsp/bmd300eval/src/hal_bsp.c  | 4 ++--
 hw/bsp/nrf52840pdk/src/hal_bsp.c | 4 ++--
 hw/bsp/nrf52dk/src/hal_bsp.c | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/868f79df/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
--
diff --git a/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c 
b/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
index 4e77617..4229a88 100644
--- a/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
+++ b/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
@@ -51,8 +51,8 @@ static const struct nrf52_uart_cfg os_bsp_uart0_cfg = {
 #if MYNEWT_VAL(UART_1)
 static struct uart_dev os_bsp_bitbang_uart1;
 static const struct uart_bitbang_conf os_bsp_uart1_cfg = {
-.ubc_rxpin = MYNEWT_VAL(UART_1_PIN_TX),
-.ubc_txpin = MYNEWT_VAL(UART_1_PIN_RX),
+.ubc_txpin = MYNEWT_VAL(UART_1_PIN_TX),
+.ubc_rxpin = MYNEWT_VAL(UART_1_PIN_RX),
 .ubc_cputimer_freq = MYNEWT_VAL(OS_CPUTIME_FREQ),
 };
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/868f79df/hw/bsp/arduino_primo_nrf52/syscfg.yml
--
diff --git a/hw/bsp/arduino_primo_nrf52/syscfg.yml 
b/hw/bsp/arduino_primo_nrf52/syscfg.yml
index 4408b8b..01d2ded 100644
--- a/hw/bsp/arduino_primo_nrf52/syscfg.yml
+++ b/hw/bsp/arduino_primo_nrf52/syscfg.yml
@@ -53,10 +53,10 @@ syscfg.defs:
 value:  1
 UART_1_PIN_TX:
 description: 'TBD'
-value:  5
+value:  6
 UART_1_PIN_RX:
 description: 'TBD'
-value:  6
+value:  5
 UART_1_PIN_RTS:
 description: 'TBD'
 value:  0

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/868f79df/hw/bsp/bmd300eval/src/hal_bsp.c
--
diff --git a/hw/bsp/bmd300eval/src/hal_bsp.c b/hw/bsp/bmd300eval/src/hal_bsp.c
index 4f6ebb1..03e302a 100644
--- a/hw/bsp/bmd300eval/src/hal_bsp.c
+++ b/hw/bsp/bmd300eval/src/hal_bsp.c
@@ -46,8 +46,8 @@ static const struct nrf52_uart_cfg os_bsp_uart0_cfg = {
 #if MYNEWT_VAL(UART_1)
 static struct uart_dev os_bsp_bitbang_uart1;
 static const struct uart_bitbang_conf os_bsp_uart1_cfg = {
-.ubc_rxpin = MYNEWT_VAL(UART_1_PIN_TX),
-.ubc_txpin = MYNEWT_VAL(UART_1_PIN_RX),
+.ubc_txpin = MYNEWT_VAL(UART_1_PIN_TX),
+.ubc_rxpin = MYNEWT_VAL(UART_1_PIN_RX),
 .ubc_cputimer_freq = MYNEWT_VAL(OS_CPUTIME_FREQ),
 };
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/868f79df/hw/bsp/nrf52840pdk/src/hal_bsp.c
--
diff --git a/hw/bsp/nrf52840pdk/src/hal_bsp.c b/hw/bsp/nrf52840pdk/src/hal_bsp.c
index c904cdb..a0c78b8 100644
--- a/hw/bsp/nrf52840pdk/src/hal_bsp.c
+++ b/hw/bsp/nrf52840pdk/src/hal_bsp.c
@@ -49,8 +49,8 @@ static const struct nrf52_uart_cfg os_bsp_uart0_cfg = {
 #if MYNEWT_VAL(UART_1)
 static struct uart_dev os_bsp_bitbang_uart1;
 static const struct uart_bitbang_conf os_bsp_uart1_cfg = {
-.ubc_rxpin = MYNEWT_VAL(UART_1_PIN_TX),
-.ubc_txpin = MYNEWT_VAL(UART_1_PIN_RX),
+.ubc_txpin = MYNEWT_VAL(UART_1_PIN_TX),
+.ubc_rxpin = MYNEWT_VAL(UART_1_PIN_RX),
 .ubc_cputimer_freq = MYNEWT_VAL(OS_CPUTIME_FREQ),
 };
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/868f79df/hw/bsp/nrf52dk/src/hal_bsp.c
--
diff --git a/hw/bsp/nrf52dk/src/hal_bsp.c b/hw/bsp/nrf52dk/src/hal_bsp.c
index 40ce57b..1ab37e1 100644
--- a/hw/bsp/nrf52dk/src/hal_bsp.c
+++ b/hw/bsp/nrf52dk/src/hal_bsp.c
@@ -56,8 +56,8 @@ static const struct nrf52_uart_cfg os_bsp_uart0_cfg = {
 #if MYNEWT_VAL(UART_1)
 static struct uart_dev os_bsp_bitbang_uart1;
 static const struct uart_bitbang_conf os_bsp_uart1_cfg = {
-.ubc_rxpin = MYNEWT_VAL(UART_1_PIN_TX),
-.ubc_txpin = MYN

incubator-mynewt-core git commit: oicmgr; apps which were not calling mgmt_evq_set() were not registering oic resource for newtmgr.

2017-02-17 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop cfc231441 -> 6b55b72c2


oicmgr; apps which were not calling mgmt_evq_set() were not
registering oic resource for newtmgr.


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

Branch: refs/heads/develop
Commit: 6b55b72c2aa22f7916fab414acc7f4129c98faec
Parents: cfc2314
Author: Marko Kiiskila 
Authored: Fri Feb 17 13:17:00 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Feb 17 13:18:32 2017 -0800

--
 mgmt/oicmgr/src/oicmgr.c | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6b55b72c/mgmt/oicmgr/src/oicmgr.c
--
diff --git a/mgmt/oicmgr/src/oicmgr.c b/mgmt/oicmgr/src/oicmgr.c
index 75e8bde..d2110ef 100644
--- a/mgmt/oicmgr/src/oicmgr.c
+++ b/mgmt/oicmgr/src/oicmgr.c
@@ -222,6 +222,7 @@ oicmgr_init(void)
 goto err;
 }
 
+mgmt_evq_set(os_eventq_dflt_get());
 return (0);
 err:
 return (rc);



[2/3] incubator-mynewt-core git commit: Fix review issues of fcb_offset_last_n

2017-02-15 Thread marko
Fix review issues of fcb_offset_last_n


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

Branch: refs/heads/develop
Commit: 925b6bb7e964bf6fbce244596731bf68c975771d
Parents: e0d92a5
Author: Fabio Utzig 
Authored: Wed Feb 15 15:07:18 2017 -0800
Committer: Fabio Utzig 
Committed: Wed Feb 15 15:07:18 2017 -0800

--
 fs/fcb/src/fcb.c   | 21 -
 fs/fcb/test/src/testcases/fcb_test_last_of_n.c | 21 ++---
 2 files changed, 26 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/925b6bb7/fs/fcb/src/fcb.c
--
diff --git a/fs/fcb/src/fcb.c b/fs/fcb/src/fcb.c
index 21bbc2f..0a68be0 100644
--- a/fs/fcb/src/fcb.c
+++ b/fs/fcb/src/fcb.c
@@ -205,36 +205,39 @@ fcb_sector_hdr_read(struct fcb *fcb, struct flash_area 
*fap,
 }
 
 /**
- * Finds the last n-th element fcb_entry (0 index means last element!)
+ * Finds the fcb entry that gives back upto n entries at the end.
  * @param0 ptr to fcb
- * @param1 n number of entries to calculate offset before
+ * @param1 n number of fcb entries the user wants to get
  * @param2 ptr to the fcb_entry to be returned
- * @return 0 on success; non-zero on failure
+ * @return 0 on there are any fcbs aviable; OS_ENOENT otherwise
  */
 int
 fcb_offset_last_n(struct fcb *fcb, uint8_t entries,
 struct fcb_entry *last_n_entry)
 {
 struct fcb_entry loc;
-struct fcb_entry start;
 int i;
 
+/* assure a minimum amount of entries */
+if (!entries) {
+entries = 1;
+}
+
 i = 0;
 memset(&loc, 0, sizeof(loc));
 while (!fcb_getnext(fcb, &loc)) {
 if (i == 0) {
 /* Start from the beginning of fcb entries */
-*last_n_entry = start = loc;
+*last_n_entry = loc;
 }
 /* Update last_n_entry after n entries and keep updating */
-else if (i > entries) {
-fcb_getnext(fcb, &start);
-*last_n_entry = start;
+else if (i > (entries - 1)) {
+fcb_getnext(fcb, last_n_entry);
 }
 i++;
 }
 
-return (entries + 1) > i ? OS_ENOENT : 0;
+return (i == 0) ? OS_ENOENT : 0;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/925b6bb7/fs/fcb/test/src/testcases/fcb_test_last_of_n.c
--
diff --git a/fs/fcb/test/src/testcases/fcb_test_last_of_n.c 
b/fs/fcb/test/src/testcases/fcb_test_last_of_n.c
index deebe54..5ada743 100644
--- a/fs/fcb/test/src/testcases/fcb_test_last_of_n.c
+++ b/fs/fcb/test/src/testcases/fcb_test_last_of_n.c
@@ -31,6 +31,10 @@ TEST_CASE(fcb_test_last_of_n)
 fcb = &test_fcb;
 fcb->f_scratch_cnt = 1;
 
+/* No fcbs available */
+rc = fcb_offset_last_n(fcb, 1, &loc);
+assert (rc != 0);
+
 /*
  * Add some fcbs.
  */
@@ -50,26 +54,29 @@ TEST_CASE(fcb_test_last_of_n)
 areas[i] = loc;
 }
 
-/* after last valid entry */
-rc = fcb_offset_last_n(fcb, 5, &loc);
-assert (rc != 0);
-
 /* last entry */
-rc = fcb_offset_last_n(fcb, 0, &loc);
+rc = fcb_offset_last_n(fcb, 1, &loc);
 assert (rc == 0);
 assert (areas[4].fe_area == loc.fe_area);
 assert (areas[4].fe_data_off == loc.fe_data_off);
 assert (areas[4].fe_data_len == loc.fe_data_len);
 
 /* somewhere in the middle */
-rc = fcb_offset_last_n(fcb, 2, &loc);
+rc = fcb_offset_last_n(fcb, 3, &loc);
 assert (rc == 0);
 assert (areas[2].fe_area == loc.fe_area);
 assert (areas[2].fe_data_off == loc.fe_data_off);
 assert (areas[2].fe_data_len == loc.fe_data_len);
 
 /* first entry */
-rc = fcb_offset_last_n(fcb, 4, &loc);
+rc = fcb_offset_last_n(fcb, 5, &loc);
+assert (rc == 0);
+assert (areas[0].fe_area == loc.fe_area);
+assert (areas[0].fe_data_off == loc.fe_data_off);
+assert (areas[0].fe_data_len == loc.fe_data_len);
+
+/* after last valid entry, returns the first one like for 5 */
+rc = fcb_offset_last_n(fcb, 6, &loc);
 assert (rc == 0);
 assert (areas[0].fe_area == loc.fe_area);
 assert (areas[0].fe_data_off == loc.fe_data_off);



[3/3] incubator-mynewt-core git commit: This closes #176.

2017-02-15 Thread marko
This closes #176.

Merge branch 'mynewt-335' of https://github.com/utzig/incubator-mynewt-core 
into develop


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

Branch: refs/heads/develop
Commit: 3ad2ce23d15a7a6cb6f7805ede3ae8510034b1ae
Parents: 745d627 925b6bb
Author: Marko Kiiskila 
Authored: Wed Feb 15 15:19:16 2017 -0800
Committer: Marko Kiiskila 
Committed: Wed Feb 15 15:19:16 2017 -0800

--
 fs/fcb/include/fcb/fcb.h   |  6 +-
 fs/fcb/src/fcb.c   | 29 +++
 fs/fcb/test/src/fcb_test.c |  5 +-
 fs/fcb/test/src/testcases/fcb_test_last_of_n.c | 84 +
 sys/log/full/src/log_fcb.c |  7 +-
 5 files changed, 112 insertions(+), 19 deletions(-)
--




[1/3] incubator-mynewt-core git commit: MYNEWT-335

2017-02-15 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 745d6279d -> 3ad2ce23d


MYNEWT-335

- fcb_offset_last_n() changed to return a struct fcb_entry
- Added a test case
- Now properly returns error when there is no item at requested offset


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

Branch: refs/heads/develop
Commit: e0d92a5d34849310e0ddbb2179c3d960cf15cc91
Parents: d61c6cd
Author: Fabio Utzig 
Authored: Fri Feb 10 17:50:44 2017 -0800
Committer: Fabio Utzig 
Committed: Mon Feb 13 10:52:51 2017 -0800

--
 fs/fcb/include/fcb/fcb.h   |  6 +-
 fs/fcb/src/fcb.c   | 18 ++---
 fs/fcb/test/src/fcb_test.c |  5 +-
 fs/fcb/test/src/testcases/fcb_test_last_of_n.c | 77 +
 sys/log/full/src/log_fcb.c |  7 +-
 5 files changed, 98 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e0d92a5d/fs/fcb/include/fcb/fcb.h
--
diff --git a/fs/fcb/include/fcb/fcb.h b/fs/fcb/include/fcb/fcb.h
index db19a2a..76f557a 100644
--- a/fs/fcb/include/fcb/fcb.h
+++ b/fs/fcb/include/fcb/fcb.h
@@ -127,8 +127,12 @@ int fcb_free_sector_cnt(struct fcb *fcb);
  */
 int fcb_is_empty(struct fcb *fcb);
 
+/*
+ * Element at offset *entries* from last position (backwards).
+ */
 int
-fcb_offset_last_n(struct fcb *fcb, uint8_t entries, uint32_t *last_n_off);
+fcb_offset_last_n(struct fcb *fcb, uint8_t entries,
+struct fcb_entry *last_n_entry);
 
 /*
  * Clears FCB passed to it

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e0d92a5d/fs/fcb/src/fcb.c
--
diff --git a/fs/fcb/src/fcb.c b/fs/fcb/src/fcb.c
index 0e210df..21bbc2f 100644
--- a/fs/fcb/src/fcb.c
+++ b/fs/fcb/src/fcb.c
@@ -205,14 +205,15 @@ fcb_sector_hdr_read(struct fcb *fcb, struct flash_area 
*fap,
 }
 
 /**
- * Finds n-th element offset
+ * Finds the last n-th element fcb_entry (0 index means last element!)
  * @param0 ptr to fcb
  * @param1 n number of entries to calculate offset before
- * @param2 ptr to the offset before to be returned
+ * @param2 ptr to the fcb_entry to be returned
  * @return 0 on success; non-zero on failure
  */
 int
-fcb_offset_last_n(struct fcb *fcb, uint8_t entries, uint32_t *last_n_off)
+fcb_offset_last_n(struct fcb *fcb, uint8_t entries,
+struct fcb_entry *last_n_entry)
 {
 struct fcb_entry loc;
 struct fcb_entry start;
@@ -223,18 +224,17 @@ fcb_offset_last_n(struct fcb *fcb, uint8_t entries, 
uint32_t *last_n_off)
 while (!fcb_getnext(fcb, &loc)) {
 if (i == 0) {
 /* Start from the beginning of fcb entries */
-*last_n_off = loc.fe_elem_off;
-start = loc;
+*last_n_entry = start = loc;
 }
-/* Update last_n_off after n entries and keep updating */
-if (i >= (entries - 1)) {
+/* Update last_n_entry after n entries and keep updating */
+else if (i > entries) {
 fcb_getnext(fcb, &start);
-*last_n_off = start.fe_elem_off;
+*last_n_entry = start;
 }
 i++;
 }
 
-return 0;
+return (entries + 1) > i ? OS_ENOENT : 0;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e0d92a5d/fs/fcb/test/src/fcb_test.c
--
diff --git a/fs/fcb/test/src/fcb_test.c b/fs/fcb/test/src/fcb_test.c
index 77d2d3e..34a9be8 100644
--- a/fs/fcb/test/src/fcb_test.c
+++ b/fs/fcb/test/src/fcb_test.c
@@ -158,10 +158,10 @@ TEST_CASE_DECL(fcb_test_append_fill)
 TEST_CASE_DECL(fcb_test_reset)
 TEST_CASE_DECL(fcb_test_rotate)
 TEST_CASE_DECL(fcb_test_multiple_scratch)
+TEST_CASE_DECL(fcb_test_last_of_n)
 
 TEST_SUITE(fcb_test_all)
 {
-
 tu_case_set_pre_cb(fcb_tc_pretest, (void*)2);
 fcb_test_len();
 
@@ -188,6 +188,9 @@ TEST_SUITE(fcb_test_all)
 
 tu_case_set_pre_cb(fcb_tc_pretest, (void*)4);
 fcb_test_multiple_scratch();
+
+tu_case_set_pre_cb(fcb_tc_pretest, (void*)4);
+fcb_test_last_of_n();
 }
 
 #if MYNEWT_VAL(SELFTEST)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e0d92a5d/fs/fcb/test/src/testcases/fcb_test_last_of_n.c
--
diff --git a/fs/fcb/test/src/testcases/fcb_test_last_of_n.c 
b/fs/fcb/test/src/testcases/fcb_test_last_of_n.c
new file mode 100644
index 000..deebe54
--- /dev/null

incubator-mynewt-newt git commit: MYNEWT-623; github api server and git server are the same hostname in enterprise github servers. API calls have a different prefix.

2017-02-14 Thread marko
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 128feabdb -> ec61f09d4


MYNEWT-623; github api server and git server are the same hostname
in enterprise github servers. API calls have a different prefix.


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

Branch: refs/heads/develop
Commit: ec61f09d4c8f89cf1b0739ed202afb2e5199880d
Parents: 128feab
Author: Marko Kiiskila 
Authored: Tue Feb 14 12:34:58 2017 -0800
Committer: Marko Kiiskila 
Committed: Tue Feb 14 12:37:03 2017 -0800

--
 newt/downloader/downloader.go | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/ec61f09d/newt/downloader/downloader.go
--
diff --git a/newt/downloader/downloader.go b/newt/downloader/downloader.go
index 06557dd..0ab201e 100644
--- a/newt/downloader/downloader.go
+++ b/newt/downloader/downloader.go
@@ -118,12 +118,14 @@ func (gd *GenericDownloader) TempDir() (string, error) {
 }
 
 func (gd *GithubDownloader) FetchFile(name string, dest string) error {
-   server := "github.com"
+   server := "api.github.com"
+   prefix := "repos"
if gd.Server != "" {
server = gd.Server
+   prefix = "api/v3/repos"
}
-   url := fmt.Sprintf("https://api.%s/repos/%s/%s/contents/%s?ref=%s";,
-   server, gd.User, gd.Repo, name, gd.Branch())
+   url := fmt.Sprintf("https://%s/%s/%s/%s/contents/%s?ref=%s";,
+   server, prefix, gd.User, gd.Repo, name, gd.Branch())
 
req, err := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/vnd.github.v3.raw")



incubator-mynewt-core git commit: MYNEWT-545; switch from using load address to using load region.

2017-02-13 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop d3397d7ab -> 4f4f68701


MYNEWT-545; switch from using load address to using load region.


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

Branch: refs/heads/develop
Commit: 4f4f6870154765bea18eb6cf73d97b896bb0f59a
Parents: d3397d7
Author: Marko Kiiskila 
Authored: Mon Feb 13 17:53:28 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Feb 13 17:53:28 2017 -0800

--
 hw/bsp/arduino_primo_nrf52/split-primo.ld   |   4 +-
 hw/bsp/bmd200/split-nrf51dk.ld  |   4 +-
 hw/bsp/bmd300eval/split-bmd300eval.ld   |   4 +-
 hw/bsp/nrf51dk/split-nrf51dk.ld |   4 +-
 hw/bsp/nrf52dk/split-nrf52dk.ld |   4 +-
 .../run_from_flash.ld   | 204 --
 .../run_from_loader.ld  | 210 ---
 .../olimex_stm32-e407_devboard/run_from_sram.ld | 202 --
 hw/bsp/rb-nano2/split-rb-nano2.ld   |   4 +-
 hw/bsp/stm32f4discovery/run_from_flash.ld   | 204 --
 hw/bsp/stm32f4discovery/run_from_loader.ld  | 210 ---
 hw/bsp/stm32f4discovery/run_from_sram.ld| 202 --
 hw/bsp/usbmkw41z/boot-mkw41z512.ld  |   4 +-
 hw/bsp/usbmkw41z/mkw41z512.ld   |   4 +-
 hw/mcu/nordic/nrf51xxx/nrf51.ld |   4 +-
 hw/mcu/nordic/nrf52xxx/nrf52.ld |   4 +-
 hw/mcu/stm/stm32f4xx/stm32f401.ld   |   8 +-
 hw/mcu/stm/stm32f4xx/stm32f407.ld   |   8 +-
 18 files changed, 28 insertions(+), 1260 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/arduino_primo_nrf52/split-primo.ld
--
diff --git a/hw/bsp/arduino_primo_nrf52/split-primo.ld 
b/hw/bsp/arduino_primo_nrf52/split-primo.ld
index ebfac21..f4ffe5a 100755
--- a/hw/bsp/arduino_primo_nrf52/split-primo.ld
+++ b/hw/bsp/arduino_primo_nrf52/split-primo.ld
@@ -122,7 +122,7 @@ SECTIONS
 _loader_ram_end = .;
 } > RAM
 
-.data : AT (__etext)
+.data :
 {
 __data_start__ = .;
 *(.data*)
@@ -151,7 +151,7 @@ SECTIONS
 . = ALIGN(4);
 /* All data end */
 __data_end__ = .;
-} > RAM
+} > RAM AT > FLASH
 
 /* Non-zeroed BSS.  This section is similar to BSS, with the following two
  * caveats:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/bmd200/split-nrf51dk.ld
--
diff --git a/hw/bsp/bmd200/split-nrf51dk.ld b/hw/bsp/bmd200/split-nrf51dk.ld
index bd8c2be..55d154e 100644
--- a/hw/bsp/bmd200/split-nrf51dk.ld
+++ b/hw/bsp/bmd200/split-nrf51dk.ld
@@ -116,7 +116,7 @@ SECTIONS
  _loader_ram_end = .;
 } > RAM
 
-.data : AT (__etext)
+.data :
 {
 __data_start__ = .;
 *(.data*)
@@ -146,7 +146,7 @@ SECTIONS
 . = ALIGN(4);
 /* All data end */
 __data_end__ = .;
-} > RAM
+} > RAM AT > FLASH
 
 .bss :
 {

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/bmd300eval/split-bmd300eval.ld
--
diff --git a/hw/bsp/bmd300eval/split-bmd300eval.ld 
b/hw/bsp/bmd300eval/split-bmd300eval.ld
index ebfac21..f4ffe5a 100755
--- a/hw/bsp/bmd300eval/split-bmd300eval.ld
+++ b/hw/bsp/bmd300eval/split-bmd300eval.ld
@@ -122,7 +122,7 @@ SECTIONS
 _loader_ram_end = .;
 } > RAM
 
-.data : AT (__etext)
+.data :
 {
 __data_start__ = .;
 *(.data*)
@@ -151,7 +151,7 @@ SECTIONS
 . = ALIGN(4);
 /* All data end */
 __data_end__ = .;
-} > RAM
+} > RAM AT > FLASH
 
 /* Non-zeroed BSS.  This section is similar to BSS, with the following two
  * caveats:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/nrf51dk/split-nrf51dk.ld
--
diff --git a/hw/bsp/nrf51dk/split-nrf51dk.ld b/hw/bsp/nrf51dk/split-nrf51dk.ld
index bd8c2be..55d154e 100755
--- a/hw/bsp/nrf51dk/split-nrf51dk.ld
+++ b/hw/bsp/nrf51dk/split-nrf51dk.ld
@@ -116,7 +116,7 @@ SECTIONS
  _loader_ram_end = .;
 } > RAM
 
-.data : AT (__etext)
+.data :
 {
 __data_start__ = .;
 *(.data*)
@@ -146,7 +146,7 @@ SECTIONS
 

[2/2] incubator-mynewt-core git commit: MYNEWT-573; config for sys/reboot was not registered properly, as it was done before sys/config was initialized. Change the relative order of sysinit for these

2017-02-13 Thread marko
MYNEWT-573; config for sys/reboot was not registered properly,
as it was done before sys/config was initialized. Change the
relative order of sysinit for these packages.


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

Branch: refs/heads/develop
Commit: d3397d7ab617fa3200f7be629668a83cfb529e64
Parents: 51af56c
Author: Marko Kiiskila 
Authored: Mon Feb 13 12:09:34 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Feb 13 12:09:34 2017 -0800

--
 sys/config/pkg.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d3397d7a/sys/config/pkg.yml
--
diff --git a/sys/config/pkg.yml b/sys/config/pkg.yml
index 0b88781..bc543aa 100644
--- a/sys/config/pkg.yml
+++ b/sys/config/pkg.yml
@@ -36,4 +36,4 @@ pkg.deps.CONFIG_NFFS:
 - fs/nffs
 
 pkg.init:
-config_pkg_init: 300
+config_pkg_init: 50



[1/2] incubator-mynewt-core git commit: sys/reboot; log reset request coming from network differently from assert().

2017-02-13 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 57a5bb602 -> d3397d7ab


sys/reboot; log reset request coming from network differently from
assert().


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

Branch: refs/heads/develop
Commit: 51af56ca6d43c97c95642eb30ae00c59f786c046
Parents: 57a5bb6
Author: Marko Kiiskila 
Authored: Mon Feb 13 12:08:36 2017 -0800
Committer: Marko Kiiskila 
Committed: Mon Feb 13 12:08:36 2017 -0800

--
 hw/hal/include/hal/hal_system.h| 11 ++-
 mgmt/newtmgr/nmgr_os/src/newtmgr_os.c  |  2 +-
 sys/reboot/include/reboot/log_reboot.h |  3 ++-
 sys/reboot/src/log_reboot.c| 24 ++--
 4 files changed, 27 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/51af56ca/hw/hal/include/hal/hal_system.h
--
diff --git a/hw/hal/include/hal/hal_system.h b/hw/hal/include/hal/hal_system.h
index 3b3c90d..4470b3d 100644
--- a/hw/hal/include/hal/hal_system.h
+++ b/hw/hal/include/hal/hal_system.h
@@ -48,11 +48,12 @@ int hal_debugger_connected(void);
  * Reboot reason
  */
 enum hal_reset_reason {
-HAL_RESET_POR = 1, /* power on reset */
-HAL_RESET_PIN = 2, /* caused by reset pin */
-HAL_RESET_WATCHDOG = 3,/* watchdog */
-HAL_RESET_SOFT = 4,/* system_reset() or equiv */
-HAL_RESET_BROWNOUT = 5 /* low supply voltage */
+HAL_RESET_POR = 1,  /* power on reset */
+HAL_RESET_PIN = 2,  /* caused by reset pin */
+HAL_RESET_WATCHDOG = 3, /* watchdog */
+HAL_RESET_SOFT = 4, /* system_reset() or equiv */
+HAL_RESET_BROWNOUT = 5, /* low supply voltage */
+HAL_RESET_REQUESTED = 6,/* restart due to user request */
 };
 enum hal_reset_reason hal_reset_cause(void);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/51af56ca/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
--
diff --git a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c 
b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
index 1e01b24..c3e38d6 100644
--- a/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
+++ b/mgmt/newtmgr/nmgr_os/src/newtmgr_os.c
@@ -330,7 +330,7 @@ nmgr_reset(struct mgmt_cbuf *cb)
 os_callout_init(&nmgr_reset_callout, mgmt_evq_get(), nmgr_reset_tmo, NULL);
 
 #if MYNEWT_VAL(LOG_SOFT_RESET)
-log_reboot(HAL_RESET_SOFT);
+log_reboot(HAL_RESET_REQUESTED);
 #endif
 os_callout_reset(&nmgr_reset_callout, OS_TICKS_PER_SEC / 4);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/51af56ca/sys/reboot/include/reboot/log_reboot.h
--
diff --git a/sys/reboot/include/reboot/log_reboot.h 
b/sys/reboot/include/reboot/log_reboot.h
index 396299c..e3ff093 100644
--- a/sys/reboot/include/reboot/log_reboot.h
+++ b/sys/reboot/include/reboot/log_reboot.h
@@ -30,7 +30,8 @@ extern "C" {
 (reason == HAL_RESET_WATCHDOG ? "WDOG" :\
   (reason == HAL_RESET_SOFT ? "SOFT" :  \
 (reason == HAL_RESET_BROWNOUT ? "BROWNOUT" :\
-  "UNKNOWN")
+  (reason == HAL_RESET_REQUESTED ? "REQUESTED" :\
+"UNKNOWN"))
 
 int reboot_init_handler(int log_store_type, uint8_t entries);
 int log_reboot(enum hal_reset_reason);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/51af56ca/sys/reboot/src/log_reboot.c
--
diff --git a/sys/reboot/src/log_reboot.c b/sys/reboot/src/log_reboot.c
index 952def6..9bfe04c 100644
--- a/sys/reboot/src/log_reboot.c
+++ b/sys/reboot/src/log_reboot.c
@@ -45,13 +45,15 @@ static char reboot_cnt_str[12];
 static char soft_reboot_str[12];
 static char *reboot_cnt_get(int argc, char **argv, char *buf, int max_len);
 static int reboot_cnt_set(int argc, char **argv, char *val);
+static int reboot_cnt_export(void (*export_func)(char *name, char *val),
+ enum conf_export_tgt tgt);
 
 struct conf_handler reboot_conf_handler = {
 .ch_name = "reboot",
 .ch_get = reboot_cnt_get,
 .ch_set = reboot_cnt_set,
 .ch_commit = NULL,
-.ch_export = NULL
+.ch_export = reboot_cnt_export
 };
 
 #if MYNEWT_VAL(REBOOT_LOG_FCB)
@@ -150,18 +152,18 @@ log

[1/3] incubator-mynewt-newt git commit: MYNEWT-622; use util to generate error message.

2017-02-11 Thread marko
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 60306bbac -> 4789254d7


MYNEWT-622; use util to generate error message.


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

Branch: refs/heads/develop
Commit: 43f189c0951f52b10185757a9d3ea8f38e95a5de
Parents: 60306bb
Author: Marko Kiiskila 
Authored: Sat Feb 11 12:01:30 2017 -0800
Committer: Marko Kiiskila 
Committed: Sat Feb 11 12:01:30 2017 -0800

--
 newtmgr/cli/image.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/43f189c0/newtmgr/cli/image.go
--
diff --git a/newtmgr/cli/image.go b/newtmgr/cli/image.go
index 10ac1f0..8a3f692 100644
--- a/newtmgr/cli/image.go
+++ b/newtmgr/cli/image.go
@@ -21,7 +21,6 @@ package cli
 
 import (
"encoding/hex"
-   "errors"
"fmt"
"io/ioutil"
"os"
@@ -390,7 +389,7 @@ func coreConvertCmd(cmd *cobra.Command, args []string) {
 
 func coreDownloadCmd(cmd *cobra.Command, args []string) {
if len(args) < 1 {
-   nmUsage(cmd, errors.New("Need to specify target filename to 
download"))
+   nmUsage(cmd, util.NewNewtError("Need to specify filename for 
core"))
return
}
 



[3/3] incubator-mynewt-newt git commit: MYNEWT-623; allow user to override "github.com" as repo location. Override is done using repository variable "server".

2017-02-11 Thread marko
MYNEWT-623; allow user to override "github.com" as repo location.
Override is done using repository variable "server".


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

Branch: refs/heads/develop
Commit: 4789254d78dd88fcb2b23b084a26e6a383cf7406
Parents: d3d719c
Author: Marko Kiiskila 
Authored: Sat Feb 11 12:39:36 2017 -0800
Committer: Marko Kiiskila 
Committed: Sat Feb 11 12:39:36 2017 -0800

--
 newt/downloader/downloader.go | 20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4789254d/newt/downloader/downloader.go
--
diff --git a/newt/downloader/downloader.go b/newt/downloader/downloader.go
index bd763f5..06557dd 100644
--- a/newt/downloader/downloader.go
+++ b/newt/downloader/downloader.go
@@ -47,8 +47,9 @@ type GenericDownloader struct {
 
 type GithubDownloader struct {
GenericDownloader
-   User string
-   Repo string
+   Server string
+   User   string
+   Repo   string
 
// Github access token for private repositories.
Token string
@@ -117,8 +118,12 @@ func (gd *GenericDownloader) TempDir() (string, error) {
 }
 
 func (gd *GithubDownloader) FetchFile(name string, dest string) error {
-   url := 
fmt.Sprintf("https://api.github.com/repos/%s/%s/contents/%s?ref=%s";,
-   gd.User, gd.Repo, name, gd.Branch())
+   server := "github.com"
+   if gd.Server != "" {
+   server = gd.Server
+   }
+   url := fmt.Sprintf("https://api.%s/repos/%s/%s/contents/%s?ref=%s";,
+   server, gd.User, gd.Repo, name, gd.Branch())
 
req, err := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/vnd.github.v3.raw")
@@ -174,8 +179,12 @@ func (gd *GithubDownloader) DownloadRepo(commit string) 
(string, error) {
 
// Currently only the master branch is supported.
branch := "master"
+   server := "github.com"
 
-   url := fmt.Sprintf("https://github.com/%s/%s.git";, gd.User, gd.Repo)
+   if gd.Server != "" {
+   server = gd.Server
+   }
+   url := fmt.Sprintf("https://%s/%s/%s.git";, server, gd.User, gd.Repo)
util.StatusMessage(util.VERBOSITY_VERBOSE, "Downloading "+
"repository %s (branch: %s; commit: %s) at %s\n", gd.Repo, 
branch,
commit, url)
@@ -265,6 +274,7 @@ func LoadDownloader(repoName string, repoVars 
map[string]string) (
case "github":
gd := NewGithubDownloader()
 
+   gd.Server = repoVars["server"]
gd.User = repoVars["user"]
gd.Repo = repoVars["repo"]
 



[2/3] incubator-mynewt-newt git commit: MYNEWT-621; check that package exists before referencing it.

2017-02-11 Thread marko
MYNEWT-621; check that package exists before referencing it.


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

Branch: refs/heads/develop
Commit: d3d719cd1c3c7fdeb3e1fbb76da1903dfba9b8f6
Parents: 43f189c
Author: Marko Kiiskila 
Authored: Sat Feb 11 12:24:26 2017 -0800
Committer: Marko Kiiskila 
Committed: Sat Feb 11 12:24:26 2017 -0800

--
 newt/resolve/resolve.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/d3d719cd/newt/resolve/resolve.go
--
diff --git a/newt/resolve/resolve.go b/newt/resolve/resolve.go
index 8a675c0..283e96c 100644
--- a/newt/resolve/resolve.go
+++ b/newt/resolve/resolve.go
@@ -134,11 +134,11 @@ func NewResolvePkg(lpkg *pkg.LocalPackage) 
*ResolvePackage {
 func (r *Resolver) resolveDep(dep *pkg.Dependency) (*pkg.LocalPackage, error) {
proj := project.GetProject()
 
-   lpkg := proj.ResolveDependency(dep).(*pkg.LocalPackage)
-   if lpkg == nil {
+   if proj.ResolveDependency(dep) == nil {
return nil, util.FmtNewtError("Could not resolve package 
dependency: "+
"%s; depender: %s", dep.String(), dep.Name)
}
+   lpkg := proj.ResolveDependency(dep).(*pkg.LocalPackage)
 
return lpkg, nil
 }



[1/2] incubator-mynewt-core git commit: Fix test fails due to duplicated prio in tasks

2017-02-10 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 88191c27f -> a4aa979aa


Fix test fails due to duplicated prio in tasks


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

Branch: refs/heads/develop
Commit: 794572bf473e1738327d87df6202bb441a15196c
Parents: 0f1ec97
Author: Fabio Utzig 
Authored: Thu Feb 9 20:24:15 2017 -0800
Committer: Fabio Utzig 
Committed: Thu Feb 9 20:24:15 2017 -0800

--
 kernel/os/test/src/callout_test.c   | 14 +-
 kernel/os/test/src/callout_test.h   | 16 ++-
 kernel/os/test/src/eventq_test.c|  8 --
 kernel/os/test/src/eventq_test.h| 28 +++-
 .../src/testcases/event_test_poll_single_sr.c   | 11 
 .../os/test/src/testcases/event_test_poll_sr.c  | 11 
 .../src/testcases/event_test_poll_timeout_sr.c  | 11 
 kernel/os/test/src/testcases/event_test_src.c   | 11 
 kernel/os/test/src/testcases/os_callout_test.c  | 12 -
 .../test/src/testcases/os_callout_test_speak.c  | 12 -
 .../test/src/testcases/os_callout_test_stop.c   | 12 -
 .../test/src/testcases/flash_map_test_case_1.c  |  4 ---
 .../test/src/testcases/flash_map_test_case_2.c  |  4 ---
 13 files changed, 30 insertions(+), 124 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/callout_test.c
--
diff --git a/kernel/os/test/src/callout_test.c 
b/kernel/os/test/src/callout_test.c
index ff15357..d6ba912 100644
--- a/kernel/os/test/src/callout_test.c
+++ b/kernel/os/test/src/callout_test.c
@@ -131,10 +131,9 @@ callout_task_receive(void *arg)
 tm = os_callout_wakeup_ticks(now);
 TEST_ASSERT(tm == OS_TIMEOUT_NEVER);
 OS_EXIT_CRITICAL(sr);
-
+
 /* Finishes the test when OS has been started */
 os_test_restart();
-
 }
 
 /* This is callout to send the stop_callout */
@@ -142,14 +141,13 @@ void
 callout_task_stop_send(void *arg)
 {
 int k;
-int j;
+int j;
  /* Should say whether callout is armed or not */
 for(k = 0; khttp://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/callout_test.h
--
diff --git a/kernel/os/test/src/callout_test.h 
b/kernel/os/test/src/callout_test.h
index 494251d..4a6de9e 100644
--- a/kernel/os/test/src/callout_test.h
+++ b/kernel/os/test/src/callout_test.h
@@ -28,13 +28,15 @@
 extern "C" {
 #endif
 
+#define INITIAL_CALLOUT_TASK_PRIO   (20)
+
 /* Task 1 for sending */
-#define CALLOUT_STACK_SIZE(5120)
-#define SEND_CALLOUT_TASK_PRIO(1)
+#define CALLOUT_STACK_SIZE  (5120)
+#define SEND_CALLOUT_TASK_PRIO  (INITIAL_CALLOUT_TASK_PRIO + 0)
 extern struct os_task callout_task_struct_send;
 extern os_stack_t callout_task_stack_send[CALLOUT_STACK_SIZE];
 
-#define RECEIVE_CALLOUT_TASK_PRIO(2)
+#define RECEIVE_CALLOUT_TASK_PRIO   (INITIAL_CALLOUT_TASK_PRIO + 1)
 extern struct os_task callout_task_struct_receive;
 extern os_stack_t callout_task_stack_receive[CALLOUT_STACK_SIZE];
 
@@ -43,11 +45,11 @@ extern struct os_eventq callout_evq;
 extern struct os_event callout_ev;
 
 /* The callout_stop task */
-#define SEND_STOP_CALLOUT_TASK_PRIO(3)
+#define SEND_STOP_CALLOUT_TASK_PRIO (INITIAL_CALLOUT_TASK_PRIO + 2)
 extern struct os_task callout_task_struct_stop_send;
 extern os_stack_t callout_task_stack_stop_send[CALLOUT_STACK_SIZE];
 
-#define RECEIVE_STOP_CALLOUT_TASK_PRIO(4)
+#define RECEIVE_STOP_CALLOUT_TASK_PRIO  (INITIAL_CALLOUT_TASK_PRIO + 3)
 extern struct os_task callout_task_struct_stop_receive;
 extern os_stack_t callout_task_stack_stop_receive[CALLOUT_STACK_SIZE];
 
@@ -60,12 +62,12 @@ extern struct os_eventq callout_stop_evq[MULTI_SIZE];
 extern struct os_event callout_stop_ev;
 
 /* Declearing varables for callout_speak */
-#define SPEAK_CALLOUT_TASK_PRIO(5)
+#define SPEAK_CALLOUT_TASK_PRIO (INITIAL_CALLOUT_TASK_PRIO + 4)
 extern struct os_task callout_task_struct_speak;
 extern os_stack_t callout_task_stack_speak[CALLOUT_STACK_SIZE];
 
 /* Declearing varaibles for listen */
-#define LISTEN_CALLOUT_TASK_PRIO(6)
+#define LISTEN_CALLOUT_TASK_PRIO(INITIAL_CALLOUT_TASK_PRIO + 5)
 extern struct os_task callout_task_struct_listen;
 extern os_stack_t callout_task_stack_listen[CALLOUT_STACK_SIZE];
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/ker

[2/2] incubator-mynewt-core git commit: This closes #175.

2017-02-10 Thread marko
This closes #175.

Merge branch 'disallow-prio-duplication' of 
https://github.com/utzig/incubator-mynewt-core into develop


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

Branch: refs/heads/develop
Commit: a4aa979aa86a03fc1827c8cf34a17c576cccf72d
Parents: 88191c2 794572b
Author: Marko Kiiskila 
Authored: Fri Feb 10 16:01:55 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Feb 10 16:01:55 2017 -0800

--
 kernel/os/test/src/callout_test.c   | 14 +-
 kernel/os/test/src/callout_test.h   | 16 ++-
 kernel/os/test/src/eventq_test.c|  8 --
 kernel/os/test/src/eventq_test.h| 28 +++-
 .../src/testcases/event_test_poll_single_sr.c   | 11 
 .../os/test/src/testcases/event_test_poll_sr.c  | 11 
 .../src/testcases/event_test_poll_timeout_sr.c  | 11 
 kernel/os/test/src/testcases/event_test_src.c   | 11 
 kernel/os/test/src/testcases/os_callout_test.c  | 12 -
 .../test/src/testcases/os_callout_test_speak.c  | 12 -
 .../test/src/testcases/os_callout_test_stop.c   | 12 -
 .../test/src/testcases/flash_map_test_case_1.c  |  4 ---
 .../test/src/testcases/flash_map_test_case_2.c  |  4 ---
 13 files changed, 30 insertions(+), 124 deletions(-)
--




[3/3] incubator-mynewt-core git commit: MYNEWT-473; change console to use HAL UART, and espduino connection goes via bitbanger. Set console speed to 115200.

2017-02-10 Thread marko
MYNEWT-473; change console to use HAL UART, and espduino connection
goes via bitbanger. Set console speed to 115200.


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

Branch: refs/heads/develop
Commit: 88191c27f772d3d9f2e43ff0ed55b80c5258560d
Parents: 0724409
Author: Marko Kiiskila 
Authored: Fri Feb 10 15:59:33 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Feb 10 15:59:33 2017 -0800

--
 hw/bsp/arduino_primo_nrf52/include/bsp/bsp.h |  4 ++--
 hw/bsp/arduino_primo_nrf52/syscfg.yml| 10 --
 2 files changed, 6 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/88191c27/hw/bsp/arduino_primo_nrf52/include/bsp/bsp.h
--
diff --git a/hw/bsp/arduino_primo_nrf52/include/bsp/bsp.h 
b/hw/bsp/arduino_primo_nrf52/include/bsp/bsp.h
index f375c41..39da427 100644
--- a/hw/bsp/arduino_primo_nrf52/include/bsp/bsp.h
+++ b/hw/bsp/arduino_primo_nrf52/include/bsp/bsp.h
@@ -41,9 +41,9 @@ extern uint8_t _ram_start;
 #define LED_BLINK_PIN   (25)
 
 /* UART info */
-#define CONSOLE_UART   "uart1"
+#define CONSOLE_UART   "uart0"
 
-#define ESPDUINO_UART   "uart0"
+#define ESPDUINO_UART   "uart1"
 #define ESPDUINO_UART_SPEED 9600
 
 #define NFFS_AREA_MAX   (8)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/88191c27/hw/bsp/arduino_primo_nrf52/syscfg.yml
--
diff --git a/hw/bsp/arduino_primo_nrf52/syscfg.yml 
b/hw/bsp/arduino_primo_nrf52/syscfg.yml
index bbc7875..4408b8b 100644
--- a/hw/bsp/arduino_primo_nrf52/syscfg.yml
+++ b/hw/bsp/arduino_primo_nrf52/syscfg.yml
@@ -37,10 +37,10 @@ syscfg.defs:
 value:  1
 UART_0_PIN_TX:
 description: 'TBD'
-value:  6
+value:  12
 UART_0_PIN_RX:
 description: 'TBD'
-value:  5
+value:  11
 UART_0_PIN_RTS:
 description: 'TBD'
 value:  0
@@ -53,10 +53,10 @@ syscfg.defs:
 value:  1
 UART_1_PIN_TX:
 description: 'TBD'
-value:  11
+value:  5
 UART_1_PIN_RX:
 description: 'TBD'
-value:  12
+value:  6
 UART_1_PIN_RTS:
 description: 'TBD'
 value:  0
@@ -115,5 +115,3 @@ syscfg.vals:
 REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
 NFFS_FLASH_AREA: FLASH_AREA_NFFS
 COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1
-
-CONSOLE_BAUD: 9600



[1/3] incubator-mynewt-core git commit: MYNEWT-292

2017-02-10 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 35b0a91b1 -> 88191c27f


MYNEWT-292

Add an assert checking that same prio is not used by two different
tasks.


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

Branch: refs/heads/develop
Commit: 0f1ec97bc26c509ea0e5fe0e738fdeeb9c899576
Parents: 1d2d46b
Author: Fabio Utzig 
Authored: Wed Feb 8 14:24:32 2017 -0800
Committer: Fabio Utzig 
Committed: Wed Feb 8 15:06:08 2017 -0800

--
 hw/mcu/native/pkg.yml  | 2 +-
 kernel/os/include/os/os_task.h | 2 +-
 kernel/os/src/os_task.c| 5 +
 3 files changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0f1ec97b/hw/mcu/native/pkg.yml
--
diff --git a/hw/mcu/native/pkg.yml b/hw/mcu/native/pkg.yml
index d86e149..7094340 100644
--- a/hw/mcu/native/pkg.yml
+++ b/hw/mcu/native/pkg.yml
@@ -28,6 +28,6 @@ pkg.keywords:
 pkg.deps:
 - hw/hal
 - compiler/sim
-
+
 pkg.req_apis:
 - console

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0f1ec97b/kernel/os/include/os/os_task.h
--
diff --git a/kernel/os/include/os/os_task.h b/kernel/os/include/os/os_task.h
index a9253ba..64c0850 100644
--- a/kernel/os/include/os/os_task.h
+++ b/kernel/os/include/os/os_task.h
@@ -45,7 +45,7 @@ struct os_task_obj
 
 /* Task states */
 typedef enum os_task_state {
-OS_TASK_READY = 1, 
+OS_TASK_READY = 1,
 OS_TASK_SLEEP = 2,
 OS_TASK_SUSPEND = 3
 } os_task_state_t;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0f1ec97b/kernel/os/src/os_task.c
--
diff --git a/kernel/os/src/os_task.c b/kernel/os/src/os_task.c
index 277e4bc..f3106bd 100644
--- a/kernel/os/src/os_task.c
+++ b/kernel/os/src/os_task.c
@@ -98,6 +98,7 @@ os_task_init(struct os_task *t, const char *name, 
os_task_func_t func,
 {
 struct os_sanity_check *sc;
 int rc;
+struct os_task *task;
 
 memset(t, 0, sizeof(*t));
 
@@ -132,6 +133,10 @@ os_task_init(struct os_task *t, const char *name, 
os_task_func_t func,
 t->t_stacktop = &stack_bottom[stack_size];
 t->t_stacksize = stack_size;
 
+STAILQ_FOREACH(task, &g_os_task_list, t_os_task_list) {
+assert(t->t_prio != task->t_prio);
+}
+
 /* insert this task into the task list */
 STAILQ_INSERT_TAIL(&g_os_task_list, t, t_os_task_list);
 



[2/3] incubator-mynewt-core git commit: This closes #175.

2017-02-10 Thread marko
This closes #175.

Merge branch 'disallow-prio-duplication' of 
https://github.com/utzig/incubator-mynewt-core into develop


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

Branch: refs/heads/develop
Commit: 0724409d0bc0ec8cd0ece1937eb4802ecf474ba2
Parents: 35b0a91 0f1ec97
Author: Marko Kiiskila 
Authored: Thu Feb 9 16:40:17 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 9 16:40:17 2017 -0800

--
 hw/mcu/native/pkg.yml  | 2 +-
 kernel/os/include/os/os_task.h | 2 +-
 kernel/os/src/os_task.c| 5 +
 3 files changed, 7 insertions(+), 2 deletions(-)
--




[5/6] incubator-mynewt-core git commit: nrf52dk; add defines to turn on rapid led toggling when in serial bootloader.

2017-02-09 Thread marko
nrf52dk; add defines to turn on rapid led toggling when in
serial bootloader.


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

Branch: refs/heads/develop
Commit: 0f880ef2162933c9608b8630f9ed5181fd282eb8
Parents: f024259
Author: Marko Kiiskila 
Authored: Thu Feb 9 15:59:15 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 9 15:59:15 2017 -0800

--
 hw/bsp/nrf52dk/include/bsp/bsp.h | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0f880ef2/hw/bsp/nrf52dk/include/bsp/bsp.h
--
diff --git a/hw/bsp/nrf52dk/include/bsp/bsp.h b/hw/bsp/nrf52dk/include/bsp/bsp.h
index 2805a6c..877acf1 100644
--- a/hw/bsp/nrf52dk/include/bsp/bsp.h
+++ b/hw/bsp/nrf52dk/include/bsp/bsp.h
@@ -50,6 +50,9 @@ extern uint8_t _ram_start;
 #define BOOT_SERIAL_DETECT_PIN  13 /* Button 1 */
 #define BOOT_SERIAL_DETECT_PIN_CFG  HAL_GPIO_PULL_UP
 #define BOOT_SERIAL_DETECT_PIN_VAL  0
+
+#define BOOT_SERIAL_REPORT_PIN  LED_BLINK_PIN
+#define BOOT_SERIAL_REPORT_FREQ (MYNEWT_VAL(OS_CPUTIME_FREQ) / 4)
 #endif
 
 #define NFFS_AREA_MAX   (8)



[6/6] incubator-mynewt-core git commit: kernel/os; get rid of a warning when compiling os_msys_init.c when there are no memory pools defined.

2017-02-09 Thread marko
kernel/os; get rid of a warning when compiling os_msys_init.c when
there are no memory pools defined.


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

Branch: refs/heads/develop
Commit: 35b0a91b195a29c31523ef5cb1d2da3431c2937b
Parents: 0f880ef
Author: Marko Kiiskila 
Authored: Thu Feb 9 16:00:05 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 9 16:00:05 2017 -0800

--
 kernel/os/src/os_msys_init.c | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/35b0a91b/kernel/os/src/os_msys_init.c
--
diff --git a/kernel/os/src/os_msys_init.c b/kernel/os/src/os_msys_init.c
index b47ea55..8a27f33 100644
--- a/kernel/os/src/os_msys_init.c
+++ b/kernel/os/src/os_msys_init.c
@@ -100,6 +100,7 @@ os_msys_init(void)
 {
 os_msys_reset();
 
+(void)os_msys_init_once;
 #if MYNEWT_VAL(MSYS_1_BLOCK_COUNT) > 0
 os_msys_init_once(os_msys_init_1_data,
   &os_msys_init_1_mempool,



[2/6] incubator-mynewt-core git commit: apps/boot; call hal_bsp_init() as the first thing.

2017-02-09 Thread marko
apps/boot; call hal_bsp_init() as the first thing.


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

Branch: refs/heads/develop
Commit: 938101baaff93e548d2b38fcf04124a508eac68c
Parents: e3a43b0
Author: Marko Kiiskila 
Authored: Thu Feb 9 15:25:36 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 9 15:25:36 2017 -0800

--
 apps/boot/src/boot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/938101ba/apps/boot/src/boot.c
--
diff --git a/apps/boot/src/boot.c b/apps/boot/src/boot.c
index 6b21407..9cd59e7 100755
--- a/apps/boot/src/boot.c
+++ b/apps/boot/src/boot.c
@@ -43,12 +43,12 @@ main(void)
 struct boot_rsp rsp;
 int rc;
 
-#if MYNEWT_VAL(BOOT_SERIAL)
 hal_bsp_init();
+
+#if MYNEWT_VAL(BOOT_SERIAL)
 sysinit();
 #else
 flash_map_init();
-hal_bsp_init(); /* XXX this should be before flash_map_init() */
 #endif
 
 rc = boot_go(&rsp);



[4/6] incubator-mynewt-core git commit: MYNEWT-481; reduce boot_serial size by using minimal console, decoding incoming cbor using tinycbor instead of cborattr.

2017-02-09 Thread marko
MYNEWT-481; reduce boot_serial size by using minimal console,
decoding incoming cbor using tinycbor instead of cborattr.


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

Branch: refs/heads/develop
Commit: f024259b5ad44f7a48a7e945043938a8e95ecd69
Parents: 06cdc21
Author: Marko Kiiskila 
Authored: Thu Feb 9 15:29:50 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 9 15:29:50 2017 -0800

--
 apps/boot/pkg.yml  |   2 +-
 apps/boot/syscfg.yml   |   2 +-
 boot/boot_serial/pkg.yml   |   1 -
 boot/boot_serial/src/boot_serial.c | 201 +---
 4 files changed, 184 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f024259b/apps/boot/pkg.yml
--
diff --git a/apps/boot/pkg.yml b/apps/boot/pkg.yml
index 83567ad..1cd6c29 100644
--- a/apps/boot/pkg.yml
+++ b/apps/boot/pkg.yml
@@ -31,5 +31,5 @@ pkg.deps:
 - sys/console/stub
 
 pkg.deps.BOOT_SERIAL.OVERWRITE:
-- sys/console/full
+- sys/console/minimal
 - boot/boot_serial

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f024259b/apps/boot/syscfg.yml
--
diff --git a/apps/boot/syscfg.yml b/apps/boot/syscfg.yml
index 215dc5d..f543fbf 100644
--- a/apps/boot/syscfg.yml
+++ b/apps/boot/syscfg.yml
@@ -29,4 +29,4 @@ syscfg.defs:
 syscfg.vals:
 SYSINIT_CONSTRAIN_INIT: 0
 OS_SCHEDULING: 0
-OS_CPUTIME_TIMER_NUM: -1
+MSYS_1_BLOCK_COUNT: 0

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f024259b/boot/boot_serial/pkg.yml
--
diff --git a/boot/boot_serial/pkg.yml b/boot/boot_serial/pkg.yml
index 660eb2c..2445594 100644
--- a/boot/boot_serial/pkg.yml
+++ b/boot/boot_serial/pkg.yml
@@ -30,7 +30,6 @@ pkg.deps:
 - kernel/os
 - boot/bootutil
 - encoding/tinycbor
-- encoding/cborattr
 - encoding/base64
 - sys/flash_map
 - util/crc

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f024259b/boot/boot_serial/src/boot_serial.c
--
diff --git a/boot/boot_serial/src/boot_serial.c 
b/boot/boot_serial/src/boot_serial.c
index d384b78..1a68265 100644
--- a/boot/boot_serial/src/boot_serial.c
+++ b/boot/boot_serial/src/boot_serial.c
@@ -41,7 +41,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -50,6 +49,10 @@
 #include "boot_serial/boot_serial.h"
 #include "boot_serial_priv.h"
 
+#if MYNEWT_VAL(OS_CPUTIME_TIMER_NUM) < 0
+#error "Boot serial needs OS_CPUTIME timer"
+#endif
+
 #define BOOT_SERIAL_INPUT_MAX   128
 #define BOOT_SERIAL_OUT_MAX48
 
@@ -107,6 +110,52 @@ bs_find_val(char *buf, char *name)
 }
 
 /*
+ * Convert version into string without use of snprintf().
+ */
+static int
+u32toa(char *tgt, uint32_t val)
+{
+char *dst;
+uint32_t d = 1;
+uint32_t dgt;
+int n = 0;
+
+dst = tgt;
+while (val / d >= 10) {
+d *= 10;
+}
+while (d) {
+dgt = val / d;
+val %= d;
+d /= 10;
+if (n || dgt > 0 || d == 0) {
+*dst++ = dgt + '0';
+++n;
+}
+}
+*dst = '\0';
+
+return dst - tgt;
+}
+
+/*
+ * dst has to be able to fit "255.255.65535.4294967295" (25 characters).
+ */
+static void
+bs_list_img_ver(char *dst, int maxlen, struct image_version *ver)
+{
+int off;
+
+off = u32toa(dst, ver->iv_major);
+dst[off++] = '.';
+off += u32toa(dst + off, ver->iv_minor);
+dst[off++] = '.';
+off += u32toa(dst + off, ver->iv_revision);
+dst[off++] = '.';
+off += u32toa(dst + off, ver->iv_build_num);
+}
+
+/*
  * List images.
  */
 static void
@@ -143,9 +192,7 @@ bs_list(char *buf, int len)
 cbor_encode_int(&image, i);
 cbor_encode_text_stringz(&image, "version");
 
-len = snprintf((char *)tmpbuf, sizeof(tmpbuf),
-  "%u.%u.%u.%u", hdr.ih_ver.iv_major, hdr.ih_ver.iv_minor,
-  hdr.ih_ver.iv_revision, (unsigned int)hdr.ih_ver.iv_build_num);
+bs_list_img_ver((char *)tmpbuf, sizeof(tmpbuf), &hdr.ih_ver);
 cbor_encode_text_stringz(&image, (char *)tmpbuf);
 cbor_encoder_close_container(&images, &image);
 }
@@ -162,11 +209,15 @@ bs_upload(char *buf, int l

[1/6] incubator-mynewt-core git commit: console/minimal; Add a minimal line-based console.

2017-02-09 Thread marko
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 859540e34 -> 35b0a91b1


console/minimal; Add a minimal line-based console.


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

Branch: refs/heads/develop
Commit: e3a43b024418b15945c646f41f4298c8a8353fe8
Parents: 859540e
Author: Marko Kiiskila 
Authored: Thu Feb 9 15:24:49 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 9 15:24:49 2017 -0800

--
 sys/console/minimal/include/console/console.h |  62 +
 sys/console/minimal/include/console/prompt.h  |  55 +
 sys/console/minimal/include/console/ticks.h   |  51 +
 sys/console/minimal/pkg.yml   |  33 +++
 sys/console/minimal/src/cons_tty.c| 253 +
 sys/console/minimal/syscfg.yml|  33 +++
 6 files changed, 487 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e3a43b02/sys/console/minimal/include/console/console.h
--
diff --git a/sys/console/minimal/include/console/console.h 
b/sys/console/minimal/include/console/console.h
new file mode 100644
index 000..384b6a9
--- /dev/null
+++ b/sys/console/minimal/include/console/console.h
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef __CONSOLE_H__
+#define __CONSOLE_H__
+
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*console_rx_cb)(void);
+
+int console_init(console_rx_cb rx_cb);
+static int inline
+console_is_init(void)
+{
+return 0;
+}
+
+void console_write(const char *str, int cnt);
+int console_read(char *str, int cnt, int *newline);
+static void inline
+console_blocking_mode(void)
+{
+}
+
+static void inline
+console_echo(int on)
+{
+}
+
+static void console_printf(const char *fmt, ...)
+__attribute__ ((format (printf, 1, 2)));;
+static void inline
+console_printf(const char *fmt, ...)
+{
+}
+
+#define console_is_midline  0
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CONSOLE_H__ */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e3a43b02/sys/console/minimal/include/console/prompt.h
--
diff --git a/sys/console/minimal/include/console/prompt.h 
b/sys/console/minimal/include/console/prompt.h
new file mode 100644
index 000..6de36f5
--- /dev/null
+++ b/sys/console/minimal/include/console/prompt.h
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef __CONSOLE_PROMPT_H__
+#define __CONSOLE_PROMPT_H__
+
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* print console prompt */
+static void inline
+console_print_prompt(void)
+{
+}
+
+/* set the console prompt character */
+static void inline
+console_set_prompt(char ch)
+{
+}
+
+static void inline
+console_no_prompt(void)
+{
+}
+
+static void inline
+console_yes_prompt(void)
+{
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CONSOLE_PROMPT_

[3/6] incubator-mynewt-core git commit: boot_serial; has it's own copy of nmgr_hdr. Update to match mgmt/newtmgr.

2017-02-09 Thread marko
boot_serial; has it's own copy of nmgr_hdr. Update to match
mgmt/newtmgr.


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

Branch: refs/heads/develop
Commit: 06cdc215b4d38760304ed0cdc6d117bb1e69ffad
Parents: 938101b
Author: Marko Kiiskila 
Authored: Thu Feb 9 15:28:07 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 9 15:28:07 2017 -0800

--
 boot/boot_serial/src/boot_serial_priv.h | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/06cdc215/boot/boot_serial/src/boot_serial_priv.h
--
diff --git a/boot/boot_serial/src/boot_serial_priv.h 
b/boot/boot_serial/src/boot_serial_priv.h
index 3888fdd..04bf414 100644
--- a/boot/boot_serial/src/boot_serial_priv.h
+++ b/boot/boot_serial/src/boot_serial_priv.h
@@ -41,8 +41,6 @@ extern "C" {
 #define NMGR_OP_READ0
 #define NMGR_OP_WRITE   2
 
-#define NMGR_F_CBOR_RSP_COMPLETE 0x01
-
 #define MGMT_GROUP_ID_DEFAULT   0
 #define MGMT_GROUP_ID_IMAGE 1
 
@@ -50,7 +48,14 @@ extern "C" {
 #define NMGR_ID_RESET   5
 
 struct nmgr_hdr {
-uint8_t  nh_op; /* NMGR_OP_XXX */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+uint8_t  nh_op:3;   /* NMGR_OP_XXX */
+uint8_t  _res1:5;
+#endif
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+uint8_t  _res1:5;
+uint8_t  nh_op:3;   /* NMGR_OP_XXX */
+#endif
 uint8_t  nh_flags;
 uint16_t nh_len;/* length of the payload */
 uint16_t nh_group;  /* NMGR_GROUP_XXX */



[11/13] incubator-mynewt-core git commit: MYNEWT-619 Splitty - Console does not output

2017-02-08 Thread marko
MYNEWT-619 Splitty - Console does not output

The problem was a stack overflow.  The "task1" stack was only 32 words.
This wasn't enough for the logging that it performs.


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

Branch: refs/heads/develop
Commit: b9a8ae72bcabdd046d4f564905939deeea4fe46b
Parents: 6b0d977
Author: Christopher Collins 
Authored: Mon Feb 6 13:51:46 2017 -0800
Committer: Christopher Collins 
Committed: Mon Feb 6 13:54:35 2017 -0800

--
 apps/splitty/src/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b9a8ae72/apps/splitty/src/main.c
--
diff --git a/apps/splitty/src/main.c b/apps/splitty/src/main.c
index 9bf5ca6..267b4bc 100755
--- a/apps/splitty/src/main.c
+++ b/apps/splitty/src/main.c
@@ -44,7 +44,7 @@
 
 /* Task 1 */
 #define TASK1_PRIO (8)
-#define TASK1_STACK_SIZEOS_STACK_ALIGN(32)
+#define TASK1_STACK_SIZEOS_STACK_ALIGN(128)
 #define MAX_CBMEM_BUF 300
 static struct os_task task1;
 static volatile int g_task1_loops;



[03/13] incubator-mynewt-core git commit: kernel/os; rename macro __bswap_XX -> os_bswap_XX. __bswap_32() is an inline function in Linux system headers, and causes trouble with simulator builds.

2017-02-08 Thread marko
kernel/os; rename macro __bswap_XX -> os_bswap_XX.
__bswap_32() is an inline function in Linux system headers,
and causes trouble with simulator builds.


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

Branch: refs/heads/develop
Commit: 8c5c8fcdbed7769cc1ec2a079d812084e5c7a2f3
Parents: 0d848ae
Author: Marko Kiiskila 
Authored: Thu Feb 2 14:00:20 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 2 14:40:23 2017 -0800

--
 kernel/os/include/os/endian.h | 42 +++---
 1 file changed, 21 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/8c5c8fcd/kernel/os/include/os/endian.h
--
diff --git a/kernel/os/include/os/endian.h b/kernel/os/include/os/endian.h
index b8b39b5..ca8698d 100644
--- a/kernel/os/include/os/endian.h
+++ b/kernel/os/include/os/endian.h
@@ -27,8 +27,8 @@ extern "C" {
 #endif
 
 /* Internal helpers */
-#ifndef __bswap_64
-#define __bswap_64(x)   ((uint64_t) \
+#ifndef os_bswap_64
+#define os_bswap_64(x)   ((uint64_t)\
  x) & 0xff00ull) >> 56) |   \
   (((x) & 0x00ffull) >> 40) |   \
   (((x) & 0xff00ull) >> 24) |   \
@@ -39,16 +39,16 @@ extern "C" {
   (((x) & 0x00ffull) << 56)))
 #endif
 
-#ifndef __bswap_32
-#define __bswap_32(x)((uint32_t)\
+#ifndef os_bswap_32
+#define os_bswap_32(x)((uint32_t)   \
 x) & 0xff00) >> 24) |   \
  (((x) & 0x00ff) >>  8) |   \
  (((x) & 0xff00) <<  8) |   \
  (((x) & 0x00ff) << 24)))
 #endif
 
-#ifndef __bswap_16
-#define __bswap_16(x)   ((uint16_t) \
+#ifndef os_bswap_16
+#define os_bswap_16(x)   ((uint16_t)\
 x) & 0xff00) >> 8) |\
  (((x) & 0x00ff) << 8)))
 #endif
@@ -84,7 +84,7 @@ extern "C" {
 #endif
 
 #ifndef htole16
-#define htole16(x) __bswap_16 (x)
+#define htole16(x) os_bswap_16 (x)
 #endif
 
 #ifndef be16toh
@@ -92,7 +92,7 @@ extern "C" {
 #endif
 
 #ifndef le16toh
-#define le16toh(x) __bswap_16 (x)
+#define le16toh(x) os_bswap_16 (x)
 #endif
 
 #ifndef htobe32
@@ -100,7 +100,7 @@ extern "C" {
 #endif
 
 #ifndef htole32
-#define htole32(x) __bswap_32 (x)
+#define htole32(x) os_bswap_32 (x)
 #endif
 
 #ifndef be32toh
@@ -108,7 +108,7 @@ extern "C" {
 #endif
 
 #ifndef le32toh
-#define le32toh(x) __bswap_32 (x)
+#define le32toh(x) os_bswap_32 (x)
 #endif
 
 #ifndef htobe64
@@ -116,7 +116,7 @@ extern "C" {
 #endif
 
 #ifndef htole64
-#define htole64(x) __bswap_64 (x)
+#define htole64(x) os_bswap_64 (x)
 #endif
 
 #ifndef be64toh
@@ -124,13 +124,13 @@ extern "C" {
 #endif
 
 #ifndef le64toh
-#define le64toh(x) __bswap_64 (x)
+#define le64toh(x) os_bswap_64 (x)
 #endif
 
 #else
 
 #ifndef ntohll
-#define ntohll(x)   __bswap_64(x)
+#define ntohll(x)   os_bswap_64(x)
 #endif
 
 #ifndef htonll
@@ -138,7 +138,7 @@ extern "C" {
 #endif
 
 #ifndef ntohl
-#define ntohl(x)__bswap_32(x)
+#define ntohl(x)os_bswap_32(x)
 #endif
 
 #ifndef htonl
@@ -146,7 +146,7 @@ extern "C" {
 #endif
 
 #ifndef htons
-#define htons(x)__bswap_16(x)
+#define htons(x)os_bswap_16(x)
 #endif
 
 #ifndef ntohs
@@ -154,7 +154,7 @@ extern "C" {
 #endif
 
 #ifndef htobe16
-#define htobe16(x) __bswap_16(x)
+#define htobe16(x) os_bswap_16(x)
 #endif
 
 #ifndef htole16
@@ -162,7 +162,7 @@ extern "C" {
 #endif
 
 #ifndef be16toh
-#define be16toh(x) __bswap_16(x)
+#define be16toh(x) os_bswap_16(x)
 #endif
 
 #ifndef le16toh
@@ -170,7 +170,7 @@ extern "C" {
 #endif
 
 #ifndef htobe32
-#define htobe32(x) __bswap_32(x)
+#define htobe32(x) os_bswap_32(x)
 #endif
 
 #ifndef htole32
@@ -178,7 +178,7 @@ extern "C" {
 #endif
 
 #ifndef be32toh
-#define be32toh(x) __bswap_32(x)
+#define be32toh(x) os_bswap_32(x)
 #endif
 
 #ifndef le32toh
@@ -186,7 +186,7 @@ extern "C" {
 #endif
 
 #ifndef htobe64
-#define htobe64(x) __builtin_bswap64(x)
+#define htobe64(x) os_bswap64(x)
 #endif
 
 #ifndef htole64
@@ -194,7 +194,7 @@ extern "C" {
 #endif
 
 #ifndef be64toh
-#define be64toh(x) __builtin_bswap64(x)
+#define be64toh(x) os_bswap64(x)
 #endif
 
 #ifndef le64toh



[13/13] incubator-mynewt-core git commit: Merge branch '1_0_0_b2_dev' of https://git-wip-us.apache.org/repos/asf/incubator-mynewt-core into develop

2017-02-08 Thread marko
Merge branch '1_0_0_b2_dev' of 
https://git-wip-us.apache.org/repos/asf/incubator-mynewt-core into develop


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

Branch: refs/heads/develop
Commit: 4719b3f503e70e0da59a724aff08b1992b2a0781
Parents: 1d2d46b de35d23
Author: Marko Kiiskila 
Authored: Wed Feb 8 13:45:02 2017 -0800
Committer: Marko Kiiskila 
Committed: Wed Feb 8 13:45:02 2017 -0800

--
 NOTICE  |  2 +-
 README.md   |  9 +-
 apps/blesplit/src/main.c| 34 +++---
 apps/boot/src/boot.c| 20 ++---
 boot/boot_serial/pkg.yml|  9 ++
 boot/boot_serial/src/boot_serial.c  | 43 
 hw/bsp/nrf52dk/include/bsp/bsp.h|  8 ++
 hw/bsp/nucleo-f401re/src/hal_bsp.c  |  4 +++
 hw/bsp/stm32f4discovery/src/hal_bsp.c   |  4 +++
 net/nimble/controller/src/ble_ll_conn.c |  2 +-
 10 files changed, 98 insertions(+), 37 deletions(-)
--




[06/13] incubator-mynewt-core git commit: stm32f4discovery; allow building bootloader without uart0.

2017-02-08 Thread marko
stm32f4discovery; allow building bootloader without uart0.


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

Branch: refs/heads/develop
Commit: 2b124b6765a87df1f26a93b6df90654c1376cbd9
Parents: 39e6125
Author: Marko Kiiskila 
Authored: Thu Feb 2 15:12:52 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 2 15:12:52 2017 -0800

--
 hw/bsp/stm32f4discovery/src/hal_bsp.c | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2b124b67/hw/bsp/stm32f4discovery/src/hal_bsp.c
--
diff --git a/hw/bsp/stm32f4discovery/src/hal_bsp.c 
b/hw/bsp/stm32f4discovery/src/hal_bsp.c
index 696ecb8..5e5c3bd 100644
--- a/hw/bsp/stm32f4discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f4discovery/src/hal_bsp.c
@@ -21,8 +21,10 @@
 #include 
 
 #include 
+#if MYNEWT_VAL(UART_0)
 #include 
 #include 
+#endif
 
 #include 
 #include 
@@ -88,6 +90,8 @@ hal_bsp_init(void)
 {
 int rc;
 
+(void)rc;
+
 #if MYNEWT_VAL(UART_0)
 rc = os_dev_create((struct os_dev *) &hal_uart0, CONSOLE_UART,
   OS_DEV_INIT_PRIMARY, 0, uart_hal_init, (void *)&uart_cfg[0]);



[09/13] incubator-mynewt-core git commit: MYNEWT-618; bootloader was not calling hal_bsp_init(), so uart was not getting initialized. Watchdog needs to be tickled from within serial downloader.

2017-02-08 Thread marko
MYNEWT-618; bootloader was not calling hal_bsp_init(), so
uart was not getting initialized.
Watchdog needs to be tickled from within serial downloader.


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

Branch: refs/heads/develop
Commit: 2c909377d4b3f1e1e9b886c061e48baf9ba7a2fb
Parents: d484e46
Author: Marko Kiiskila 
Authored: Fri Feb 3 15:44:27 2017 -0800
Committer: Marko Kiiskila 
Committed: Fri Feb 3 15:44:27 2017 -0800

--
 apps/boot/src/boot.c   | 20 ++-
 boot/boot_serial/pkg.yml   |  4 +++
 boot/boot_serial/src/boot_serial.c | 43 +
 3 files changed, 49 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2c909377/apps/boot/src/boot.c
--
diff --git a/apps/boot/src/boot.c b/apps/boot/src/boot.c
index fbc4b7d..6b21407 100755
--- a/apps/boot/src/boot.c
+++ b/apps/boot/src/boot.c
@@ -28,8 +28,6 @@
 #include 
 #include 
 #if MYNEWT_VAL(BOOT_SERIAL)
-#include 
-#include 
 #include 
 #endif
 #include 
@@ -39,10 +37,6 @@
 #define BOOT_AREA_DESC_MAX  (256)
 #define AREA_DESC_MAX   (BOOT_AREA_DESC_MAX)
 
-#if MYNEWT_VAL(BOOT_SERIAL)
-#define BOOT_SER_CONS_INPUT 128
-#endif
-
 int
 main(void)
 {
@@ -50,23 +44,13 @@ main(void)
 int rc;
 
 #if MYNEWT_VAL(BOOT_SERIAL)
+hal_bsp_init();
 sysinit();
 #else
 flash_map_init();
-hal_bsp_init();
+hal_bsp_init(); /* XXX this should be before flash_map_init() */
 #endif
 
-#if MYNEWT_VAL(BOOT_SERIAL)
-/*
- * Configure a GPIO as input, and compare it against expected value.
- * If it matches, await for download commands from serial.
- */
-hal_gpio_init_in(BOOT_SERIAL_DETECT_PIN, BOOT_SERIAL_DETECT_PIN_CFG);
-if (hal_gpio_read(BOOT_SERIAL_DETECT_PIN) == BOOT_SERIAL_DETECT_PIN_VAL) {
-boot_serial_start(BOOT_SER_CONS_INPUT);
-assert(0);
-}
-#endif
 rc = boot_go(&rsp);
 assert(rc == 0);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2c909377/boot/boot_serial/pkg.yml
--
diff --git a/boot/boot_serial/pkg.yml b/boot/boot_serial/pkg.yml
index 5913877..544c63a 100644
--- a/boot/boot_serial/pkg.yml
+++ b/boot/boot_serial/pkg.yml
@@ -37,3 +37,7 @@ pkg.deps:
 
 pkg.req_apis:
 - console
+
+pkg.init:
+boot_serial_os_dev_init: 0
+boot_serial_pkg_init: 200

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2c909377/boot/boot_serial/src/boot_serial.c
--
diff --git a/boot/boot_serial/src/boot_serial.c 
b/boot/boot_serial/src/boot_serial.c
index c46e270..d384b78 100644
--- a/boot/boot_serial/src/boot_serial.c
+++ b/boot/boot_serial/src/boot_serial.c
@@ -29,6 +29,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -48,6 +50,7 @@
 #include "boot_serial/boot_serial.h"
 #include "boot_serial_priv.h"
 
+#define BOOT_SERIAL_INPUT_MAX   128
 #define BOOT_SERIAL_OUT_MAX48
 
 static uint32_t curr_off;
@@ -411,6 +414,9 @@ boot_serial_start(int max_input)
 int dec_off;
 int full_line;
 
+rc = hal_watchdog_init(MYNEWT_VAL(WATCHDOG_INTERVAL));
+assert(rc == 0);
+
 rc = console_init(NULL);
 assert(rc == 0);
 console_echo(0);
@@ -421,12 +427,19 @@ boot_serial_start(int max_input)
 
 off = 0;
 while (1) {
+hal_watchdog_tickle();
 rc = console_read(buf + off, max_input - off, &full_line);
 if (rc <= 0 && !full_line) {
 continue;
 }
 off += rc;
 if (!full_line) {
+if (off == max_input) {
+/*
+ * Full line, no newline yet. Reset the input buffer.
+ */
+off = 0;
+}
 continue;
 }
 if (buf[0] == SHELL_NLIP_PKT_START1 &&
@@ -443,3 +456,33 @@ boot_serial_start(int max_input)
 off = 0;
 }
 }
+
+/*
+ * os_init() will not be called with bootloader, so we need to initialize
+ * devices created by hal_bsp_init() here.
+ */
+void
+boot_serial_os_dev_init(void)
+{
+os_dev_initialize_all(OS_DEV_INIT_PRIMARY);
+os_dev_initialize_all(OS_DEV_INIT_SECONDARY);
+
+/*
+ * Configure GPIO line as input. This is read later to see if
+ * we should stay and keep waiting for input.
+ */
+hal_gpio_init_in(BOOT_SERIAL_DETECT_PIN, BOOT_SERIAL_DETECT_

[02/13] incubator-mynewt-core git commit: blesplit - Fix compiler errs after host API chg.

2017-02-08 Thread marko
blesplit - Fix compiler errs after host API chg.


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

Branch: refs/heads/develop
Commit: 0d848ae98a5ec8b222814c59e7fb3d51d370072b
Parents: 6f99c8c
Author: Christopher Collins 
Authored: Thu Feb 2 14:12:00 2017 -0800
Committer: Christopher Collins 
Committed: Thu Feb 2 14:12:00 2017 -0800

--
 apps/blesplit/src/main.c | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0d848ae9/apps/blesplit/src/main.c
--
diff --git a/apps/blesplit/src/main.c b/apps/blesplit/src/main.c
index 020934f..711803f 100755
--- a/apps/blesplit/src/main.c
+++ b/apps/blesplit/src/main.c
@@ -51,24 +51,24 @@ static void
 blesplit_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
 BLESPLIT_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
-desc->conn_handle, desc->our_ota_addr_type);
-print_addr(desc->our_ota_addr);
+ desc->conn_handle, desc->our_ota_addr.type);
+print_addr(desc->our_ota_addr.val);
 BLESPLIT_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
-desc->our_id_addr_type);
-print_addr(desc->our_id_addr);
+ desc->our_id_addr.type);
+print_addr(desc->our_id_addr.val);
 BLESPLIT_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
-desc->peer_ota_addr_type);
-print_addr(desc->peer_ota_addr);
+ desc->peer_ota_addr.type);
+print_addr(desc->peer_ota_addr.val);
 BLESPLIT_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
-desc->peer_id_addr_type);
-print_addr(desc->peer_id_addr);
+ desc->peer_id_addr.type);
+print_addr(desc->peer_id_addr.val);
 BLESPLIT_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
-"encrypted=%d authenticated=%d bonded=%d\n",
-desc->conn_itvl, desc->conn_latency,
-desc->supervision_timeout,
-desc->sec_state.encrypted,
-desc->sec_state.authenticated,
-desc->sec_state.bonded);
+ "encrypted=%d authenticated=%d bonded=%d\n",
+ desc->conn_itvl, desc->conn_latency,
+ desc->supervision_timeout,
+ desc->sec_state.encrypted,
+ desc->sec_state.authenticated,
+ desc->sec_state.bonded);
 }
 
 /**
@@ -113,7 +113,9 @@ blesplit_advertise(void)
 fields.name_len = strlen(name);
 fields.name_is_complete = 1;
 
-fields.uuids16 = (uint16_t[]){ GATT_SVR_SVC_ALERT_UUID };
+fields.uuids16 = (ble_uuid16_t[]){
+BLE_UUID16_INIT(GATT_SVR_SVC_ALERT_UUID)
+};
 fields.num_uuids16 = 1;
 fields.uuids16_is_complete = 1;
 
@@ -127,7 +129,7 @@ blesplit_advertise(void)
 memset(&adv_params, 0, sizeof adv_params);
 adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
 adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
-rc = ble_gap_adv_start(BLE_ADDR_PUBLIC, 0, NULL, BLE_HS_FOREVER,
+rc = ble_gap_adv_start(BLE_ADDR_PUBLIC, NULL, BLE_HS_FOREVER,
&adv_params, blesplit_gap_event, NULL);
 if (rc != 0) {
 BLESPLIT_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);



[05/13] incubator-mynewt-core git commit: nucleo-f401re; fix build for bootloader.

2017-02-08 Thread marko
nucleo-f401re; fix build for bootloader.


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

Branch: refs/heads/develop
Commit: 39e61255baa421670bc94015faad8eda0eb379ff
Parents: 196cf7d
Author: Marko Kiiskila 
Authored: Thu Feb 2 14:58:36 2017 -0800
Committer: Marko Kiiskila 
Committed: Thu Feb 2 14:58:36 2017 -0800

--
 hw/bsp/nucleo-f401re/src/hal_bsp.c | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/39e61255/hw/bsp/nucleo-f401re/src/hal_bsp.c
--
diff --git a/hw/bsp/nucleo-f401re/src/hal_bsp.c 
b/hw/bsp/nucleo-f401re/src/hal_bsp.c
index 0d2b2eb..15a0c4b 100644
--- a/hw/bsp/nucleo-f401re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f401re/src/hal_bsp.c
@@ -19,8 +19,10 @@
 #include 
 
 #include 
+#if MYNEWT_VAL(UART_0)
 #include 
 #include 
+#endif
 
 #include 
 #include 
@@ -110,6 +112,8 @@ hal_bsp_init(void)
 {
 int rc;
 
+(void)rc;
+
 #if MYNEWT_VAL(UART_0)
 rc = os_dev_create((struct os_dev *) &hal_uart0, CONSOLE_UART,
   OS_DEV_INIT_PRIMARY, 0, uart_hal_init, (void *)&uart_cfg[0]);



<    1   2   3   4   5   6   7   8   9   10   >