You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2017/02/23 22:32:55 UTC

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

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/sensors_branch ac59febde -> 60cd598c8


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/sensors_branch
Commit: 06cdc215b4d38760304ed0cdc6d117bb1e69ffad
Parents: 938101b
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 9 15:28:07 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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_READ            0
 #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 */


[10/50] incubator-mynewt-core git commit: BLE host - add chr-read app err to unit tests.

Posted by vi...@apache.org.
BLE host - add chr-read app err to unit tests.


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

Branch: refs/heads/sensors_branch
Commit: d61c6cd08b054e1ea8b829a0b74aa6ce2688357a
Parents: 206d7fd
Author: Christopher Collins <cc...@apache.org>
Authored: Sat Feb 11 12:06:53 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Sat Feb 11 12:07:45 2017 -0800

----------------------------------------------------------------------
 net/nimble/host/test/src/ble_att_svr_test.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d61c6cd0/net/nimble/host/test/src/ble_att_svr_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_att_svr_test.c b/net/nimble/host/test/src/ble_att_svr_test.c
index 8ee9bc6..c5b964a 100644
--- a/net/nimble/host/test/src/ble_att_svr_test.c
+++ b/net/nimble/host/test/src/ble_att_svr_test.c
@@ -138,6 +138,15 @@ ble_att_svr_test_misc_attr_fn_r_2(uint16_t conn_handle, uint16_t attr_handle,
     }
 }
 
+static int
+ble_att_svr_test_misc_attr_fn_r_err(uint16_t conn_handle, uint16_t attr_handle,
+                                    uint8_t op, uint16_t offset,
+                                    struct os_mbuf **om, void *arg)
+{
+    os_mbuf_append(*om, (uint8_t[4]){1,2,3,4}, 4);
+    return BLE_ATT_ERR_UNLIKELY;
+}
+
 #define BLE_ATT_SVR_TEST_LAST_SVC  11
 #define BLE_ATT_SVR_TEST_LAST_ATTR 24
 
@@ -777,6 +786,8 @@ TEST_CASE(ble_att_svr_test_read)
     uint16_t conn_handle;
     const ble_uuid_t *uuid_sec = BLE_UUID128_DECLARE( \
         1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+    const ble_uuid_t *uuid_bad = BLE_UUID128_DECLARE( \
+        2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
     const ble_uuid_t *uuid = BLE_UUID128_DECLARE( \
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, );
     int rc;
@@ -790,6 +801,16 @@ TEST_CASE(ble_att_svr_test_read)
     ble_hs_test_util_verify_tx_err_rsp(BLE_ATT_OP_READ_REQ, 0,
                                        BLE_ATT_ERR_INVALID_HANDLE);
 
+    /*** Application error. */
+    rc = ble_att_svr_register(uuid_bad, HA_FLAG_PERM_RW, 0, &attr_handle,
+                              ble_att_svr_test_misc_attr_fn_r_err, NULL);
+    TEST_ASSERT(rc == 0);
+
+    rc = ble_hs_test_util_rx_att_read_req(conn_handle, attr_handle);
+    TEST_ASSERT(rc == BLE_HS_EAPP);
+    ble_hs_test_util_verify_tx_err_rsp(BLE_ATT_OP_READ_REQ, attr_handle,
+                                       BLE_ATT_ERR_UNLIKELY);
+
     /*** Successful read. */
     ble_att_svr_test_attr_r_1 = (uint8_t[]){0,1,2,3,4,5,6,7};
     ble_att_svr_test_attr_r_1_len = 8;


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 0f880ef2162933c9608b8630f9ed5181fd282eb8
Parents: f024259
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 9 15:59:15 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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)


[35/50] incubator-mynewt-core git commit: BLE Host - Remove extraneous indentation.

Posted by vi...@apache.org.
BLE Host - Remove extraneous indentation.


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

Branch: refs/heads/sensors_branch
Commit: a42c0c10952f3319e1f8834f863f956de2e8a487
Parents: b967568
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Feb 21 09:19:13 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Feb 21 09:19:13 2017 -0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_gap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a42c0c10/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index 22462b4..92c3d12 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -2818,15 +2818,15 @@ ble_gap_validate_conn_params(const struct ble_gap_upd_params *params)
 
     /* Requirements from Bluetooth spec. v4.2 [Vol 2, Part E], 7.8.18 */
     if (params->itvl_min > params->itvl_max) {
-            return false;
+        return false;
     }
 
     if (params->itvl_min < 0x0006 || params->itvl_max > 0x0C80) {
-            return false;
+        return false;
     }
 
     if (params->latency > 0x01F3) {
-            return false;
+        return false;
     }
 
     if (params->supervision_timeout <=
@@ -2869,7 +2869,7 @@ ble_gap_update_params(uint16_t conn_handle,
 
     /* Validate parameters with a spec */
     if (!ble_gap_validate_conn_params(params)) {
-            return BLE_HS_EINVAL;
+        return BLE_HS_EINVAL;
     }
 
     STATS_INC(ble_gap_stats, update);


[14/50] incubator-mynewt-core git commit: gdb macros - Include mbuf usrhdr in output.

Posted by vi...@apache.org.
gdb macros - Include mbuf usrhdr in output.


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

Branch: refs/heads/sensors_branch
Commit: 85638d22a98dc8b0c286b1d38e34b0e29c1c2e73
Parents: f299c85
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Feb 13 11:18:50 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Feb 13 11:19:58 2017 -0800

----------------------------------------------------------------------
 compiler/gdbmacros/mbuf.gdb | 35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/85638d22/compiler/gdbmacros/mbuf.gdb
----------------------------------------------------------------------
diff --git a/compiler/gdbmacros/mbuf.gdb b/compiler/gdbmacros/mbuf.gdb
index 3bb81ad..738f4ae 100644
--- a/compiler/gdbmacros/mbuf.gdb
+++ b/compiler/gdbmacros/mbuf.gdb
@@ -51,6 +51,26 @@ Prints the packet header associated with the specified mbuf.  If the specified
 mbuf does not contain a packet header, the output is indeterminate.
 end
 
+define mn_mbuf_usrhdr_print
+    # Calculate address of user header.
+    set $data_addr = (uint8_t *)&($arg0)->om_data
+    set $phdr_addr = $data_addr + sizeof(struct os_mbuf)
+    set $uhdr_addr = $phdr_addr + sizeof(struct os_mbuf_pkthdr)
+
+    # Determine length of user header.
+    set $uhdr_len = $uhdr_addr - $phdr_addr
+
+    # Print header.
+    p/x *$uhdr_addr@$uhdr_len
+end
+
+document mn_mbuf_usrhdr_print
+usage: mn_mbuf_usrhdr_print <struct os_mbuf *>
+
+Prints the user header associated with the specified mbuf.  If the specified
+mbuf does not contain a user header, the output is indeterminate.
+end
+
 define mn_mbuf_print
     set $om = (struct os_mbuf *)($arg0)
 
@@ -61,6 +81,11 @@ define mn_mbuf_print
         printf "Packet header: "
         mn_mbuf_pkthdr_print $om
     end
+
+    if ($om)->om_pkthdr_len > sizeof (struct os_mbuf_pkthdr)
+        printf "User header: "
+        mn_mbuf_usrhdr_print $om
+    end
 end
 
 document mn_mbuf_print
@@ -154,17 +179,17 @@ Applies the mn_mbuf_print function to each element in the specified pool.  Both
 allocated and unallocated mbufs are printed.
 end
 
-document mn_mbuf_pool_print
+define mn_msys1_print
+    mn_mbuf_pool_print &os_msys_init_1_mbuf_pool 
+end
+
+document mn_msys1_print
 usage: mn_msys1_print
 
 Prints all mbufs in the first msys pool.  Both allocated and unallocated mbufs
 are printed.
 end
 
-define mn_msys1_print
-    mn_mbuf_pool_print &os_msys_init_1_mbuf_pool 
-end
-
 define mn_msys1_free_print
     set $om = os_msys_init_1_mempool.slh_first
 


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: a4aa979aa86a03fc1827c8cf34a17c576cccf72d
Parents: 88191c2 794572b
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 10 16:01:55 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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(-)
----------------------------------------------------------------------



[27/50] incubator-mynewt-core git commit: BLE Host - Minor formatting change.

Posted by vi...@apache.org.
BLE Host - Minor formatting change.


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

Branch: refs/heads/sensors_branch
Commit: cfc231441a7d7cf94ba96efc58913b1c510d4c9a
Parents: 3ad2ce2
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Feb 16 13:25:13 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Feb 16 13:25:13 2017 -0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_eddystone.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/cfc23144/net/nimble/host/src/ble_eddystone.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_eddystone.c b/net/nimble/host/src/ble_eddystone.c
index fa4a783..e6e15c3 100644
--- a/net/nimble/host/src/ble_eddystone.c
+++ b/net/nimble/host/src/ble_eddystone.c
@@ -85,7 +85,8 @@ ble_eddystone_set_adv_data_gen(struct ble_hs_adv_fields *adv_fields,
         return BLE_HS_EINVAL;
     }
 
-    ble_eddystone_uuids16[0] = (ble_uuid16_t) BLE_UUID16_INIT(BLE_EDDYSTONE_SERVICE_UUID);
+    ble_eddystone_uuids16[0] =
+        (ble_uuid16_t) BLE_UUID16_INIT(BLE_EDDYSTONE_SERVICE_UUID);
     memcpy(ble_eddystone_uuids16 + 1, adv_fields->uuids16,
            adv_fields->num_uuids16 * sizeof(ble_uuid16_t));
     adv_fields->uuids16 = ble_eddystone_uuids16;


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: f024259b5ad44f7a48a7e945043938a8e95ecd69
Parents: 06cdc21
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 9 15:29:50 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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 <tinycbor/cbor.h>
 #include <tinycbor/cbor_buf_reader.h>
-#include <cborattr/cborattr.h>
 #include <base64/base64.h>
 #include <crc/crc16.h>
 
@@ -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_MAX	48
 
@@ -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 len)
 {
     CborParser parser;
     struct cbor_buf_reader reader;
+    struct CborValue root_value;
     struct CborValue value;
-    uint8_t img_data[400];
-    long long unsigned int off = UINT_MAX;
+    uint8_t img_data[512];
+    long long int off = UINT_MAX;
     size_t img_blen = 0;
-    long long unsigned int data_len = UINT_MAX;
+    long long int data_len = UINT_MAX;
+    size_t slen;
+    char name_str[8];
+    /*
     const struct cbor_attr_t attr[4] = {
         [0] = {
             .attribute = "data",
@@ -188,18 +239,105 @@ bs_upload(char *buf, int len)
             .nodefault = true
         }
     };
+     */
     const struct flash_area *fap = NULL;
     int rc;
 
     memset(img_data, 0, sizeof(img_data));
+
     cbor_buf_reader_init(&reader, (uint8_t *)buf, len);
-    cbor_parser_init(&reader.r, 0, &parser, &value);
-    rc = cbor_read_object(&value, attr);
-    if (rc || off == UINT_MAX) {
-        rc = MGMT_ERR_EINVAL;
-        goto out;
-    }
+    cbor_parser_init(&reader.r, 0, &parser, &root_value);
 
+    /*
+     * Expected data format.
+     * {
+     *    "data":<img_data>
+     *    "len":<image len>
+     *    "off":<current offset of image data>
+     * }
+     */
+
+    /*
+     * Object comes within { ... }
+     */
+    if (!cbor_value_is_container(&root_value)) {
+        goto out_invalid_data;
+    }
+    if (cbor_value_enter_container(&root_value, &value)) {
+        goto out_invalid_data;
+    }
+    while (cbor_value_is_valid(&value)) {
+        /*
+         * Decode key.
+         */
+        if (cbor_value_calculate_string_length(&value, &slen)) {
+            goto out_invalid_data;
+        }
+        if (!cbor_value_is_text_string(&value) ||
+            slen >= sizeof(name_str) - 1) {
+            goto out_invalid_data;
+        }
+        if (cbor_value_copy_text_string(&value, name_str, &slen, &value)) {
+            goto out_invalid_data;
+        }
+        name_str[slen] = '\0';
+        if (!strcmp(name_str, "data")) {
+            /*
+             * Image data
+             */
+            if (value.type != CborByteStringType) {
+                goto out_invalid_data;
+            }
+            if (cbor_value_calculate_string_length(&value, &slen) ||
+                slen >= sizeof(img_data)) {
+                goto out_invalid_data;
+            }
+            if (cbor_value_copy_byte_string(&value, img_data, &slen, &value)) {
+                goto out_invalid_data;
+            }
+            img_blen = slen;
+        } else if (!strcmp(name_str, "off")) {
+            /*
+             * Offset of the data.
+             */
+            if (value.type != CborIntegerType) {
+                goto out_invalid_data;
+            }
+            if (cbor_value_get_int64(&value, &off)) {
+                goto out_invalid_data;
+            }
+            if (cbor_value_advance(&value)) {
+                goto out_invalid_data;
+            }
+        } else if (!strcmp(name_str, "len")) {
+            /*
+             * Length of the image. This should only be present in the first
+             * block of data; when offset is 0.
+             */
+            if (value.type != CborIntegerType) {
+                goto out_invalid_data;
+            }
+            if (cbor_value_get_int64(&value, &data_len)) {
+                goto out_invalid_data;
+            }
+            if (cbor_value_advance(&value)) {
+                goto out_invalid_data;
+            }
+        } else {
+            /*
+             * Skip unknown keys.
+             */
+            if (cbor_value_advance(&value)) {
+                goto out_invalid_data;
+            }
+        }
+    }
+    if (off == UINT_MAX) {
+        /*
+         * Offset must be set in every block.
+         */
+        goto out_invalid_data;
+    }
 
     rc = flash_area_open(flash_area_id_from_image_slot(0), &fap);
     if (rc) {
@@ -210,8 +348,7 @@ bs_upload(char *buf, int len)
     if (off == 0) {
         curr_off = 0;
         if (data_len > fap->fa_size) {
-            rc = MGMT_ERR_EINVAL;
-            goto out;
+            goto out_invalid_data;
         }
         rc = flash_area_erase(fap, 0, fap->fa_size);
         if (rc) {
@@ -225,11 +362,12 @@ bs_upload(char *buf, int len)
         goto out;
     }
     rc = flash_area_write(fap, curr_off, img_data, img_blen);
-    if (rc) {
+    if (rc == 0) {
+        curr_off += img_blen;
+    } else {
+out_invalid_data:
         rc = MGMT_ERR_EINVAL;
-        goto out;
     }
-    curr_off += img_blen;
 
 out:
     cbor_encoder_create_map(&bs_root, &bs_rsp, CborIndefiniteLength);
@@ -338,7 +476,7 @@ boot_serial_output(void)
     len = bs_writer.bytes_written;
 
     bs_hdr->nh_op++;
-    bs_hdr->nh_flags = NMGR_F_CBOR_RSP_COMPLETE;
+    bs_hdr->nh_flags = 0;
     bs_hdr->nh_len = htons(len);
     bs_hdr->nh_group = htons(bs_hdr->nh_group);
 
@@ -413,9 +551,28 @@ boot_serial_start(int max_input)
     char *dec;
     int dec_off;
     int full_line;
+#ifdef BOOT_SERIAL_REPORT_PIN
+    uint32_t tick;
+#endif
 
+#if 0
+    /*
+     * This is commented out, as it includes divide operation, bloating
+     * the bootloader 10%.
+     * Note that there are calls to hal_watchdog_tickle() in the subsequent
+     * code.
+     */
     rc = hal_watchdog_init(MYNEWT_VAL(WATCHDOG_INTERVAL));
     assert(rc == 0);
+#endif
+#ifdef BOOT_SERIAL_REPORT_PIN
+    /*
+     * Configure GPIO line as output. This is a pin we toggle at the
+     * given frequency.
+     */
+    hal_gpio_init_out(BOOT_SERIAL_REPORT_PIN, 0);
+    tick = os_cputime_get32();
+#endif
 
     rc = console_init(NULL);
     assert(rc == 0);
@@ -428,6 +585,12 @@ boot_serial_start(int max_input)
     off = 0;
     while (1) {
         hal_watchdog_tickle();
+#ifdef BOOT_SERIAL_REPORT_PIN
+        if (os_cputime_get32() - tick > BOOT_SERIAL_REPORT_FREQ) {
+            hal_gpio_toggle(BOOT_SERIAL_REPORT_PIN);
+            tick = os_cputime_get32();
+        }
+#endif
         rc = console_read(buf + off, max_input - off, &full_line);
         if (rc <= 0 && !full_line) {
             continue;


[31/50] incubator-mynewt-core git commit: This closes #178

Posted by vi...@apache.org.
This closes #178


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

Branch: refs/heads/sensors_branch
Commit: 47166e2a6cfc2d5aa89c58835f8e789f28dbde05
Parents: 5f5e19f 0c6d37a
Author: Sterling Hughes <st...@runtime.io>
Authored: Mon Feb 20 10:16:23 2017 -0600
Committer: Sterling Hughes <st...@runtime.io>
Committed: Mon Feb 20 10:16:23 2017 -0600

----------------------------------------------------------------------
 fs/fs/src/fs_dirent.c | 3 +--
 fs/fs/src/fs_file.c   | 2 +-
 fs/fs/src/fs_mount.c  | 5 +++++
 fs/fs/src/fsutil.c    | 4 ++--
 fs/nffs/src/nffs.c    | 3 +++
 5 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



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

Posted by vi...@apache.org.
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/sensors_branch
Commit: fa6cc192e2af81a6b968292089da42accfb6a06b
Parents: d232170
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 15:21:33 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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);


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: e2dd5391101c41140b17e2b7bcaae1f63a2ab278
Parents: 0112f46
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 17:33:43 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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"
-    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/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk/syscfg.yml b/hw/bsp/nrf51dk/syscfg.yml
index 5a19cb6..8f13b42 100644
--- a/hw/bsp/nrf51dk/syscfg.yml
+++ b/hw/bsp/nrf51dk/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"
-    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/nrf52840pdk/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52840pdk/syscfg.yml b/hw/bsp/nrf52840pdk/syscfg.yml
index 4756488..23671b4 100644
--- a/hw/bsp/nrf52840pdk/syscfg.yml
+++ b/hw/bsp/nrf52840pdk/syscfg.yml
@@ -20,32 +20,38 @@
 
 syscfg.defs:
     BSP_NRF52840:
-        description: 'TBD'
+        description: 'Set to indicate that BSP has NRF52840'
         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:  6
     UART_0_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART0'
         value:  8
     UART_0_PIN_RTS:
-        description: 'TBD'
+        description: 'RTS pin for UART0'
         value:  5
     UART_0_PIN_CTS:
-        description: 'TBD'
+        description: 'CTS pin for UART0'
         value: 7
 
     UART_1:
         description: 'Bitbanger UART'
         value:  0
+    UART_1_PIN_TX:
+        description: 'TX pin for UART1'
+        value:  -1
+    UART_1_PIN_RX:
+        description: 'RX pin for UART1'
+        value:  -1
 
     SPI_0_MASTER:
         description: 'SPI 0 master'
@@ -55,24 +61,11 @@ syscfg.defs:
     SPI_0_MASTER_SS_PIN:
         description: 'SPI 0 (master) SS pin number.'
         value:  44
-    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_0_SLAVE:
         description: 'SPI 0 slave'
         value:  0
         restrictions:
             - "!SPI_0_MASTER"
-    SPI_1_SLAVE:
-        description: 'SPI 1 slave'
-        value:  0
-        restrictions:
-            - "!SPI_1_MASTER"
 
     TIMER_0:
         description: 'NRF52840 Timer 0'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e2dd5391/hw/bsp/nrf52dk/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52dk/syscfg.yml b/hw/bsp/nrf52dk/syscfg.yml
index 1de4c56..696ddec 100644
--- a/hw/bsp/nrf52dk/syscfg.yml
+++ b/hw/bsp/nrf52dk/syscfg.yml
@@ -20,32 +20,38 @@
 
 syscfg.defs:
     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:  6
     UART_0_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART0'
         value:  8
     UART_0_PIN_RTS:
-        description: 'TBD'
+        description: 'RTS pin for UART0'
         value:  5
     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:  0
+    UART_1_PIN_TX:
+        description: 'TX pin for UART1'
+        value:  -1
+    UART_1_PIN_RX:
+        description: 'RX pin for UART1'
+        value:  -1
 
     SPI_0_MASTER:
         description: 'SPI 0 master'
@@ -55,24 +61,11 @@ syscfg.defs:
     SPI_0_MASTER_SS_PIN:
         description: 'SPI 0 (master) SS pin number.'
         value:  22
-    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_0_SLAVE:
         description: 'SPI 0 slave'
         value:  0
         restrictions:
             - "!SPI_0_MASTER"
-    SPI_1_SLAVE:
-        description: 'SPI 1 slave'
-        value:  0
-        restrictions:
-            - "!SPI_1_MASTER"
 
     TIMER_0:
         description: 'NRF52 Timer 0'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e2dd5391/hw/bsp/nucleo-f401re/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nucleo-f401re/syscfg.yml b/hw/bsp/nucleo-f401re/syscfg.yml
index 0747b1b..c27ebd7 100644
--- a/hw/bsp/nucleo-f401re/syscfg.yml
+++ b/hw/bsp/nucleo-f401re/syscfg.yml
@@ -19,28 +19,24 @@
 
 syscfg.defs:
     UART_0:
-        description: 'TBD'
+        description: 'Whether to enable UART0'
         value:  1
 
     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'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e2dd5391/hw/bsp/rb-nano2/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/rb-nano2/syscfg.yml b/hw/bsp/rb-nano2/syscfg.yml
index e3105ad..f7cf2fc 100644
--- a/hw/bsp/rb-nano2/syscfg.yml
+++ b/hw/bsp/rb-nano2/syscfg.yml
@@ -21,47 +21,42 @@
 
 syscfg.defs:
     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: 29
     UART_0_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART0'
         value: 30
     UART_0_PIN_RTS:
-        description: 'TBD'
+        description: 'RTS pin for UART0'
         value: 2
     UART_0_PIN_CTS:
-        description: 'TBD'
+        description: 'CTS pin for UART0'
         value: 28
 
     SPI_0_MASTER:
         description: 'SPI 0 master'
         value:  0
+        restrictions:
+            - "!SPI_0_SLAVE"
     SPI_0_MASTER_SS_PIN:
         description: 'SPI 0 (master) SS pin number.'
         value:  22
-    SPI_1_MASTER:
-        description: 'SPI 1 master'
-        value:  0
-    SPI_1_MASTER_SS_PIN:
-        description: 'SPI 1 (master) SS pin number.'
-        value:  -1
     SPI_0_SLAVE:
         description: 'SPI 0 slave'
         value:  0
-    SPI_1_SLAVE:
-        description: 'SPI 1 slave'
-        value:  0
+        restrictions:
+            - "!SPI_0_MASTER"
 
     TIMER_0:
         description: 'NRF52 Timer 0'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e2dd5391/hw/bsp/stm32f4discovery/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/stm32f4discovery/syscfg.yml b/hw/bsp/stm32f4discovery/syscfg.yml
index 8b3feba..5df91a7 100644
--- a/hw/bsp/stm32f4discovery/syscfg.yml
+++ b/hw/bsp/stm32f4discovery/syscfg.yml
@@ -19,8 +19,11 @@
 
 syscfg.defs:
     UART_0:
-        description: 'TBD'
+        description: 'UART 0'
         value:  1
+    TIMER_0:
+        description: 'Timer 0'
+        value:  0
 
 syscfg.vals:
     REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e2dd5391/hw/bsp/usbmkw41z/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/usbmkw41z/syscfg.yml b/hw/bsp/usbmkw41z/syscfg.yml
index b3e024e..958006c 100644
--- a/hw/bsp/usbmkw41z/syscfg.yml
+++ b/hw/bsp/usbmkw41z/syscfg.yml
@@ -21,7 +21,7 @@
 
 syscfg.defs:
     BSP_USBMKW41Z:
-        description: 'TBD'
+        description: 'Set to indicate that BSP has MKW41Z'
         value: 1
 
 syscfg.vals:


[13/50] incubator-mynewt-core git commit: No jira ticket. BLETEST role is now a syscfg variable.

Posted by vi...@apache.org.
No jira ticket. BLETEST role is now a syscfg variable.


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

Branch: refs/heads/sensors_branch
Commit: f299c85b183053280d94cb3f7f74ac371e720201
Parents: d61c6cd
Author: William San Filippo <wi...@runtime.io>
Authored: Mon Feb 13 10:59:48 2017 -0800
Committer: William San Filippo <wi...@runtime.io>
Committed: Mon Feb 13 11:01:11 2017 -0800

----------------------------------------------------------------------
 apps/bletest/src/main.c | 23 +++++++++++++++++------
 apps/bletest/syscfg.yml |  8 ++++++++
 2 files changed, 25 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f299c85b/apps/bletest/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletest/src/main.c b/apps/bletest/src/main.c
index d56ec2b..e2519eb 100755
--- a/apps/bletest/src/main.c
+++ b/apps/bletest/src/main.c
@@ -62,13 +62,24 @@ uint8_t g_host_adv_data[BLE_HCI_MAX_ADV_DATA_LEN];
 uint8_t g_host_adv_len;
 
 /* Some application configurations */
-#define BLETEST_ROLE_ADVERTISER         (0)
-#define BLETEST_ROLE_SCANNER            (1)
-#define BLETEST_ROLE_INITIATOR          (2)
+#define BLETEST_ROLE_NONE               (0)
+#define BLETEST_ROLE_ADVERTISER         (1)
+#define BLETEST_ROLE_SCANNER            (2)
+#define BLETEST_ROLE_INITIATOR          (3)
 
-#define BLETEST_CFG_ROLE                (BLETEST_ROLE_INITIATOR)
-//#define BLETEST_CFG_ROLE                (BLETEST_ROLE_ADVERTISER)
-//#define BLETEST_CFG_ROLE                (BLETEST_ROLE_SCANNER)
+#if MYNEWT_VAL(BLETEST_ROLE) == BLETEST_ROLE_ADVERTISER
+#define BLETEST_CFG_ROLE                BLETEST_ROLE_ADVERTISER
+#endif
+#if MYNEWT_VAL(BLETEST_ROLE) == BLETEST_ROLE_SCANNER
+#define BLETEST_CFG_ROLE                BLETEST_ROLE_SCANNER
+#endif
+#if MYNEWT_VAL(BLETEST_ROLE) == BLETEST_ROLE_INITIATOR
+#define BLETEST_CFG_ROLE                BLETEST_ROLE_INITIATOR
+#endif
+
+#ifndef BLETEST_CFG_ROLE
+#error "No role defined! Must define a valid role in syscfg.yml in apps/bletest"
+#endif
 
 /* Advertiser config */
 #define BLETEST_CFG_ADV_OWN_ADDR_TYPE   (BLE_HCI_ADV_OWN_ADDR_PUBLIC)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f299c85b/apps/bletest/syscfg.yml
----------------------------------------------------------------------
diff --git a/apps/bletest/syscfg.yml b/apps/bletest/syscfg.yml
index e769374..ba44607 100644
--- a/apps/bletest/syscfg.yml
+++ b/apps/bletest/syscfg.yml
@@ -17,6 +17,14 @@
 #
 
 # Package: apps/bletest
+syscfg.defs:
+    BLETEST_ROLE:
+        description: >
+            The role of the bletest code. Should be set to:
+                1: Advertiser
+                2: Scanner
+                3: Initiator
+        value: 1
 
 syscfg.vals:
     MSYS_1_BLOCK_COUNT: 16


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 51af56ca6d43c97c95642eb30ae00c59f786c046
Parents: 57a5bb6
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Mon Feb 13 12:08:36 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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_reboot(enum hal_reset_reason reason)
 
     reboot_tmp_cnt = reboot_cnt;
 
-    if (reason == HAL_RESET_SOFT) {
+    if (reason == HAL_RESET_REQUESTED) {
         /*
-         * Save reboot count as soft reboot cnt if the reason is
-         * a soft reboot
+         * Save soft_reboot as 1 if user is requesting restart.
          */
-        reboot_tmp_cnt = reboot_cnt + 1;
+        reboot_tmp_cnt = 1;
         conf_save_one("reboot/soft_reboot",
                       conf_str_from_value(CONF_INT16, &reboot_tmp_cnt,
                                           str, sizeof(str)));
+        reboot_tmp_cnt = reboot_cnt + 1;
     } else {
         conf_save_one("reboot/soft_reboot", "0");
-        if (soft_reboot) {
+        if (soft_reboot && reason == HAL_RESET_SOFT) {
             /* No need to log as it's not a hard reboot */
             goto err;
         } else {
@@ -230,6 +232,16 @@ err:
     return OS_ENOENT;
 }
 
+static int
+reboot_cnt_export(void (*func)(char *name, char *val), enum conf_export_tgt tgt)
+{
+    if (tgt == CONF_EXPORT_SHOW) {
+        func("reboot/reboot_cnt", reboot_cnt_str);
+        func("reboot/soft_reboot", soft_reboot_str);
+    }
+    return 0;
+}
+
 void
 log_reboot_pkg_init(void)
 {


[11/50] incubator-mynewt-core git commit: MYNEWT-579 Free rxed l2cap frags on disconnect.

Posted by vi...@apache.org.
MYNEWT-579 Free rxed l2cap frags on disconnect.

This may not a different mbuf leak, but it was discovered while
debugging this issue.


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

Branch: refs/heads/sensors_branch
Commit: 206d7fdb9ab7751ebfc276fc551767949e9a2eab
Parents: 8518805
Author: Christopher Collins <cc...@apache.org>
Authored: Sat Feb 11 12:05:08 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Sat Feb 11 12:07:45 2017 -0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_l2cap.c           | 2 ++
 net/nimble/host/test/src/ble_l2cap_test.c | 5 +++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/206d7fdb/net/nimble/host/src/ble_l2cap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap.c b/net/nimble/host/src/ble_l2cap.c
index fc8ecb9..fa02ec2 100644
--- a/net/nimble/host/src/ble_l2cap.c
+++ b/net/nimble/host/src/ble_l2cap.c
@@ -75,6 +75,8 @@ ble_l2cap_chan_free(struct ble_l2cap_chan *chan)
         return;
     }
 
+    os_mbuf_free_chain(chan->blc_rx_buf);
+
     rc = os_memblock_put(&ble_l2cap_chan_pool, chan);
     BLE_HS_DBG_ASSERT_EVAL(rc == 0);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/206d7fdb/net/nimble/host/test/src/ble_l2cap_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_l2cap_test.c b/net/nimble/host/test/src/ble_l2cap_test.c
index 526436c..2681b26 100644
--- a/net/nimble/host/test/src/ble_l2cap_test.c
+++ b/net/nimble/host/test/src/ble_l2cap_test.c
@@ -367,6 +367,11 @@ TEST_CASE(ble_l2cap_test_case_frag_channels)
     TEST_ASSERT(conn->bhc_rx_chan != NULL &&
                 conn->bhc_rx_chan->blc_cid == BLE_L2CAP_CID_ATT);
     ble_hs_unlock();
+
+    /* Terminate the connection.  The received fragments should get freed.
+     * Mbuf leaks are tested in the post-test-case callback.
+     */
+    ble_hs_test_util_conn_disconnect(2);
 }
 
 TEST_CASE(ble_l2cap_test_case_frag_timeout)


[16/50] incubator-mynewt-core git commit: BLE Host - Update for CoC field name change.

Posted by vi...@apache.org.
BLE Host - Update for CoC field name change.


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

Branch: refs/heads/sensors_branch
Commit: 8b510e973cec21c776fdd2ab4801793a2339dd09
Parents: 0727c55
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Feb 13 11:25:04 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Feb 13 11:25:55 2017 -0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_l2cap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/8b510e97/net/nimble/host/src/ble_l2cap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap.c b/net/nimble/host/src/ble_l2cap.c
index bab2365..2fb48b6 100644
--- a/net/nimble/host/src/ble_l2cap.c
+++ b/net/nimble/host/src/ble_l2cap.c
@@ -77,7 +77,7 @@ ble_l2cap_chan_free(struct ble_l2cap_chan *chan)
         return;
     }
 
-    os_mbuf_free_chain(chan->blc_rx_buf);
+    os_mbuf_free_chain(chan->rx_buf);
 
     rc = os_memblock_put(&ble_l2cap_chan_pool, chan);
     BLE_HS_DBG_ASSERT_EVAL(rc == 0);


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 4b7bd194906df264e43a7c333a7e326ca83f20c7
Parents: c00eeee
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 14:16:09 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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.


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 7944913eb3f8f8931cc52471dd47bc5dacf8b091
Parents: a42c0c1
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 13:50:28 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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: 0xc0ffeeee
 
 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
 


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: cb6d0cbc9cc3e3a1346184a4015c40a3abb79120
Parents: e2dd539
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 17:36:29 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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'


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 5f5e19ff8e78a819b3ee0c4422dbbd915af984c6
Parents: 868f79d
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 17 17:39:01 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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 0000000..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 = 0x00000000, LENGTH = 0x4000
+  RAM (rwx) :  ORIGIN = 0x20000000, 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 0000000..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 limitations
+# under the License.
+#
+
+bsp.arch: cortex_m0
+bsp.compiler: compiler/arm-none-eabi-m0
+bsp.linkerscript:
+    - "hw/bsp/bbc_microbit/nrf51xxac.ld"
+    - "hw/mcu/nordic/nrf51xxx/nrf51.ld"
+bsp.linkerscript.BOOT_LOADER.OVERWRITE:
+    - "hw/bsp/bbc_microbit/boot-nrf51xxac.ld"
+    - "hw/mcu/nordic/nrf51xxx/nrf51.ld"
+bsp.part2linkerscript: "hw/bsp/bbc_microbit/split-nrf51dk.ld"
+bsp.downloadscript: "hw/bsp/bbc_microbit/microbit_download.sh"
+bsp.debugscript: "hw/bsp/bbc_microbit/microbit_debug.sh"
+
+bsp.flash_map:
+    areas:
+        # System areas.
+        FLASH_AREA_BOOTLOADER:
+            device: 0
+            offset: 0x00000000
+            size: 16kB
+        FLASH_AREA_IMAGE_0:
+            device: 0
+            offset: 0x00008000
+            size: 110kB
+        FLASH_AREA_IMAGE_1:
+            device: 0
+            offset: 0x00023800
+            size: 110kB
+        FLASH_AREA_IMAGE_SCRATCH:
+            device: 0
+            offset: 0x0003f000
+            size: 2kB
+
+        # User areas.
+        FLASH_AREA_REBOOT_LOG:
+            user_id: 0
+            device: 0
+            offset: 0x00004000
+            size: 16kB
+        FLASH_AREA_NFFS:
+            user_id: 1
+            device: 0
+            offset: 0x0003f800
+            size: 2kB

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/include/bsp/bsp.h
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/include/bsp/bsp.h b/hw/bsp/bbc_microbit/include/bsp/bsp.h
new file mode 100644
index 0000000..dc7b41e
--- /dev/null
+++ b/hw/bsp/bbc_microbit/include/bsp/bsp.h
@@ -0,0 +1,50 @@
+/*
+ * 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 H_BSP_H
+#define H_BSP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "inttypes.h"
+/* Define special stackos sections */
+#define sec_data_core   __attribute__((section(".data.core")))
+#define sec_bss_core    __attribute__((section(".bss.core")))
+
+/* More convenient section placement macros. */
+#define bssnz_t
+
+extern uint8_t _ram_start;
+#define RAM_SIZE        0x4000
+
+/* LED pins */
+#define LED_BLINK_PIN   (-1)
+
+/* UART info */
+#define CONSOLE_UART    "uart0"
+
+#define NFFS_AREA_MAX   (8)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* H_BSP_H */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h b/hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h
new file mode 100644
index 0000000..5d2ae83
--- /dev/null
+++ b/hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h
@@ -0,0 +1,30 @@
+/* mbed Microcontroller Library - cmsis_nvic
+ * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
+ *
+ * CMSIS-style functionality to support dynamic vectors
+ */
+
+#ifndef MBED_CMSIS_NVIC_H
+#define MBED_CMSIS_NVIC_H
+
+#include <stdint.h>
+
+/* NOTE: the nrf51 SoC has 26 interrupts. */
+#define NVIC_USER_IRQ_OFFSET  16
+#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
+
+#include "nrf51.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void NVIC_Relocate(void);
+void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
+uint32_t NVIC_GetVector(IRQn_Type IRQn);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/microbit_debug.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/microbit_debug.sh b/hw/bsp/bbc_microbit/microbit_debug.sh
new file mode 100755
index 0000000..7f4d2d5
--- /dev/null
+++ b/hw/bsp/bbc_microbit/microbit_debug.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# 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.
+#
+
+# Called with following variables set:
+#  - CORE_PATH is absolute path to @apache-mynewt-core
+#  - BSP_PATH is absolute path to hw/bsp/bsp_name
+#  - BIN_BASENAME is the path to prefix to target binary,
+#    .elf appended to name is the ELF file
+#  - FEATURES holds the target features string
+#  - EXTRA_JTAG_CMD holds extra parameters to pass to jtag software
+#  - RESET set if target should be reset when attaching
+#  - NO_GDB set if we should not start gdb to debug
+#
+. $CORE_PATH/hw/scripts/openocd.sh
+
+FILE_NAME=$BIN_BASENAME.elf
+CFG="-f interface/cmsis-dap.cfg -f target/nrf51.cfg"
+# Exit openocd when gdb detaches.
+EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; nrf51.cpu configure -event gdb-detach {if {[nrf51.cpu curstate] eq \"halted\"} resume;shutdown}"
+
+openocd_debug

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/microbit_download.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/microbit_download.sh b/hw/bsp/bbc_microbit/microbit_download.sh
new file mode 100755
index 0000000..1f1d5de
--- /dev/null
+++ b/hw/bsp/bbc_microbit/microbit_download.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# 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.
+#
+
+# Called with following variables set:
+#  - CORE_PATH is absolute path to @apache-mynewt-core
+#  - BSP_PATH is absolute path to hw/bsp/bsp_name
+#  - BIN_BASENAME is the path to prefix to target binary,
+#    .elf appended to name is the ELF file
+#  - IMAGE_SLOT is the image slot to download to (for non-mfg-image, non-boot)
+#  - FEATURES holds the target features string
+#  - EXTRA_JTAG_CMD holds extra parameters to pass to jtag software
+#  - MFG_IMAGE is "1" if this is a manufacturing image
+#  - FLASH_OFFSET contains the flash offset to download to
+#  - BOOT_LOADER is set if downloading a bootloader
+
+. $CORE_PATH/hw/scripts/openocd.sh
+
+CFG="-f interface/cmsis-dap.cfg -f target/nrf51.cfg"
+
+if [ "$MFG_IMAGE" ]; then
+    FLASH_OFFSET=0
+fi
+
+common_file_to_load
+openocd_load
+openocd_reset_run

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/nrf51xxac.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/nrf51xxac.ld b/hw/bsp/bbc_microbit/nrf51xxac.ld
new file mode 100755
index 0000000..2604a17
--- /dev/null
+++ b/hw/bsp/bbc_microbit/nrf51xxac.ld
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+/*
+ * 16kb of SRAM
+ */
+MEMORY
+{
+  FLASH (rx) : ORIGIN = 0x00008000, LENGTH = 0x1b800
+  RAM (rwx)  : ORIGIN = 0x20000000, LENGTH = 0x4000
+}
+
+/* This linker script is used for images and thus contains an image header */
+_imghdr_size = 0x20;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/pkg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/pkg.yml b/hw/bsp/bbc_microbit/pkg.yml
new file mode 100644
index 0000000..07de50d
--- /dev/null
+++ b/hw/bsp/bbc_microbit/pkg.yml
@@ -0,0 +1,88 @@
+#
+# 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.
+#
+
+pkg.name: hw/bsp/bbc_microbit
+pkg.type: bsp
+pkg.description: BSP definition for BBC Microbit.
+pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
+pkg.homepage: "http://mynewt.apache.org/"
+pkg.keywords:
+    - nrf51
+    - microbit
+
+pkg.cflags:
+    # Nordic SDK files require these defines.
+    - '-DADC_ENABLED=1'
+    - '-DCLOCK_ENABLED=1'
+    - '-DCOMP_ENABLED=0'
+    - '-DEGU_ENABLED=0'
+    - '-DGPIOTE_ENABLED=1'
+    - '-DI2S_ENABLED=0'
+    - '-DLPCOMP_ENABLED=1'
+    - '-DNRF51'
+    - '-DPDM_ENABLED=0'
+    - '-DPERIPHERAL_RESOURCE_SHARING_ENABLED=1'
+    - '-DPWM0_ENABLED=1'
+    - '-DPWM1_ENABLED=0'
+    - '-DPWM2_ENABLED=0'
+    - '-DQDEC_ENABLED=1'
+    - '-DRNG_ENABLED=1'
+    - '-DRTC0_ENABLED=0'
+    - '-DRTC1_ENABLED=0'
+    - '-DRTC2_ENABLED=0'
+    - '-DSAADC_ENABLED=0'
+    - '-DSPI0_CONFIG_MISO_PIN=28'
+    - '-DSPI0_CONFIG_MOSI_PIN=25'
+    - '-DSPI0_CONFIG_SCK_PIN=29'
+    - '-DSPI0_ENABLED=1'
+    - '-DSPI0_USE_EASY_DMA=0'
+    - '-DSPI1_ENABLED=0'
+    - '-DSPI2_ENABLED=0'
+    - '-DSPIS0_CONFIG_MISO_PIN=4'
+    - '-DSPIS0_CONFIG_MOSI_PIN=3'
+    - '-DSPIS0_CONFIG_SCK_PIN=2'
+    - '-DSPIS0_ENABLED=0'
+    - '-DSPIS1_CONFIG_MISO_PIN=28'
+    - '-DSPIS1_CONFIG_MOSI_PIN=25'
+    - '-DSPIS1_CONFIG_SCK_PIN=29'
+    - '-DSPIS1_ENABLED=1'
+    - '-DSPIS2_ENABLED=0'
+    - '-DTIMER0_ENABLED=1'
+    - '-DTIMER1_ENABLED=0'
+    - '-DTIMER2_ENABLED=0'
+    - '-DTIMER3_ENABLED=0'
+    - '-DTIMER4_ENABLED=0'
+    - '-DTWI0_CONFIG_SCL=0'
+    - '-DTWI0_CONFIG_SDA=1'
+    - '-DTWI0_ENABLED=1'
+    - '-DTWI1_ENABLED=0'
+    - '-DTWIS0_ENABLED=0'
+    - '-DTWIS1_ENABLED=0'
+    - '-DUART0_ENABLED=1'
+    - '-DWDT_ENABLED=1'
+
+pkg.deps:
+    - hw/mcu/nordic/nrf51xxx
+    - libc/baselibc
+
+pkg.deps.BLE_DEVICE:
+    - hw/drivers/nimble/nrf51
+
+pkg.deps.UART_0:
+    - hw/drivers/uart/uart_hal

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/split-microbit.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/split-microbit.ld b/hw/bsp/bbc_microbit/split-microbit.ld
new file mode 100755
index 0000000..9c051f8
--- /dev/null
+++ b/hw/bsp/bbc_microbit/split-microbit.ld
@@ -0,0 +1,185 @@
+/* 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.
+ */
+OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
+
+MEMORY
+{
+  FLASH (rx) : ORIGIN = 0x00023800, LENGTH = 0x1b800
+  RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x4000
+}
+
+/* Linker script to place sections and symbol values. Should be used together
+ * with other linker script that defines memory regions FLASH and RAM.
+ * It references following symbols, which must be defined in code:
+ *   Reset_Handler_split : Entry of reset handler
+ *
+ * It defines following symbols, which code can use without definition:
+ *   __exidx_start
+ *   __exidx_end
+ *   __etext
+ *   __data_start__
+ *   __preinit_array_start
+ *   __preinit_array_end
+ *   __init_array_start
+ *   __init_array_end
+ *   __fini_array_start
+ *   __fini_array_end
+ *   __data_end__
+ *   __bss_start__
+ *   __bss_end__
+ *   __HeapBase
+ *   __HeapLimit
+ *   __StackLimit
+ *   __StackTop
+ *   __stack
+ *   __bssnz_start__
+ *   __bssnz_end__
+ */
+ENTRY(Reset_Handler_split)
+
+SECTIONS
+{
+    .imghdr (NOLOAD):
+    {
+    	. = . + 0x20;
+    } > FLASH
+
+    .text :
+    {
+        __split_isr_vector_start = .;
+        KEEP(*(.isr_vector_split))
+        __split_isr_vector_end = .;
+        *(.text*)
+
+        KEEP(*(.init))
+        KEEP(*(.fini))
+
+        /* .ctors */
+        *crtbegin.o(.ctors)
+        *crtbegin?.o(.ctors)
+        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
+        *(SORT(.ctors.*))
+        *(.ctors)
+
+        /* .dtors */
+        *crtbegin.o(.dtors)
+        *crtbegin?.o(.dtors)
+        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
+        *(SORT(.dtors.*))
+        *(.dtors)
+
+        *(.rodata*)
+
+        *(.eh_frame*)
+        . = ALIGN(4);
+    } > FLASH
+
+
+    .ARM.extab :
+    {
+        *(.ARM.extab* .gnu.linkonce.armextab.*)
+        . = ALIGN(4);
+    } > FLASH
+
+    __exidx_start = .;
+    .ARM.exidx :
+    {
+        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+        . = ALIGN(4);
+    } > FLASH
+    __exidx_end = .;
+
+    __etext = .;
+
+    /* save RAM used by the split image. This assumes that
+     * the loader uses all the RAM up to its HeapBase  */
+    .loader_ram_contents :
+    {
+        _loader_ram_start = .;
+         /* this symbol comes from the loader linker */
+          . = . + (ABSOLUTE(__HeapBase_loader) - _loader_ram_start);
+         _loader_ram_end = .;
+    } > RAM
+
+    .data :
+    {
+        __data_start__ = .;
+        *(.data*)
+
+        . = ALIGN(4);
+        /* preinit data */
+        PROVIDE_HIDDEN (__preinit_array_start = .);
+        *(.preinit_array)
+        PROVIDE_HIDDEN (__preinit_array_end = .);
+
+        . = ALIGN(4);
+        /* init data */
+        PROVIDE_HIDDEN (__init_array_start = .);
+        *(SORT(.init_array.*))
+        *(.init_array)
+        PROVIDE_HIDDEN (__init_array_end = .);
+
+
+        . = ALIGN(4);
+        /* finit data */
+        PROVIDE_HIDDEN (__fini_array_start = .);
+        *(SORT(.fini_array.*))
+        *(.fini_array)
+        PROVIDE_HIDDEN (__fini_array_end = .);
+
+        *(.jcr)
+        . = ALIGN(4);
+        /* All data end */
+        __data_end__ = .;
+    } > RAM AT > FLASH
+
+    .bss :
+    {
+        . = ALIGN(4);
+        __bss_start__ = .;
+        *(.bss*)
+        *(COMMON)
+        . = ALIGN(4);
+        __bss_end__ = .;
+    } > RAM
+
+    /* Heap starts after BSS */
+    __HeapBase = .;
+
+    /* .stack_dummy section doesn't contains any symbols. It is only
+     * used for linker to calculate size of stack sections, and assign
+     * values to stack symbols later */
+    .stack_dummy (COPY):
+    {
+        *(.stack*)
+    } > RAM
+
+    _ram_start = ORIGIN(RAM);
+
+    /* Set stack top to end of RAM, and stack limit move down by
+     * size of stack_dummy section */
+    __StackTop = ORIGIN(RAM) + LENGTH(RAM);
+    __StackLimit = __StackTop - SIZEOF(.stack_dummy);
+    PROVIDE(__stack = __StackTop);
+
+    /* Top of head is the bottom of the stack */
+    __HeapLimit = __StackLimit;
+
+    /* Check if data + heap + stack exceeds RAM limit */
+    ASSERT(__HeapBase <= __HeapLimit, "region RAM overflowed with stack")
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s b/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s
new file mode 100755
index 0000000..e58e8bc
--- /dev/null
+++ b/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s
@@ -0,0 +1,280 @@
+/*
+Copyright (c) 2015, Nordic Semiconductor ASA
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of Nordic Semiconductor ASA nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+NOTE: Template files (including this one) are application specific and therefore
+expected to be copied into the application project folder prior to its use!
+*/
+
+    .syntax unified
+    .arch armv6-m
+
+    .section .stack
+    .align 3
+    .equ    Stack_Size, 432
+    .globl    __StackTop
+    .globl    __StackLimit
+__StackLimit:
+    .space    Stack_Size
+    .size __StackLimit, . - __StackLimit
+__StackTop:
+    .size __StackTop, . - __StackTop
+
+    .section .heap
+    .align 3
+#ifdef __HEAP_SIZE
+    .equ    Heap_Size, __HEAP_SIZE
+#else
+    .equ    Heap_Size, 0
+#endif
+    .globl    __HeapBase
+    .globl    __HeapLimit
+__HeapBase:
+    .if    Heap_Size
+    .space    Heap_Size
+    .endif
+    .size __HeapBase, . - __HeapBase
+__HeapLimit:
+    .size __HeapLimit, . - __HeapLimit
+
+    .section .isr_vector
+    .align 2
+    .globl __isr_vector
+__isr_vector:
+    .long    __StackTop                 /* Top of Stack */
+    .long   Reset_Handler               /* Reset Handler */
+    .long   _NMI_Handler                /* NMI Handler */
+    .long   _HardFault_Handler          /* Hard Fault Handler */
+    .long   0                           /* Reserved */
+    .long   0                           /* Reserved */
+    .long   0                           /* Reserved */
+    .long   0                           /* Reserved */
+    .long   0                           /* Reserved */
+    .long   0                           /* Reserved */
+    .long   0                           /* Reserved */
+    .long   _SVC_Handler                /* SVCall Handler */
+    .long   0                           /* Reserved */
+    .long   0                           /* Reserved */
+    .long   _PendSV_Handler             /* PendSV Handler */
+    .long   _SysTick_Handler            /* SysTick Handler */
+
+  /* External Interrupts */
+    .long   _POWER_CLOCK_IRQHandler
+    .long   _RADIO_IRQHandler
+    .long   _UART0_IRQHandler
+    .long   _SPI0_TWI0_IRQHandler
+    .long   _SPI1_TWI1_IRQHandler
+    .long   0                         /*Reserved */
+    .long   _GPIOTE_IRQHandler
+    .long   _ADC_IRQHandler
+    .long   _TIMER0_IRQHandler
+    .long   _TIMER1_IRQHandler
+    .long   _TIMER2_IRQHandler
+    .long   _RTC0_IRQHandler
+    .long   _TEMP_IRQHandler
+    .long   _RNG_IRQHandler
+    .long   _ECB_IRQHandler
+    .long   _CCM_AAR_IRQHandler
+    .long   _WDT_IRQHandler
+    .long   _RTC1_IRQHandler
+    .long   _QDEC_IRQHandler
+    .long   _LPCOMP_IRQHandler
+    .long   _SWI0_IRQHandler
+    .long   _SWI1_IRQHandler
+    .long   _SWI2_IRQHandler
+    .long   _SWI3_IRQHandler
+    .long   _SWI4_IRQHandler
+    .long   _SWI5_IRQHandler
+    .long   0                         /*Reserved */
+    .long   0                         /*Reserved */
+    .long   0                         /*Reserved */
+    .long   0                         /*Reserved */
+    .long   0                         /*Reserved */
+    .long   0                         /*Reserved */
+
+    .size    __isr_vector, . - __isr_vector
+
+/* Reset Handler */
+
+    .equ    NRF_POWER_RAMON_ADDRESS,             0x40000524
+    .equ    NRF_POWER_RAMONB_ADDRESS,            0x40000554
+    .equ    NRF_POWER_RAMONx_RAMxON_ONMODE_Msk,  0x3
+
+    .text
+    .thumb
+    .thumb_func
+    .align 1
+    .globl    Reset_Handler
+    .type    Reset_Handler, %function
+Reset_Handler:
+    .fnstart
+
+/* Make sure ALL RAM banks are powered on */
+    MOVS    R1, #NRF_POWER_RAMONx_RAMxON_ONMODE_Msk
+
+    LDR     R0, =NRF_POWER_RAMON_ADDRESS
+    LDR     R2, [R0]
+    ORRS    R2, R1
+    STR     R2, [R0]
+
+    LDR     R0, =NRF_POWER_RAMONB_ADDRESS
+    LDR     R2, [R0]
+    ORRS    R2, R1
+    STR     R2, [R0]
+
+    /* Clear BSS */
+    subs    r0, r0
+    ldr     r2, =__bss_start__
+    ldr     r3, =__bss_end__
+.bss_zero_loop:
+    cmp     r2, r3
+    bhs     .data_copy_loop
+    stmia   r2!, {r0}
+    b    .bss_zero_loop
+
+/*     Loop to copy data from read only memory to RAM. The ranges
+ *      of copy from/to are specified by following symbols evaluated in
+ *      linker script.
+ *      __etext: End of code section, i.e., begin of data sections to copy from.
+ *      __data_start__/__data_end__: RAM address range that data should be
+ *      copied to. Both must be aligned to 4 bytes boundary.  */
+.data_copy_loop:
+    ldr    r1, =__etext
+    ldr    r2, =__data_start__
+    ldr    r3, =__data_end__
+
+    subs    r3, r2
+    ble     .LC0
+
+.LC1:
+    subs    r3, 4
+    ldr    r0, [r1,r3]
+    str    r0, [r2,r3]
+    bgt    .LC1
+.LC0:
+    LDR     R0, =__HeapBase
+    LDR     R1, =__HeapLimit
+    BL      _sbrkInit
+
+    LDR     R0, =SystemInit
+    BLX     R0
+    LDR     R0, =_start
+    BX      R0
+
+    .pool
+    .cantunwind
+    .fnend
+    .size   Reset_Handler,.-Reset_Handler
+
+    .section ".text"
+
+
+/* Dummy Exception Handlers (infinite loops which can be modified) */
+
+    .weak   NMI_Handler
+    .type   NMI_Handler, %function
+NMI_Handler:
+    B       .
+    .size   NMI_Handler, . - NMI_Handler
+
+    .weak   SVC_Handler
+    .type   SVC_Handler, %function
+SVC_Handler:
+    B       .
+    .size   SVC_Handler, . - SVC_Handler
+
+
+    .weak   PendSV_Handler
+    .type   PendSV_Handler, %function
+PendSV_Handler:
+    B       .
+    .size   PendSV_Handler, . - PendSV_Handler
+
+
+    .weak   SysTick_Handler
+    .type   SysTick_Handler, %function
+SysTick_Handler:
+    B       .
+    .size   SysTick_Handler, . - SysTick_Handler
+
+/* Default handler. This uses the vector in the relocated vector table */
+    .globl  Default_Handler
+    .type   Default_Handler, %function
+Default_Handler:
+    LDR     R2, =__vector_tbl_reloc__
+    MRS     R0, PSR
+    MOVS    R1, #0x3F
+    ANDS    R0, R1
+    LSLS    R0, R0, #2
+    LDR     R0, [R0, R2]
+    BX      R0
+    .size   Default_Handler, . - Default_Handler
+
+/*
+ * All of the following IRQ Handlers will point to the default handler unless
+ * they are defined elsewhere.
+ */
+    .macro  IRQ handler
+    .weak   \handler
+    .set    \handler, Default_Handler
+    .endm
+
+    IRQ  _NMI_Handler
+    IRQ  _HardFault_Handler
+    IRQ  _SVC_Handler
+    IRQ  _PendSV_Handler
+    IRQ  _SysTick_Handler
+    IRQ  _POWER_CLOCK_IRQHandler
+    IRQ  _RADIO_IRQHandler
+    IRQ  _UART0_IRQHandler
+    IRQ  _SPI0_TWI0_IRQHandler
+    IRQ  _SPI1_TWI1_IRQHandler
+    IRQ  _GPIOTE_IRQHandler
+    IRQ  _ADC_IRQHandler
+    IRQ  _TIMER0_IRQHandler
+    IRQ  _TIMER1_IRQHandler
+    IRQ  _TIMER2_IRQHandler
+    IRQ  _RTC0_IRQHandler
+    IRQ  _TEMP_IRQHandler
+    IRQ  _RNG_IRQHandler
+    IRQ  _ECB_IRQHandler
+    IRQ  _CCM_AAR_IRQHandler
+    IRQ  _WDT_IRQHandler
+    IRQ  _RTC1_IRQHandler
+    IRQ  _QDEC_IRQHandler
+    IRQ  _LPCOMP_IRQHandler
+    IRQ  _SWI0_IRQHandler
+    IRQ  _SWI1_IRQHandler
+    IRQ  _SWI2_IRQHandler
+    IRQ  _SWI3_IRQHandler
+    IRQ  _SWI4_IRQHandler
+    IRQ  _SWI5_IRQHandler
+
+  .end

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s b/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s
new file mode 100755
index 0000000..c347187
--- /dev/null
+++ b/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s
@@ -0,0 +1,182 @@
+/*
+Copyright (c) 2015, Nordic Semiconductor ASA
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of Nordic Semiconductor ASA nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+NOTE: Template files (including this one) are application specific and therefore
+expected to be copied into the application project folder prior to its use!
+*/
+
+    .syntax unified
+    .arch armv6-m
+
+    .section .stack
+    .align 3
+    .equ    Stack_Size, 432
+    .globl    __StackTop
+    .globl    __StackLimit
+__StackLimit:
+    .space    Stack_Size
+    .size __StackLimit, . - __StackLimit
+__StackTop:
+    .size __StackTop, . - __StackTop
+
+    .section .heap
+    .align 3
+#ifdef __HEAP_SIZE
+    .equ    Heap_Size, __HEAP_SIZE
+#else
+    .equ    Heap_Size, 0
+#endif
+    .globl    __HeapBase
+    .globl    __HeapLimit
+__HeapBase:
+    .if    Heap_Size
+    .space    Heap_Size
+    .endif
+    .size __HeapBase, . - __HeapBase
+__HeapLimit:
+    .size __HeapLimit, . - __HeapLimit
+
+    .section .isr_vector_split
+    .align 2
+    .globl __isr_vector_split
+__isr_vector_split:
+    .long    __StackTop                 /* Top of Stack */
+    .long   Reset_Handler_split         /* Reset Handler */
+
+    .size    __isr_vector_split, . - __isr_vector_split
+
+/* Reset Handler */
+
+    .equ    NRF_POWER_RAMON_ADDRESS,             0x40000524
+    .equ    NRF_POWER_RAMONB_ADDRESS,            0x40000554
+    .equ    NRF_POWER_RAMONx_RAMxON_ONMODE_Msk,  0x3
+
+    .text
+    .thumb
+    .thumb_func
+    .align 1
+    .globl    Reset_Handler_split
+    .type    Reset_Handler_split, %function
+Reset_Handler_split:
+    .fnstart
+
+
+/* Clear CPU state before proceeding */
+    SUBS    r0, r0
+    MSR     CONTROL, r0
+    MSR     PRIMASK, r0
+
+/* Make sure ALL RAM banks are powered on */
+    MOVS    R1, #NRF_POWER_RAMONx_RAMxON_ONMODE_Msk
+
+    LDR     R0, =NRF_POWER_RAMON_ADDRESS
+    LDR     R2, [R0]
+    ORRS    R2, R1
+    STR     R2, [R0]
+
+    LDR     R0, =NRF_POWER_RAMONB_ADDRESS
+    LDR     R2, [R0]
+    ORRS    R2, R1
+    STR     R2, [R0]
+
+    /* Clear BSS */
+    subs    r0, r0
+    ldr     r2, =__bss_start__
+    ldr     r3, =__bss_end__
+.bss_zero_loop:
+    cmp     r2, r3
+    bhs     .data_copy_loop
+    stmia   r2!, {r0}
+    b    .bss_zero_loop
+
+/*     Loop to copy data from read only memory to RAM. The ranges
+ *      of copy from/to are specified by following symbols evaluated in
+ *      linker script.
+ *      __etext: End of code section, i.e., begin of data sections to copy from.
+ *      __data_start__/__data_end__: RAM address range that data should be
+ *      copied to. Both must be aligned to 4 bytes boundary.  */
+.data_copy_loop:
+    ldr    r1, =__etext
+    ldr    r2, =__data_start__
+    ldr    r3, =__data_end__
+
+    subs    r3, r2
+    ble     .LC0
+
+.LC1:
+    subs    r3, 4
+    ldr    r0, [r1,r3]
+    str    r0, [r2,r3]
+    bgt    .LC1
+.LC0:
+    ldr    r1, =__etext_loader
+    ldr    r2, =__data_start___loader
+    ldr    r3, =__data_end___loader
+
+    subs    r3, r2
+    ble     .LC2
+
+.LC3:
+    subs    r3, 4
+    ldr    r0, [r1,r3]
+    str    r0, [r2,r3]
+    bgt    .LC3
+.LC2:
+
+    subs    r0, r0
+    ldr    r2, =__bss_start___loader
+    ldr    r3, =__bss_end___loader
+
+    subs    r3, r2
+    ble     .LC4
+
+.LC5:
+    subs    r3, 4
+    str    r0, [r2,r3]
+    bgt    .LC5
+.LC4:
+    LDR     R0, =__HeapBase
+    LDR     R1, =__HeapLimit
+    BL      _sbrkInit
+
+    LDR     R0, =SystemInit
+    BLX     R0
+    LDR     R0, =_start_split
+    BX      R0
+
+    .pool
+    .cantunwind
+    .fnend
+    .size   Reset_Handler_split,.-Reset_Handler_split
+
+    .section ".text"
+
+  .end

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/src/hal_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/src/hal_bsp.c b/hw/bsp/bbc_microbit/src/hal_bsp.c
new file mode 100644
index 0000000..23f5c84
--- /dev/null
+++ b/hw/bsp/bbc_microbit/src/hal_bsp.c
@@ -0,0 +1,176 @@
+/*
+ * 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.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+#include <assert.h>
+#include "hal/hal_system.h"
+#include "bsp/bsp.h"
+#include <nrf51.h>
+#include "mcu/nrf51_hal.h"
+#include "hal/hal_bsp.h"
+#include "os/os_cputime.h"
+#include "syscfg/syscfg.h"
+#include "flash_map/flash_map.h"
+#include "hal/hal_flash.h"
+#include "hal/hal_spi.h"
+#include "os/os_dev.h"
+
+#if MYNEWT_VAL(UART_0)
+#include "uart/uart.h"
+#include "uart_hal/uart_hal.h"
+
+static struct uart_dev os_bsp_uart0;
+static const struct nrf51_uart_cfg os_bsp_uart0_cfg = {
+    .suc_pin_tx = MYNEWT_VAL(UART_0_PIN_TX),
+    .suc_pin_rx = MYNEWT_VAL(UART_0_PIN_RX),
+    .suc_pin_rts = MYNEWT_VAL(UART_0_PIN_RTS),
+    .suc_pin_cts = MYNEWT_VAL(UART_0_PIN_CTS),
+};
+#endif
+
+#if MYNEWT_VAL(SPI_0_MASTER)
+/*
+ * NOTE: Our HAL expects that the SS pin, if used, is treated as a gpio line
+ * and is handled outside the SPI routines.
+ */
+static const nrf_drv_spi_config_t os_bsp_spi0m_cfg = {
+    .sck_pin      = 29,
+    .mosi_pin     = 25,
+    .miso_pin     = 28
+};
+#endif
+
+#if MYNEWT_VAL(SPI_1_SLAVE)
+static const nrf_drv_spis_config_t os_bsp_spi1s_cfg = {
+    .sck_pin      = 29,
+    .mosi_pin     = 25,
+    .miso_pin     = 28,
+    .ss_pin       = 24
+};
+#endif
+
+/*
+ * What memory to include in coredump.
+ */
+static const struct hal_bsp_mem_dump dump_cfg[] = {
+    [0] = {
+        .hbmd_start = &_ram_start,
+        .hbmd_size = RAM_SIZE
+    }
+};
+
+const struct hal_flash *
+hal_bsp_flash_dev(uint8_t id)
+{
+    /*
+     * Internal flash mapped to id 0.
+     */
+    if (id != 0) {
+        return NULL;
+    }
+    return &nrf51_flash_dev;
+}
+
+const struct hal_bsp_mem_dump *
+hal_bsp_core_dump(int *area_cnt)
+{
+    *area_cnt = sizeof(dump_cfg) / sizeof(dump_cfg[0]);
+    return dump_cfg;
+}
+
+int
+hal_bsp_power_state(int state)
+{
+    return (0);
+}
+
+/**
+ * Returns the configured priority for the given interrupt. If no priority
+ * configured, return the priority passed in
+ *
+ * @param irq_num
+ * @param pri
+ *
+ * @return uint32_t
+ */
+uint32_t
+hal_bsp_get_nvic_priority(int irq_num, uint32_t pri)
+{
+    uint32_t cfg_pri;
+
+    switch (irq_num) {
+    /* Radio gets highest priority */
+    case RADIO_IRQn:
+        cfg_pri = 0;
+        break;
+    default:
+        cfg_pri = pri;
+    }
+    return cfg_pri;
+}
+
+void
+hal_bsp_init(void)
+{
+    int rc;
+
+    (void)rc;
+
+    /* Make sure system clocks have started */
+    hal_system_clock_start();
+
+#if MYNEWT_VAL(UART_0)
+    rc = os_dev_create((struct os_dev *) &os_bsp_uart0, "uart0",
+      OS_DEV_INIT_PRIMARY, 0, uart_hal_init, (void *)&os_bsp_uart0_cfg);
+    assert(rc == 0);
+#endif
+
+#if MYNEWT_VAL(TIMER_0)
+    rc = hal_timer_init(0, NULL);
+    assert(rc == 0);
+#endif
+#if MYNEWT_VAL(TIMER_1)
+    rc = hal_timer_init(1, NULL);
+    assert(rc == 0);
+#endif
+#if MYNEWT_VAL(TIMER_2)
+    rc = hal_timer_init(2, NULL);
+    assert(rc == 0);
+#endif
+#if MYNEWT_VAL(TIMER_3)
+    rc = hal_timer_init(3, NULL);
+    assert(rc == 0);
+#endif
+
+#if (MYNEWT_VAL(OS_CPUTIME_TIMER_NUM) >= 0)
+    rc = os_cputime_init(MYNEWT_VAL(OS_CPUTIME_FREQ));
+    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_1_SLAVE)
+    rc = hal_spi_init(1, (void *)&os_bsp_spi1s_cfg, HAL_SPI_TYPE_SLAVE);
+    assert(rc == 0);
+#endif
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/src/sbrk.c b/hw/bsp/bbc_microbit/src/sbrk.c
new file mode 100644
index 0000000..3fe253e
--- /dev/null
+++ b/hw/bsp/bbc_microbit/src/sbrk.c
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+/* put these in the data section so they are not cleared by _start */
+static char *sbrkBase __attribute__ ((section (".data")));
+static char *sbrkLimit __attribute__ ((section (".data")));
+static char *brk __attribute__ ((section (".data")));
+
+void
+_sbrkInit(char *base, char *limit) {
+    sbrkBase = base;
+    sbrkLimit = limit;
+    brk = base;
+}
+
+void *
+_sbrk(int incr)
+{
+    void *prev_brk;
+
+    if (incr < 0) {
+        /* Returning memory to the heap. */
+        incr = -incr;
+        if (brk - incr < sbrkBase) {
+            prev_brk = (void *)-1;
+        } else {
+            prev_brk = brk;
+            brk -= incr;
+        }
+    } else {
+        /* Allocating memory from the heap. */
+        if (sbrkLimit - brk >= incr) {
+            prev_brk = brk;
+            brk += incr;
+        } else {
+            prev_brk = (void *)-1;
+        }
+    }
+
+    return prev_brk;
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5f5e19ff/hw/bsp/bbc_microbit/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/bbc_microbit/syscfg.yml b/hw/bsp/bbc_microbit/syscfg.yml
new file mode 100644
index 0000000..ff9cee3
--- /dev/null
+++ b/hw/bsp/bbc_microbit/syscfg.yml
@@ -0,0 +1,84 @@
+#
+# 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.
+#
+
+# Package: hw/bsp/bbc_microbit
+
+syscfg.defs:
+    BSP_NRF51:
+        description: 'TBD'
+        value: 1
+
+    XTAL_32768_SYNTH:
+        description: 'TBD'
+        value: 1
+
+    UART_0:
+        description: 'TBD'
+        value: 1
+    UART_0_PIN_TX:
+        description: 'TBD'
+        value: 24
+    UART_0_PIN_RX:
+        description: 'TBD'
+        value: 25
+    UART_0_PIN_RTS:
+        description: 'TBD'
+        value: 0
+    UART_0_PIN_CTS:
+        description: 'TBD'
+        value: 0
+
+    SPI_0_MASTER:
+        description: 'SPI 0 master'
+        value:  0
+    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'
+        value:  1
+    TIMER_1:
+        description: 'NRF51 Timer 1'
+        value:  0
+    TIMER_2:
+        description: 'NRF51 Timer 2'
+        value:  0
+    TIMER_3:
+        description: 'NRF51 RTC0'
+        value:  0
+
+syscfg.vals:
+    CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS
+    REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
+    NFFS_FLASH_AREA: FLASH_AREA_NFFS
+    COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1



[20/50] incubator-mynewt-core git commit: MYNEWT-545; switch from using load address to using load region.

Posted by vi...@apache.org.
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/sensors_branch
Commit: 4f4f6870154765bea18eb6cf73d97b896bb0f59a
Parents: d3397d7
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Mon Feb 13 17:53:28 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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
         . = 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/nrf52dk/split-nrf52dk.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52dk/split-nrf52dk.ld b/hw/bsp/nrf52dk/split-nrf52dk.ld
index ebfac21..f4ffe5a 100755
--- a/hw/bsp/nrf52dk/split-nrf52dk.ld
+++ b/hw/bsp/nrf52dk/split-nrf52dk.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/olimex_stm32-e407_devboard/run_from_flash.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/run_from_flash.ld b/hw/bsp/olimex_stm32-e407_devboard/run_from_flash.ld
deleted file mode 100644
index caff52b..0000000
--- a/hw/bsp/olimex_stm32-e407_devboard/run_from_flash.ld
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * 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.
- */
- 
-/* Linker script for STM32F407 when running from flash and not using the bootloader */
-
-/* Linker script to configure memory regions. */
-MEMORY
-{ 
-  FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
-  CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
-  RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000 
-}
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- *   Reset_Handler : Entry of reset handler
- * 
- * It defines following symbols, which code can use without definition:
- *   __exidx_start
- *   __exidx_end
- *   __etext
- *   __data_start__
- *   __preinit_array_start
- *   __preinit_array_end
- *   __init_array_start
- *   __init_array_end
- *   __fini_array_start
- *   __fini_array_end
- *   __data_end__
- *   __bss_start__
- *   __bss_end__
- *   __end__
- *   end
- *   __HeapBase
- *   __HeapLimit
- *   __StackLimit
- *   __StackTop
- *   __stack
- *   __coredata_start__
- *   __coredata_end__
- *   __corebss_start__
- *   __corebss_end__
- *   __ecoredata
- *   __ecorebs
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
-    .text :
-    {
-        __isr_vector_start = .;
-        KEEP(*(.isr_vector))
-        __isr_vector_end = .;
-        *(.text*)
-
-        KEEP(*(.init))
-        KEEP(*(.fini))
-
-        /* .ctors */
-        *crtbegin.o(.ctors)
-        *crtbegin?.o(.ctors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
-        *(SORT(.ctors.*))
-        *(.ctors)
-
-        /* .dtors */
-        *crtbegin.o(.dtors)
-        *crtbegin?.o(.dtors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
-        *(SORT(.dtors.*))
-        *(.dtors)
-
-        *(.rodata*)
-
-        KEEP(*(.eh_frame*))
-    } > FLASH
-
-    .ARM.extab : 
-    {
-        *(.ARM.extab* .gnu.linkonce.armextab.*)
-    } > FLASH
-
-    __exidx_start = .;
-    .ARM.exidx :
-    {
-        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
-    } > FLASH
-
-    __exidx_end = .;
-
-    __etext = .;
-
-    .vector_relocation :
-    {
-        . = ALIGN(4);
-        __vector_tbl_reloc__ = .;
-        . = . + (__isr_vector_end - __isr_vector_start);
-        . = ALIGN(4);
-    } > RAM
-
-    .coredata : AT (__etext)
-    {
-        __coredata_start__ = .;
-        *(.data.core)
-        . = ALIGN(4);
-        __coredata_end__ = .;
-    } > CCM
-
-    __ecoredata = __etext + SIZEOF(.coredata);
-        
-    .data : AT (__ecoredata)
-    {
-        __data_start__ = .;
-        *(vtable)
-        *(.data*)
-
-        /* preinit data */
-        PROVIDE_HIDDEN (__preinit_array_start = .);
-        KEEP(*(.preinit_array))
-        PROVIDE_HIDDEN (__preinit_array_end = .);
-
-        . = ALIGN(4);
-        /* init data */
-        PROVIDE_HIDDEN (__init_array_start = .);
-        KEEP(*(SORT(.init_array.*)))
-        KEEP(*(.init_array))
-        PROVIDE_HIDDEN (__init_array_end = .);
-
-
-        . = ALIGN(4);
-        /* finit data */
-        PROVIDE_HIDDEN (__fini_array_start = .);
-        KEEP(*(SORT(.fini_array.*)))
-        KEEP(*(.fini_array))
-        PROVIDE_HIDDEN (__fini_array_end = .);
-
-        KEEP(*(.jcr*))
-        . = ALIGN(4);
-        /* All data end */
-        __data_end__ = .;
-
-    } > RAM
-
-    .corebss (NOLOAD):
-    {
-        . = ALIGN(4);
-        __corebss_start__ = .;
-        *(.bss.core)
-        . = ALIGN(4);
-        __corebss_end__ = .;
-        *(.corebss*)
-        *(.bss.core.nz)
-        . = ALIGN(4);
-        __ecorebss = .;
-    } > CCM
-
-    .bss :
-    {
-        . = ALIGN(4);
-        __bss_start__ = .;
-        *(.bss*)
-        *(COMMON)
-        . = ALIGN(4);
-        __bss_end__ = .;
-    } > RAM
-
-    __HeapBase = .;
-    __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
-
-    /* .stack_dummy section doesn't contains any symbols. It is only
-     * used for linker to calculate size of stack sections, and assign
-     * values to stack symbols later */
-    .stack_dummy (COPY):
-    {
-        *(.stack*)
-    } > CCM
-
-    /* Set stack top to end of CCM; stack limit is bottom of stack */
-    __StackTop = ORIGIN(CCM) + LENGTH(CCM);
-    __StackLimit = __StackTop - SIZEOF(.stack_dummy);
-    PROVIDE(__stack = __StackTop);
-    
-    /* Check for CCM overflow */
-    ASSERT(__StackLimit >= __ecorebss, "CCM overflow!")
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/olimex_stm32-e407_devboard/run_from_loader.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/run_from_loader.ld b/hw/bsp/olimex_stm32-e407_devboard/run_from_loader.ld
deleted file mode 100755
index e3061dc..0000000
--- a/hw/bsp/olimex_stm32-e407_devboard/run_from_loader.ld
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * 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.
- */
-
-/* Linker script for STM32F407 when running from flash and using the bootloader */
-
-/* Linker script to configure memory regions. */
-MEMORY
-{ 
-  FLASH (rx) :  ORIGIN = 0x08020000, LENGTH = 384K /* First image slot. */
-  CCM (rwx) :   ORIGIN = 0x10000000, LENGTH = 64K
-  RAM (rwx) :   ORIGIN = 0x20000000, LENGTH = 128K
-}
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- *   Reset_Handler : Entry of reset handler
- * 
- * It defines following symbols, which code can use without definition:
- *   __exidx_start
- *   __exidx_end
- *   __etext
- *   __data_start__
- *   __preinit_array_start
- *   __preinit_array_end
- *   __init_array_start
- *   __init_array_end
- *   __fini_array_start
- *   __fini_array_end
- *   __data_end__
- *   __bss_start__
- *   __bss_end__
- *   __end__
- *   end
- *   __HeapBase
- *   __HeapLimit
- *   __StackLimit
- *   __StackTop
- *   __stack
- *   __coredata_start__
- *   __coredata_end__
- *   __corebss_start__
- *   __corebss_end__
- *   __ecoredata
- *   __ecorebss
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
-    /* Reserve space at the start of the image for the header. */
-    .imghdr (NOLOAD):
-    {
-        . = . + 0x20;
-    } > FLASH
-
-    .text :
-    {
-        __isr_vector_start = .;
-        KEEP(*(.isr_vector))
-        __isr_vector_end = .;
-        *(.text*)
-
-        KEEP(*(.init))
-        KEEP(*(.fini))
-
-        /* .ctors */
-        *crtbegin.o(.ctors)
-        *crtbegin?.o(.ctors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
-        *(SORT(.ctors.*))
-        *(.ctors)
-
-        /* .dtors */
-        *crtbegin.o(.dtors)
-        *crtbegin?.o(.dtors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
-        *(SORT(.dtors.*))
-        *(.dtors)
-
-        *(.rodata*)
-
-        KEEP(*(.eh_frame*))
-    } > FLASH
-
-    .ARM.extab : 
-    {
-        *(.ARM.extab* .gnu.linkonce.armextab.*)
-    } > FLASH
-
-    __exidx_start = .;
-    .ARM.exidx :
-    {
-        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
-    } > FLASH
-
-    __exidx_end = .;
-
-    __etext = .;
-
-    .vector_relocation :
-    {
-        . = ALIGN(4);
-        __vector_tbl_reloc__ = .;
-        . = . + (__isr_vector_end - __isr_vector_start);
-        . = ALIGN(4);
-    } > RAM
-
-    .coredata : AT (__etext)
-    {
-        __coredata_start__ = .;
-        *(.data.core)
-        . = ALIGN(4);
-        __coredata_end__ = .;
-    } > CCM
-
-    __ecoredata = __etext + SIZEOF(.coredata);
-        
-    .data : AT (__ecoredata)
-    {
-        __data_start__ = .;
-        *(vtable)
-        *(.data*)
-
-        /* preinit data */
-        PROVIDE_HIDDEN (__preinit_array_start = .);
-        KEEP(*(.preinit_array))
-        PROVIDE_HIDDEN (__preinit_array_end = .);
-
-        . = ALIGN(4);
-        /* init data */
-        PROVIDE_HIDDEN (__init_array_start = .);
-        KEEP(*(SORT(.init_array.*)))
-        KEEP(*(.init_array))
-        PROVIDE_HIDDEN (__init_array_end = .);
-
-
-        . = ALIGN(4);
-        /* finit data */
-        PROVIDE_HIDDEN (__fini_array_start = .);
-        KEEP(*(SORT(.fini_array.*)))
-        KEEP(*(.fini_array))
-        PROVIDE_HIDDEN (__fini_array_end = .);
-
-        KEEP(*(.jcr*))
-        . = ALIGN(4);
-        /* All data end */
-        __data_end__ = .;
-
-    } > RAM
-
-    .corebss (NOLOAD):
-    {
-        . = ALIGN(4);
-        __corebss_start__ = .;
-        *(.bss.core)
-        . = ALIGN(4);
-        __corebss_end__ = .;
-        *(.corebss*)
-        *(.bss.core.nz)
-        . = ALIGN(4);
-        __ecorebss = .;
-    } > CCM
-
-    .bss :
-    {
-        . = ALIGN(4);
-        __bss_start__ = .;
-        *(.bss*)
-        *(COMMON)
-        . = ALIGN(4);
-        __bss_end__ = .;
-    } > RAM
-
-    __HeapBase = .;
-    __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
-
-    /* .stack_dummy section doesn't contains any symbols. It is only
-     * used for linker to calculate size of stack sections, and assign
-     * values to stack symbols later */
-    .stack_dummy (COPY):
-    {
-        *(.stack*)
-    } > CCM
-
-    /* Set stack top to end of CCM; stack limit is bottom of stack */
-    __StackTop = ORIGIN(CCM) + LENGTH(CCM);
-    __StackLimit = __StackTop - SIZEOF(.stack_dummy);
-    PROVIDE(__stack = __StackTop);
-    
-    /* Check for CCM overflow */
-    ASSERT(__StackLimit >= __ecorebss, "CCM overflow!")
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/olimex_stm32-e407_devboard/run_from_sram.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/run_from_sram.ld b/hw/bsp/olimex_stm32-e407_devboard/run_from_sram.ld
deleted file mode 100755
index 31e4386..0000000
--- a/hw/bsp/olimex_stm32-e407_devboard/run_from_sram.ld
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * 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.
- */
-
-/* Linker script for STM32F407 when running code from SRAM */
-
-/* Linker script to configure memory regions. */
-MEMORY
-{ 
-  FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
-  CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
-  RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000
-}
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- *   Reset_Handler : Entry of reset handler
- * 
- * It defines following symbols, which code can use without definition:
- *   __exidx_start
- *   __exidx_end
- *   __etext
- *   __data_start__
- *   __preinit_array_start
- *   __preinit_array_end
- *   __init_array_start
- *   __init_array_end
- *   __fini_array_start
- *   __fini_array_end
- *   __data_end__
- *   __bss_start__
- *   __bss_end__
- *   __end__
- *   end
- *   __HeapBase
- *   __HeapLimit
- *   __StackLimit
- *   __StackTop
- *   __stack
- *   __coredata_start__
- *   __coredata_end__
- *   __corebss_start__
- *   __corebss_end__
- *   __ecoredata
- *   __ecorebss
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
-    .text :
-    {
-        __vector_tbl_reloc__ = .;
-        KEEP(*(.isr_vector))
-        *(.text*)
-
-        KEEP(*(.init))
-        KEEP(*(.fini))
-
-        /* .ctors */
-        *crtbegin.o(.ctors)
-        *crtbegin?.o(.ctors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
-        *(SORT(.ctors.*))
-        *(.ctors)
-
-        /* .dtors */
-        *crtbegin.o(.dtors)
-        *crtbegin?.o(.dtors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
-        *(SORT(.dtors.*))
-        *(.dtors)
-
-        *(.rodata*)
-
-        KEEP(*(.eh_frame*))
-    } > RAM
-
-    .ARM.extab : 
-    {
-        *(.ARM.extab* .gnu.linkonce.armextab.*)
-    } > RAM
-
-    __exidx_start = .;
-    .ARM.exidx :
-    {
-        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
-    } > RAM
-
-    __exidx_end = .;
-
-    . = ALIGN(8);
-    __etext = .;
-
-    .coredata : AT (__etext)
-    {
-        __coredata_start__ = .;
-        *(.data.core)
-        . = ALIGN(8);
-        __coredata_end__ = .;
-    } > CCM
-
-    __ecoredata = __etext + SIZEOF(.coredata);
-
-    /* This section is here so that the start of .data has the same VMA and LMA */
-    .ram_coredata (NOLOAD):
-    {
-        . = . + SIZEOF(.coredata);
-    } > RAM
-
-    .data : AT (__ecoredata)
-    {
-        __data_start__ = .;
-        *(vtable)
-        *(.data*)
-
-        /* preinit data */
-        PROVIDE_HIDDEN (__preinit_array_start = .);
-        KEEP(*(.preinit_array))
-        PROVIDE_HIDDEN (__preinit_array_end = .);
-
-        . = ALIGN(4);
-        /* init data */
-        PROVIDE_HIDDEN (__init_array_start = .);
-        KEEP(*(SORT(.init_array.*)))
-        KEEP(*(.init_array))
-        PROVIDE_HIDDEN (__init_array_end = .);
-
-
-        . = ALIGN(4);
-        /* finit data */
-        PROVIDE_HIDDEN (__fini_array_start = .);
-        KEEP(*(SORT(.fini_array.*)))
-        KEEP(*(.fini_array))
-        PROVIDE_HIDDEN (__fini_array_end = .);
-
-        KEEP(*(.jcr*))
-        . = ALIGN(4);
-        /* All data end */
-        __data_end__ = .;
-
-    } > RAM
-
-    .corebss (NOLOAD):
-    {
-        . = ALIGN(4);
-        __corebss_start__ = .;
-        *(.bss.core)
-        . = ALIGN(4);
-        __corebss_end__ = .;
-        *(.corebss*)
-        *(.bss.core.nz)
-        . = ALIGN(4);
-        __ecorebss = .;
-    } > CCM
-
-    .bss :
-    {
-        . = ALIGN(4);
-        __bss_start__ = .;
-        *(.bss*)
-        *(COMMON)
-        . = ALIGN(4);
-        __bss_end__ = .;
-    } > RAM
-
-    __HeapBase = .;
-    __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
-
-    /* .stack_dummy section doesn't contains any symbols. It is only
-     * used for linker to calculate size of stack sections, and assign
-     * values to stack symbols later */
-    .stack_dummy (COPY):
-    {
-        *(.stack*)
-    } > CCM
-
-    /* Set stack top to end of CCM; stack limit is bottom of stack */
-    __StackTop = ORIGIN(CCM) + LENGTH(CCM);
-    __StackLimit = __StackTop - SIZEOF(.stack_dummy);
-    PROVIDE(__stack = __StackTop);
-    
-    /* Check for CCM overflow */
-    ASSERT(__StackLimit >= __ecorebss, "CCM overflow!")
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/rb-nano2/split-rb-nano2.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/rb-nano2/split-rb-nano2.ld b/hw/bsp/rb-nano2/split-rb-nano2.ld
index ebfac21..f4ffe5a 100755
--- a/hw/bsp/rb-nano2/split-rb-nano2.ld
+++ b/hw/bsp/rb-nano2/split-rb-nano2.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/stm32f4discovery/run_from_flash.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/stm32f4discovery/run_from_flash.ld b/hw/bsp/stm32f4discovery/run_from_flash.ld
deleted file mode 100644
index caff52b..0000000
--- a/hw/bsp/stm32f4discovery/run_from_flash.ld
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * 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.
- */
- 
-/* Linker script for STM32F407 when running from flash and not using the bootloader */
-
-/* Linker script to configure memory regions. */
-MEMORY
-{ 
-  FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
-  CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
-  RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000 
-}
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- *   Reset_Handler : Entry of reset handler
- * 
- * It defines following symbols, which code can use without definition:
- *   __exidx_start
- *   __exidx_end
- *   __etext
- *   __data_start__
- *   __preinit_array_start
- *   __preinit_array_end
- *   __init_array_start
- *   __init_array_end
- *   __fini_array_start
- *   __fini_array_end
- *   __data_end__
- *   __bss_start__
- *   __bss_end__
- *   __end__
- *   end
- *   __HeapBase
- *   __HeapLimit
- *   __StackLimit
- *   __StackTop
- *   __stack
- *   __coredata_start__
- *   __coredata_end__
- *   __corebss_start__
- *   __corebss_end__
- *   __ecoredata
- *   __ecorebs
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
-    .text :
-    {
-        __isr_vector_start = .;
-        KEEP(*(.isr_vector))
-        __isr_vector_end = .;
-        *(.text*)
-
-        KEEP(*(.init))
-        KEEP(*(.fini))
-
-        /* .ctors */
-        *crtbegin.o(.ctors)
-        *crtbegin?.o(.ctors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
-        *(SORT(.ctors.*))
-        *(.ctors)
-
-        /* .dtors */
-        *crtbegin.o(.dtors)
-        *crtbegin?.o(.dtors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
-        *(SORT(.dtors.*))
-        *(.dtors)
-
-        *(.rodata*)
-
-        KEEP(*(.eh_frame*))
-    } > FLASH
-
-    .ARM.extab : 
-    {
-        *(.ARM.extab* .gnu.linkonce.armextab.*)
-    } > FLASH
-
-    __exidx_start = .;
-    .ARM.exidx :
-    {
-        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
-    } > FLASH
-
-    __exidx_end = .;
-
-    __etext = .;
-
-    .vector_relocation :
-    {
-        . = ALIGN(4);
-        __vector_tbl_reloc__ = .;
-        . = . + (__isr_vector_end - __isr_vector_start);
-        . = ALIGN(4);
-    } > RAM
-
-    .coredata : AT (__etext)
-    {
-        __coredata_start__ = .;
-        *(.data.core)
-        . = ALIGN(4);
-        __coredata_end__ = .;
-    } > CCM
-
-    __ecoredata = __etext + SIZEOF(.coredata);
-        
-    .data : AT (__ecoredata)
-    {
-        __data_start__ = .;
-        *(vtable)
-        *(.data*)
-
-        /* preinit data */
-        PROVIDE_HIDDEN (__preinit_array_start = .);
-        KEEP(*(.preinit_array))
-        PROVIDE_HIDDEN (__preinit_array_end = .);
-
-        . = ALIGN(4);
-        /* init data */
-        PROVIDE_HIDDEN (__init_array_start = .);
-        KEEP(*(SORT(.init_array.*)))
-        KEEP(*(.init_array))
-        PROVIDE_HIDDEN (__init_array_end = .);
-
-
-        . = ALIGN(4);
-        /* finit data */
-        PROVIDE_HIDDEN (__fini_array_start = .);
-        KEEP(*(SORT(.fini_array.*)))
-        KEEP(*(.fini_array))
-        PROVIDE_HIDDEN (__fini_array_end = .);
-
-        KEEP(*(.jcr*))
-        . = ALIGN(4);
-        /* All data end */
-        __data_end__ = .;
-
-    } > RAM
-
-    .corebss (NOLOAD):
-    {
-        . = ALIGN(4);
-        __corebss_start__ = .;
-        *(.bss.core)
-        . = ALIGN(4);
-        __corebss_end__ = .;
-        *(.corebss*)
-        *(.bss.core.nz)
-        . = ALIGN(4);
-        __ecorebss = .;
-    } > CCM
-
-    .bss :
-    {
-        . = ALIGN(4);
-        __bss_start__ = .;
-        *(.bss*)
-        *(COMMON)
-        . = ALIGN(4);
-        __bss_end__ = .;
-    } > RAM
-
-    __HeapBase = .;
-    __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
-
-    /* .stack_dummy section doesn't contains any symbols. It is only
-     * used for linker to calculate size of stack sections, and assign
-     * values to stack symbols later */
-    .stack_dummy (COPY):
-    {
-        *(.stack*)
-    } > CCM
-
-    /* Set stack top to end of CCM; stack limit is bottom of stack */
-    __StackTop = ORIGIN(CCM) + LENGTH(CCM);
-    __StackLimit = __StackTop - SIZEOF(.stack_dummy);
-    PROVIDE(__stack = __StackTop);
-    
-    /* Check for CCM overflow */
-    ASSERT(__StackLimit >= __ecorebss, "CCM overflow!")
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/stm32f4discovery/run_from_loader.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/stm32f4discovery/run_from_loader.ld b/hw/bsp/stm32f4discovery/run_from_loader.ld
deleted file mode 100644
index e3061dc..0000000
--- a/hw/bsp/stm32f4discovery/run_from_loader.ld
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * 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.
- */
-
-/* Linker script for STM32F407 when running from flash and using the bootloader */
-
-/* Linker script to configure memory regions. */
-MEMORY
-{ 
-  FLASH (rx) :  ORIGIN = 0x08020000, LENGTH = 384K /* First image slot. */
-  CCM (rwx) :   ORIGIN = 0x10000000, LENGTH = 64K
-  RAM (rwx) :   ORIGIN = 0x20000000, LENGTH = 128K
-}
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- *   Reset_Handler : Entry of reset handler
- * 
- * It defines following symbols, which code can use without definition:
- *   __exidx_start
- *   __exidx_end
- *   __etext
- *   __data_start__
- *   __preinit_array_start
- *   __preinit_array_end
- *   __init_array_start
- *   __init_array_end
- *   __fini_array_start
- *   __fini_array_end
- *   __data_end__
- *   __bss_start__
- *   __bss_end__
- *   __end__
- *   end
- *   __HeapBase
- *   __HeapLimit
- *   __StackLimit
- *   __StackTop
- *   __stack
- *   __coredata_start__
- *   __coredata_end__
- *   __corebss_start__
- *   __corebss_end__
- *   __ecoredata
- *   __ecorebss
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
-    /* Reserve space at the start of the image for the header. */
-    .imghdr (NOLOAD):
-    {
-        . = . + 0x20;
-    } > FLASH
-
-    .text :
-    {
-        __isr_vector_start = .;
-        KEEP(*(.isr_vector))
-        __isr_vector_end = .;
-        *(.text*)
-
-        KEEP(*(.init))
-        KEEP(*(.fini))
-
-        /* .ctors */
-        *crtbegin.o(.ctors)
-        *crtbegin?.o(.ctors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
-        *(SORT(.ctors.*))
-        *(.ctors)
-
-        /* .dtors */
-        *crtbegin.o(.dtors)
-        *crtbegin?.o(.dtors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
-        *(SORT(.dtors.*))
-        *(.dtors)
-
-        *(.rodata*)
-
-        KEEP(*(.eh_frame*))
-    } > FLASH
-
-    .ARM.extab : 
-    {
-        *(.ARM.extab* .gnu.linkonce.armextab.*)
-    } > FLASH
-
-    __exidx_start = .;
-    .ARM.exidx :
-    {
-        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
-    } > FLASH
-
-    __exidx_end = .;
-
-    __etext = .;
-
-    .vector_relocation :
-    {
-        . = ALIGN(4);
-        __vector_tbl_reloc__ = .;
-        . = . + (__isr_vector_end - __isr_vector_start);
-        . = ALIGN(4);
-    } > RAM
-
-    .coredata : AT (__etext)
-    {
-        __coredata_start__ = .;
-        *(.data.core)
-        . = ALIGN(4);
-        __coredata_end__ = .;
-    } > CCM
-
-    __ecoredata = __etext + SIZEOF(.coredata);
-        
-    .data : AT (__ecoredata)
-    {
-        __data_start__ = .;
-        *(vtable)
-        *(.data*)
-
-        /* preinit data */
-        PROVIDE_HIDDEN (__preinit_array_start = .);
-        KEEP(*(.preinit_array))
-        PROVIDE_HIDDEN (__preinit_array_end = .);
-
-        . = ALIGN(4);
-        /* init data */
-        PROVIDE_HIDDEN (__init_array_start = .);
-        KEEP(*(SORT(.init_array.*)))
-        KEEP(*(.init_array))
-        PROVIDE_HIDDEN (__init_array_end = .);
-
-
-        . = ALIGN(4);
-        /* finit data */
-        PROVIDE_HIDDEN (__fini_array_start = .);
-        KEEP(*(SORT(.fini_array.*)))
-        KEEP(*(.fini_array))
-        PROVIDE_HIDDEN (__fini_array_end = .);
-
-        KEEP(*(.jcr*))
-        . = ALIGN(4);
-        /* All data end */
-        __data_end__ = .;
-
-    } > RAM
-
-    .corebss (NOLOAD):
-    {
-        . = ALIGN(4);
-        __corebss_start__ = .;
-        *(.bss.core)
-        . = ALIGN(4);
-        __corebss_end__ = .;
-        *(.corebss*)
-        *(.bss.core.nz)
-        . = ALIGN(4);
-        __ecorebss = .;
-    } > CCM
-
-    .bss :
-    {
-        . = ALIGN(4);
-        __bss_start__ = .;
-        *(.bss*)
-        *(COMMON)
-        . = ALIGN(4);
-        __bss_end__ = .;
-    } > RAM
-
-    __HeapBase = .;
-    __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
-
-    /* .stack_dummy section doesn't contains any symbols. It is only
-     * used for linker to calculate size of stack sections, and assign
-     * values to stack symbols later */
-    .stack_dummy (COPY):
-    {
-        *(.stack*)
-    } > CCM
-
-    /* Set stack top to end of CCM; stack limit is bottom of stack */
-    __StackTop = ORIGIN(CCM) + LENGTH(CCM);
-    __StackLimit = __StackTop - SIZEOF(.stack_dummy);
-    PROVIDE(__stack = __StackTop);
-    
-    /* Check for CCM overflow */
-    ASSERT(__StackLimit >= __ecorebss, "CCM overflow!")
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/stm32f4discovery/run_from_sram.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/stm32f4discovery/run_from_sram.ld b/hw/bsp/stm32f4discovery/run_from_sram.ld
deleted file mode 100644
index 31e4386..0000000
--- a/hw/bsp/stm32f4discovery/run_from_sram.ld
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * 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.
- */
-
-/* Linker script for STM32F407 when running code from SRAM */
-
-/* Linker script to configure memory regions. */
-MEMORY
-{ 
-  FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
-  CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
-  RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000
-}
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- *   Reset_Handler : Entry of reset handler
- * 
- * It defines following symbols, which code can use without definition:
- *   __exidx_start
- *   __exidx_end
- *   __etext
- *   __data_start__
- *   __preinit_array_start
- *   __preinit_array_end
- *   __init_array_start
- *   __init_array_end
- *   __fini_array_start
- *   __fini_array_end
- *   __data_end__
- *   __bss_start__
- *   __bss_end__
- *   __end__
- *   end
- *   __HeapBase
- *   __HeapLimit
- *   __StackLimit
- *   __StackTop
- *   __stack
- *   __coredata_start__
- *   __coredata_end__
- *   __corebss_start__
- *   __corebss_end__
- *   __ecoredata
- *   __ecorebss
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
-    .text :
-    {
-        __vector_tbl_reloc__ = .;
-        KEEP(*(.isr_vector))
-        *(.text*)
-
-        KEEP(*(.init))
-        KEEP(*(.fini))
-
-        /* .ctors */
-        *crtbegin.o(.ctors)
-        *crtbegin?.o(.ctors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
-        *(SORT(.ctors.*))
-        *(.ctors)
-
-        /* .dtors */
-        *crtbegin.o(.dtors)
-        *crtbegin?.o(.dtors)
-        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
-        *(SORT(.dtors.*))
-        *(.dtors)
-
-        *(.rodata*)
-
-        KEEP(*(.eh_frame*))
-    } > RAM
-
-    .ARM.extab : 
-    {
-        *(.ARM.extab* .gnu.linkonce.armextab.*)
-    } > RAM
-
-    __exidx_start = .;
-    .ARM.exidx :
-    {
-        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
-    } > RAM
-
-    __exidx_end = .;
-
-    . = ALIGN(8);
-    __etext = .;
-
-    .coredata : AT (__etext)
-    {
-        __coredata_start__ = .;
-        *(.data.core)
-        . = ALIGN(8);
-        __coredata_end__ = .;
-    } > CCM
-
-    __ecoredata = __etext + SIZEOF(.coredata);
-
-    /* This section is here so that the start of .data has the same VMA and LMA */
-    .ram_coredata (NOLOAD):
-    {
-        . = . + SIZEOF(.coredata);
-    } > RAM
-
-    .data : AT (__ecoredata)
-    {
-        __data_start__ = .;
-        *(vtable)
-        *(.data*)
-
-        /* preinit data */
-        PROVIDE_HIDDEN (__preinit_array_start = .);
-        KEEP(*(.preinit_array))
-        PROVIDE_HIDDEN (__preinit_array_end = .);
-
-        . = ALIGN(4);
-        /* init data */
-        PROVIDE_HIDDEN (__init_array_start = .);
-        KEEP(*(SORT(.init_array.*)))
-        KEEP(*(.init_array))
-        PROVIDE_HIDDEN (__init_array_end = .);
-
-
-        . = ALIGN(4);
-        /* finit data */
-        PROVIDE_HIDDEN (__fini_array_start = .);
-        KEEP(*(SORT(.fini_array.*)))
-        KEEP(*(.fini_array))
-        PROVIDE_HIDDEN (__fini_array_end = .);
-
-        KEEP(*(.jcr*))
-        . = ALIGN(4);
-        /* All data end */
-        __data_end__ = .;
-
-    } > RAM
-
-    .corebss (NOLOAD):
-    {
-        . = ALIGN(4);
-        __corebss_start__ = .;
-        *(.bss.core)
-        . = ALIGN(4);
-        __corebss_end__ = .;
-        *(.corebss*)
-        *(.bss.core.nz)
-        . = ALIGN(4);
-        __ecorebss = .;
-    } > CCM
-
-    .bss :
-    {
-        . = ALIGN(4);
-        __bss_start__ = .;
-        *(.bss*)
-        *(COMMON)
-        . = ALIGN(4);
-        __bss_end__ = .;
-    } > RAM
-
-    __HeapBase = .;
-    __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
-
-    /* .stack_dummy section doesn't contains any symbols. It is only
-     * used for linker to calculate size of stack sections, and assign
-     * values to stack symbols later */
-    .stack_dummy (COPY):
-    {
-        *(.stack*)
-    } > CCM
-
-    /* Set stack top to end of CCM; stack limit is bottom of stack */
-    __StackTop = ORIGIN(CCM) + LENGTH(CCM);
-    __StackLimit = __StackTop - SIZEOF(.stack_dummy);
-    PROVIDE(__stack = __StackTop);
-    
-    /* Check for CCM overflow */
-    ASSERT(__StackLimit >= __ecorebss, "CCM overflow!")
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/bsp/usbmkw41z/boot-mkw41z512.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/usbmkw41z/boot-mkw41z512.ld b/hw/bsp/usbmkw41z/boot-mkw41z512.ld
index 1f74b3d..94d25e7 100644
--- a/hw/bsp/usbmkw41z/boot-mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/boot-mkw41z512.ld
@@ -126,7 +126,7 @@ SECTIONS
         . = ALIGN(4);
     } > RAM
 
-    .data : AT (__etext)
+    .data :
     {
         __data_start__ = .;
         *(vtable)
@@ -157,7 +157,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/usbmkw41z/mkw41z512.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/usbmkw41z/mkw41z512.ld b/hw/bsp/usbmkw41z/mkw41z512.ld
index b6f30b8..f0e63b4 100644
--- a/hw/bsp/usbmkw41z/mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/mkw41z512.ld
@@ -116,7 +116,7 @@ SECTIONS
         . = ALIGN(4);
     } > RAM
 
-    .data : AT (__etext)
+    .data :
     {
         __data_start__ = .;
         *(vtable)
@@ -147,7 +147,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/mcu/nordic/nrf51xxx/nrf51.ld
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/nrf51xxx/nrf51.ld b/hw/mcu/nordic/nrf51xxx/nrf51.ld
index 820510f..415ca92 100755
--- a/hw/mcu/nordic/nrf51xxx/nrf51.ld
+++ b/hw/mcu/nordic/nrf51xxx/nrf51.ld
@@ -109,7 +109,7 @@ SECTIONS
         . = ALIGN(4);
     } > RAM
 
-    .data : AT (__etext)
+    .data :
     {
         __data_start__ = .;
         *(vtable)
@@ -140,7 +140,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/mcu/nordic/nrf52xxx/nrf52.ld
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/nrf52xxx/nrf52.ld b/hw/mcu/nordic/nrf52xxx/nrf52.ld
index fda1a8e..d60421f 100755
--- a/hw/mcu/nordic/nrf52xxx/nrf52.ld
+++ b/hw/mcu/nordic/nrf52xxx/nrf52.ld
@@ -108,7 +108,7 @@ SECTIONS
         . = ALIGN(4);
     } > RAM
 
-    .data : AT (__etext)
+    .data :
     {
         __data_start__ = .;
         *(vtable)
@@ -139,7 +139,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/mcu/stm/stm32f4xx/stm32f401.ld
----------------------------------------------------------------------
diff --git a/hw/mcu/stm/stm32f4xx/stm32f401.ld b/hw/mcu/stm/stm32f4xx/stm32f401.ld
index 3533cfb..f01557e 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f401.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f401.ld
@@ -112,17 +112,17 @@ SECTIONS
         . = ALIGN(4);
     } > RAM
 
-    .coredata : AT (__etext)
+    .coredata :
     {
         __coredata_start__ = .;
         *(.data.core)
         . = ALIGN(4);
         __coredata_end__ = .;
-    } > RAM
+    } > RAM AT > FLASH
 
     __ecoredata = __etext + SIZEOF(.coredata);
 
-    .data : AT (__ecoredata)
+    .data :
     {
         __data_start__ = .;
         *(vtable)
@@ -153,7 +153,7 @@ SECTIONS
         /* All data end */
         __data_end__ = .;
 
-    } > RAM
+    } > RAM AT > FLASH
 
     .corebss (NOLOAD):
     {

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f4f6870/hw/mcu/stm/stm32f4xx/stm32f407.ld
----------------------------------------------------------------------
diff --git a/hw/mcu/stm/stm32f4xx/stm32f407.ld b/hw/mcu/stm/stm32f4xx/stm32f407.ld
index 1d06f76..7d2887a 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f407.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f407.ld
@@ -112,17 +112,17 @@ SECTIONS
         . = ALIGN(4);
     } > RAM
 
-    .coredata : AT (__etext)
+    .coredata :
     {
         __coredata_start__ = .;
         *(.data.core)
         . = ALIGN(4);
         __coredata_end__ = .;
-    } > CCM
+    } > CCM AT > FLASH
 
     __ecoredata = __etext + SIZEOF(.coredata);
 
-    .data : AT (__ecoredata)
+    .data :
     {
         __data_start__ = .;
         *(vtable)
@@ -153,7 +153,7 @@ SECTIONS
         /* All data end */
         __data_end__ = .;
 
-    } > RAM
+    } > RAM AT > FLASH
 
     .corebss (NOLOAD):
     {



[33/50] incubator-mynewt-core git commit: nimble/gap-test: Add unit tests

Posted by vi...@apache.org.
nimble/gap-test: Add unit tests

This patch adds couple of unit test which verifies connection update
parameters


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

Branch: refs/heads/sensors_branch
Commit: 866ef31456c9aa623357dfe39189cdc2f019197b
Parents: a246f52
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Tue Feb 21 13:49:26 2017 +0100
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Tue Feb 21 13:51:23 2017 +0100

----------------------------------------------------------------------
 net/nimble/host/test/src/ble_gap_test.c | 85 ++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/866ef314/net/nimble/host/test/src/ble_gap_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_gap_test.c b/net/nimble/host/test/src/ble_gap_test.c
index 8cdbc11..9dd9dec 100644
--- a/net/nimble/host/test/src/ble_gap_test.c
+++ b/net/nimble/host/test/src/ble_gap_test.c
@@ -1715,6 +1715,23 @@ TEST_SUITE(ble_gap_test_suite_stop_adv)
  *****************************************************************************/
 
 static void
+ble_gap_test_util_update_verify_params(struct ble_gap_upd_params *params,
+                                      uint8_t ble_hs_err)
+{
+    int rc;
+
+    uint8_t peer_addr[6] = { 1, 2, 3, 4, 5, 6 };
+
+    ble_gap_test_util_init();
+
+    ble_hs_test_util_create_conn(2, peer_addr, ble_gap_test_util_connect_cb,
+                                 NULL);
+
+    rc = ble_hs_test_util_conn_update(2, params, 0);
+    TEST_ASSERT(rc == ble_hs_err);
+}
+
+static void
 ble_gap_test_util_update_no_l2cap(struct ble_gap_upd_params *params,
                                   int master,
                                   uint8_t hci_status, int event_status)
@@ -2280,6 +2297,73 @@ TEST_CASE(ble_gap_test_case_update_conn_good)
         1, 0, 0);
 }
 
+TEST_CASE(ble_gap_test_case_update_conn_verify_params)
+{
+    /* GOOD */
+    ble_gap_test_util_update_verify_params(
+        ((struct ble_gap_upd_params[]) { {
+            .itvl_min = 100,
+            .itvl_max = 100,
+            .supervision_timeout = 200,
+            .min_ce_len = 554,
+            .max_ce_len = 554,
+        }}),
+        0);
+
+    /* BAD */
+    ble_gap_test_util_update_verify_params(
+        ((struct ble_gap_upd_params[]) { {
+            .itvl_min = 1,
+            .itvl_max = 100,
+            .supervision_timeout = 200,
+            .min_ce_len = 554,
+            .max_ce_len = 554,
+        }}),
+        BLE_HS_EINVAL);
+
+    ble_gap_test_util_update_verify_params(
+        ((struct ble_gap_upd_params[]) { {
+            .itvl_min = 0x0C80 + 1,
+            .itvl_max = 100,
+            .supervision_timeout = 200,
+            .min_ce_len = 554,
+            .max_ce_len = 554,
+        }}),
+        BLE_HS_EINVAL);
+
+    ble_gap_test_util_update_verify_params(
+        ((struct ble_gap_upd_params[]) { {
+            .itvl_min = 100,
+            .itvl_max = 50,
+            .supervision_timeout = 200,
+            .min_ce_len = 554,
+            .max_ce_len = 554,
+        }}),
+        BLE_HS_EINVAL);
+
+    ble_gap_test_util_update_verify_params(
+        ((struct ble_gap_upd_params[]) { {
+            .itvl_min = 100,
+            .itvl_max = 100,
+            .supervision_timeout = 200,
+            .latency = 0x01F4,
+            .min_ce_len = 554,
+            .max_ce_len = 554,
+        }}),
+        BLE_HS_EINVAL);
+
+    ble_gap_test_util_update_verify_params(
+        ((struct ble_gap_upd_params[]) { {
+            .itvl_min = 100,
+            .itvl_max = 100,
+            .supervision_timeout = 300,
+            .latency = 1,
+            .min_ce_len = 554,
+            .max_ce_len = 554,
+        }}),
+        BLE_HS_EINVAL);
+}
+
 TEST_CASE(ble_gap_test_case_update_conn_bad)
 {
     ble_gap_test_util_update_no_l2cap(
@@ -2555,6 +2639,7 @@ TEST_SUITE(ble_gap_test_suite_update_conn)
     ble_gap_test_case_update_req_reject();
     ble_gap_test_case_update_concurrent_good();
     ble_gap_test_case_update_concurrent_hci_fail();
+    ble_gap_test_case_update_conn_verify_params();
 }
 
 /*****************************************************************************


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 6b55b72c2aa22f7916fab414acc7f4129c98faec
Parents: cfc2314
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 17 13:17:00 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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);


[23/50] incubator-mynewt-core git commit: Add extra hardening checks to FS

Posted by vi...@apache.org.
Add extra hardening checks to FS


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

Branch: refs/heads/sensors_branch
Commit: 0c6d37a89e4b8104f3fe8b74cb9629e86426bf70
Parents: 408caf5
Author: Fabio Utzig <ut...@utzig.org>
Authored: Wed Feb 15 09:56:05 2017 -0800
Committer: Fabio Utzig <ut...@utzig.org>
Committed: Wed Feb 15 09:56:05 2017 -0800

----------------------------------------------------------------------
 fs/fs/src/fs_dirent.c | 3 +--
 fs/fs/src/fs_file.c   | 2 +-
 fs/fs/src/fs_mount.c  | 5 +++++
 fs/fs/src/fsutil.c    | 4 ++--
 fs/nffs/src/nffs.c    | 3 +++
 5 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0c6d37a8/fs/fs/src/fs_dirent.c
----------------------------------------------------------------------
diff --git a/fs/fs/src/fs_dirent.c b/fs/fs/src/fs_dirent.c
index 0216f3b..c9e4636 100644
--- a/fs/fs/src/fs_dirent.c
+++ b/fs/fs/src/fs_dirent.c
@@ -25,8 +25,7 @@ struct fs_ops *fops_from_filename(const char *);
 static struct fs_ops *
 fops_from_dir(const struct fs_dir *dir)
 {
-    /* NOTE: fs_ops must always be the first field for any fs_file */
-    return (struct fs_ops *) *((uint32_t *)dir);
+    return fs_ops_from_container((struct fops_container *) dir);
 }
 
 static inline struct fs_ops *

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0c6d37a8/fs/fs/src/fs_file.c
----------------------------------------------------------------------
diff --git a/fs/fs/src/fs_file.c b/fs/fs/src/fs_file.c
index 305a3c4..cb8d1e6 100644
--- a/fs/fs/src/fs_file.c
+++ b/fs/fs/src/fs_file.c
@@ -117,7 +117,7 @@ fake_dirent_is_dir(const struct fs_dirent *dirent)
     return FS_EUNINIT;
 }
 
-static struct fs_ops not_initialized_ops = {
+struct fs_ops not_initialized_ops = {
     .f_open          = &fake_open,
     .f_close         = &fake_close,
     .f_read          = &fake_read,

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0c6d37a8/fs/fs/src/fs_mount.c
----------------------------------------------------------------------
diff --git a/fs/fs/src/fs_mount.c b/fs/fs/src/fs_mount.c
index 022ea29..2e998c4 100644
--- a/fs/fs/src/fs_mount.c
+++ b/fs/fs/src/fs_mount.c
@@ -91,8 +91,13 @@ fs_ops_for(const char *fs_name)
     return fops;
 }
 
+struct fs_ops not_initialized_ops;
+
 struct fs_ops *
 fs_ops_from_container(struct fops_container *container)
 {
+    if (!container) {
+        return &not_initialized_ops;
+    }
     return container->fops;
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0c6d37a8/fs/fs/src/fsutil.c
----------------------------------------------------------------------
diff --git a/fs/fs/src/fsutil.c b/fs/fs/src/fsutil.c
index 7fb5360..7fc97d1 100644
--- a/fs/fs/src/fsutil.c
+++ b/fs/fs/src/fsutil.c
@@ -28,7 +28,7 @@ fsutil_read_file(const char *path, uint32_t offset, uint32_t len, void *dst,
 
     rc = fs_open(path, FS_ACCESS_READ, &file);
     if (rc != 0) {
-        goto done;
+        return rc;
     }
 
     rc = fs_read(file, len, dst, out_len);
@@ -51,7 +51,7 @@ fsutil_write_file(const char *path, const void *data, uint32_t len)
 
     rc = fs_open(path, FS_ACCESS_WRITE, &file);
     if (rc != 0) {
-        goto done;
+        return rc;
     }
 
     rc = fs_write(file, data, len);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0c6d37a8/fs/nffs/src/nffs.c
----------------------------------------------------------------------
diff --git a/fs/nffs/src/nffs.c b/fs/nffs/src/nffs.c
index 7b5c128..5105ca1 100644
--- a/fs/nffs/src/nffs.c
+++ b/fs/nffs/src/nffs.c
@@ -516,6 +516,9 @@ done:
         free(filepath);
     }
     nffs_unlock();
+    if (rc != 0) {
+        *out_dir = NULL;
+    }
     return rc;
 }
 


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 4ef28aaaa7fc24325a34f17ffe97fa2c9a594595
Parents: c9fdcc0
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 17:37:35 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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
 }


[25/50] incubator-mynewt-core git commit: Fix review issues of fcb_offset_last_n

Posted by vi...@apache.org.
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/sensors_branch
Commit: 925b6bb7e964bf6fbce244596731bf68c975771d
Parents: e0d92a5
Author: Fabio Utzig <ut...@utzig.org>
Authored: Wed Feb 15 15:07:18 2017 -0800
Committer: Fabio Utzig <ut...@utzig.org>
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);


[50/50] incubator-mynewt-core git commit: SensorAPI - Add test app

Posted by vi...@apache.org.
SensorAPI - Add test app

- Add test app: currently is same as Slinky with some more extra code.
- revert slinky now that a seperate app is there


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

Branch: refs/heads/sensors_branch
Commit: 60cd598c8106fac4f318253a08bc0405b49a79a8
Parents: 8d1bde9
Author: Vipul Rahane <vi...@apache.org>
Authored: Thu Feb 23 14:29:58 2017 -0800
Committer: Vipul Rahane <vi...@apache.org>
Committed: Thu Feb 23 14:29:58 2017 -0800

----------------------------------------------------------------------
 apps/sensors_test/pkg.yml    |  51 +++++
 apps/sensors_test/src/main.c | 437 ++++++++++++++++++++++++++++++++++++++
 apps/sensors_test/syscfg.yml |  57 +++++
 apps/slinky/pkg.yml          |   5 -
 apps/slinky/src/main.c       | 143 -------------
 5 files changed, 545 insertions(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/60cd598c/apps/sensors_test/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/sensors_test/pkg.yml b/apps/sensors_test/pkg.yml
new file mode 100644
index 0000000..406ad30
--- /dev/null
+++ b/apps/sensors_test/pkg.yml
@@ -0,0 +1,51 @@
+#
+# 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.
+#
+
+pkg.name: apps/sensors_test
+pkg.type: app
+pkg.description: "Example application which uses a variety of mynewt features."
+pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
+pkg.homepage: "http://mynewt.apache.org/"
+pkg.keywords:
+
+pkg.deps:
+    - test/flash_test
+    - mgmt/imgmgr
+    - mgmt/newtmgr
+    - mgmt/newtmgr/transport/nmgr_shell
+    - kernel/os
+    - hw/sensor
+    - hw/drivers/sensors/sim
+    - hw/drivers/sensors/lsm303dlhc
+    - hw/drivers/sensors/tsl2561
+    - hw/drivers/sensors/bno055
+    - boot/bootutil
+    - sys/shell
+    - sys/config
+    - sys/console/full
+    - sys/id
+    - sys/log/full
+    - sys/stats/full
+    - boot/split
+
+pkg.deps.CONFIG_NFFS:
+    - fs/nffs
+
+pkg.deps.CONFIG_FCB:
+    - fs/fcb

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/60cd598c/apps/sensors_test/src/main.c
----------------------------------------------------------------------
diff --git a/apps/sensors_test/src/main.c b/apps/sensors_test/src/main.c
new file mode 100755
index 0000000..d17c61a
--- /dev/null
+++ b/apps/sensors_test/src/main.c
@@ -0,0 +1,437 @@
+/*
+ * 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.
+ */
+
+#include "syscfg/syscfg.h"
+#include "sysinit/sysinit.h"
+#include "sysflash/sysflash.h"
+#include <os/os.h>
+#include <bsp/bsp.h>
+#include <hal/hal_gpio.h>
+#include <hal/hal_flash.h>
+#include <console/console.h>
+#include <shell/shell.h>
+#include <log/log.h>
+#include <stats/stats.h>
+#include <config/config.h>
+#include <sensor/sensor.h>
+#include <lsm303dlhc/lsm303dlhc.h>
+#include <tsl2561/tsl2561.h>
+#include <bno055/bno055.h>
+#include "flash_map/flash_map.h"
+#include <hal/hal_system.h>
+#if MYNEWT_VAL(SPLIT_LOADER)
+#include "split/split.h"
+#endif
+#include <newtmgr/newtmgr.h>
+#include <bootutil/image.h>
+#include <bootutil/bootutil.h>
+#include <imgmgr/imgmgr.h>
+#include <assert.h>
+#include <string.h>
+#include <flash_test/flash_test.h>
+#include <reboot/log_reboot.h>
+#include <os/os_time.h>
+#include <id/id.h>
+
+#ifdef ARCH_sim
+#include <mcu/mcu_sim.h>
+#endif
+
+/* Task 1 */
+#define TASK1_PRIO (8)
+#define TASK1_STACK_SIZE    OS_STACK_ALIGN(192)
+#define MAX_CBMEM_BUF 600
+static struct os_task task1;
+static volatile int g_task1_loops;
+
+/* Task 2 */
+#define TASK2_PRIO (9)
+#define TASK2_STACK_SIZE    OS_STACK_ALIGN(64)
+static struct os_task task2;
+
+static struct log my_log;
+
+static volatile int g_task2_loops;
+
+/* Global test semaphore */
+static struct os_sem g_test_sem;
+
+/* For LED toggling */
+static int g_led_pin;
+
+STATS_SECT_START(gpio_stats)
+STATS_SECT_ENTRY(toggles)
+STATS_SECT_END
+
+static STATS_SECT_DECL(gpio_stats) g_stats_gpio_toggle;
+
+static STATS_NAME_START(gpio_stats)
+STATS_NAME(gpio_stats, toggles)
+STATS_NAME_END(gpio_stats)
+
+static char *test_conf_get(int argc, char **argv, char *val, int max_len);
+static int test_conf_set(int argc, char **argv, char *val);
+static int test_conf_commit(void);
+static int test_conf_export(void (*export_func)(char *name, char *val),
+  enum conf_export_tgt tgt);
+
+static struct conf_handler test_conf_handler = {
+    .ch_name = "test",
+    .ch_get = test_conf_get,
+    .ch_set = test_conf_set,
+    .ch_commit = test_conf_commit,
+    .ch_export = test_conf_export
+};
+
+static uint8_t test8;
+static uint8_t test8_shadow;
+static char test_str[32];
+static uint32_t cbmem_buf[MAX_CBMEM_BUF];
+static struct cbmem cbmem;
+
+static char *
+test_conf_get(int argc, char **argv, char *buf, int max_len)
+{
+    if (argc == 1) {
+        if (!strcmp(argv[0], "8")) {
+            return conf_str_from_value(CONF_INT8, &test8, buf, max_len);
+        } else if (!strcmp(argv[0], "str")) {
+            return test_str;
+        }
+    }
+    return NULL;
+}
+
+static int
+test_conf_set(int argc, char **argv, char *val)
+{
+    if (argc == 1) {
+        if (!strcmp(argv[0], "8")) {
+            return CONF_VALUE_SET(val, CONF_INT8, test8_shadow);
+        } else if (!strcmp(argv[0], "str")) {
+            return CONF_VALUE_SET(val, CONF_STRING, test_str);
+        }
+    }
+    return OS_ENOENT;
+}
+
+static int
+test_conf_commit(void)
+{
+    test8 = test8_shadow;
+
+    return 0;
+}
+
+static int
+test_conf_export(void (*func)(char *name, char *val), enum conf_export_tgt tgt)
+{
+    char buf[4];
+
+    conf_str_from_value(CONF_INT8, &test8, buf, sizeof(buf));
+    func("test/8", buf);
+    func("test/str", test_str);
+    return 0;
+}
+
+static void
+task1_handler(void *arg)
+{
+    struct os_task *t;
+    int prev_pin_state, curr_pin_state;
+    struct image_version ver;
+
+    /* Set the led pin for the E407 devboard */
+    g_led_pin = LED_BLINK_PIN;
+    hal_gpio_init_out(g_led_pin, 1);
+
+    if (imgr_my_version(&ver) == 0) {
+        console_printf("\nSensors Test %u.%u.%u.%u\n",
+          ver.iv_major, ver.iv_minor, ver.iv_revision,
+          (unsigned int)ver.iv_build_num);
+    } else {
+        console_printf("\nSensors Test\n");
+    }
+
+    while (1) {
+        t = os_sched_get_current_task();
+        assert(t->t_func == task1_handler);
+
+        ++g_task1_loops;
+
+        /* Wait one second */
+        os_time_delay(OS_TICKS_PER_SEC);
+
+        /* Toggle the LED */
+        prev_pin_state = hal_gpio_read(g_led_pin);
+        curr_pin_state = hal_gpio_toggle(g_led_pin);
+        LOG_INFO(&my_log, LOG_MODULE_DEFAULT, "GPIO toggle from %u to %u",
+            prev_pin_state, curr_pin_state);
+        STATS_INC(g_stats_gpio_toggle, toggles);
+
+        /* Release semaphore to task 2 */
+        os_sem_release(&g_test_sem);
+    }
+}
+
+static void
+task2_handler(void *arg)
+{
+    struct os_task *t;
+
+    while (1) {
+        /* just for debug; task 2 should be the running task */
+        t = os_sched_get_current_task();
+        assert(t->t_func == task2_handler);
+
+        /* Increment # of times we went through task loop */
+        ++g_task2_loops;
+
+        /* Wait for semaphore from ISR */
+        os_sem_pend(&g_test_sem, OS_TIMEOUT_NEVER);
+    }
+}
+
+/**
+ * init_tasks
+ *
+ * Called by main.c after sysinit(). This function performs initializations
+ * that are required before tasks are running.
+ *
+ * @return int 0 success; error otherwise.
+ */
+static void
+init_tasks(void)
+{
+    os_stack_t *pstack;
+
+    /* Initialize global test semaphore */
+    os_sem_init(&g_test_sem, 0);
+
+    pstack = malloc(sizeof(os_stack_t)*TASK1_STACK_SIZE);
+    assert(pstack);
+
+    os_task_init(&task1, "task1", task1_handler, NULL,
+            TASK1_PRIO, OS_WAIT_FOREVER, pstack, TASK1_STACK_SIZE);
+
+    pstack = malloc(sizeof(os_stack_t)*TASK2_STACK_SIZE);
+    assert(pstack);
+
+    os_task_init(&task2, "task2", task2_handler, NULL,
+            TASK2_PRIO, OS_WAIT_FOREVER, pstack, TASK2_STACK_SIZE);
+}
+
+#if !ARCH_sim
+static int
+config_sensor(void)
+{
+    struct os_dev *dev;
+    int rc;
+
+#if MYNEWT_VAL(TSL2561_PRESENT)
+    struct tsl2561_cfg tslcfg;
+
+    dev = (struct os_dev *) os_dev_open("light0", OS_TIMEOUT_NEVER, NULL);
+    assert(dev != NULL);
+    rc = tsl2561_init(dev, NULL);
+    if (rc) {
+        os_dev_close(dev);
+        goto err;
+    }
+
+    /* Gain set to 1X and Inetgration time set to 13ms */
+    tslcfg.gain = TSL2561_LIGHT_GAIN_1X;
+    tslcfg.integration_time = TSL2561_LIGHT_ITIME_13MS;
+
+    rc = tsl2561_config((struct tsl2561 *)dev, &tslcfg);
+    if (rc) {
+        os_dev_close(dev);
+        goto err;
+    }
+    os_dev_close(dev);
+#endif
+
+#if MYNEWT_VAL(LSM303DLHC_PRESENT)
+    struct lsm303dlhc_cfg lsmcfg;
+
+    dev = (struct os_dev *) os_dev_open("accel0", OS_TIMEOUT_NEVER, NULL);
+    assert(dev != NULL);
+
+    rc = lsm303dlhc_init(dev, NULL);
+    if (rc) {
+        os_dev_close(dev);
+        goto err;
+    }
+
+    /* read once per sec.  API should take this value in ms. */
+    lsmcfg.accel_rate = LSM303DLHC_ACCEL_RATE_1;
+    lsmcfg.accel_range = LSM303DLHC_ACCEL_RANGE_2;
+
+    rc = lsm303dlhc_config((struct lsm303dlhc *) dev, &lsmcfg);
+    if (rc) {
+        os_dev_close(dev);
+        goto err;
+    }
+    os_dev_close(dev);
+#endif
+
+#if MYNEWT_VAL(BNO055_PRESENT)
+    struct bno055_cfg bcfg;
+
+    dev = (struct os_dev *) os_dev_open("accel1", OS_TIMEOUT_NEVER, NULL);
+    assert(dev != NULL);
+
+    rc = bno055_init(dev, NULL);
+    if (rc) {
+        os_dev_close(dev);
+        assert(0);
+        goto err;
+    }
+
+    bcfg.bc_units = BNO055_ACC_UNIT_MS2   | BNO055_ANGRATE_UNIT_DPS |
+                  BNO055_EULER_UNIT_DEG | BNO055_TEMP_UNIT_DEGC   |
+                  BNO055_DO_FORMAT_ANDROID;
+
+    bcfg.bc_opr_mode = BNO055_OPR_MODE_ACCONLY;
+
+    bcfg.bc_pwr_mode = BNO055_PWR_MODE_NORMAL;
+
+    rc = bno055_config((struct bno055 *) dev, &bcfg);
+    if (rc) {
+        os_dev_close(dev);
+        goto err;
+    }
+    os_dev_close(dev);
+#endif
+
+    return (0);
+err:
+    return rc;
+}
+
+#endif
+
+#ifdef ARCH_sim
+static int
+config_sensor(void)
+{
+    struct os_dev *dev;
+    struct cfg;
+    int rc;
+
+    dev = (struct os_dev *) os_dev_open("simaccel0", OS_TIMEOUT_NEVER, NULL);
+    assert(dev != NULL);
+
+    rc = sim_accel_init(dev, NULL);
+    if (rc != 0) {
+        os_dev_close(dev);
+        goto err;
+    }
+
+    cfg.sac_nr_samples = 10;
+    cfg.sac_nr_axises = 1;
+    /* read once per sec.  API should take this value in ms. */
+    cfg.sac_sample_itvl = OS_TICKS_PER_SEC;
+
+    rc = sim_accel_config((struct sim_accel *) dev, &cfg);
+    if (rc != 0) {
+        os_dev_close(dev);
+        goto err;
+    }
+
+    os_dev_close(dev);
+
+    return (0);
+err:
+    return (rc);
+}
+#endif
+
+/**
+ * main
+ *
+ * The main task for the project. This function initializes the packages, calls
+ * init_tasks to initialize additional tasks (and possibly other objects),
+ * then starts serving events from default event queue.
+ *
+ * @return int NOTE: this function should never return!
+ */
+int
+main(int argc, char **argv)
+{
+    int rc;
+
+#ifdef ARCH_sim
+    mcu_sim_parse_args(argc, argv);
+#endif
+
+    sysinit();
+
+    rc = conf_register(&test_conf_handler);
+    assert(rc == 0);
+
+    cbmem_init(&cbmem, cbmem_buf, MAX_CBMEM_BUF);
+    log_register("log", &my_log, &log_cbmem_handler, &cbmem, LOG_SYSLEVEL);
+
+    stats_init(STATS_HDR(g_stats_gpio_toggle),
+               STATS_SIZE_INIT_PARMS(g_stats_gpio_toggle, STATS_SIZE_32),
+               STATS_NAME_INIT_PARMS(gpio_stats));
+
+    stats_register("gpio_toggle", STATS_HDR(g_stats_gpio_toggle));
+
+    flash_test_init();
+
+    conf_load();
+
+    log_reboot(hal_reset_cause());
+
+    init_tasks();
+
+    /* If this app is acting as the loader in a split image setup, jump into
+     * the second stage application instead of starting the OS.
+     */
+#if MYNEWT_VAL(SPLIT_LOADER)
+    {
+        void *entry;
+        rc = split_app_go(&entry, true);
+        if(rc == 0) {
+            hal_system_restart(entry);
+        }
+    }
+#endif
+
+#if MYNEWT_VAL(TSL2561_CLI)
+    tsl2561_shell_init();
+#endif
+
+#if MYNEWT_VAL(BNO055_CLI)
+    bno055_shell_init();
+#endif
+
+    config_sensor();
+
+    /*
+     * As the last thing, process events from default event queue.
+     */
+    while (1) {
+        os_eventq_run(os_eventq_dflt_get());
+    }
+
+    return (0);
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/60cd598c/apps/sensors_test/syscfg.yml
----------------------------------------------------------------------
diff --git a/apps/sensors_test/syscfg.yml b/apps/sensors_test/syscfg.yml
new file mode 100644
index 0000000..5507f28
--- /dev/null
+++ b/apps/sensors_test/syscfg.yml
@@ -0,0 +1,57 @@
+# 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.
+#
+
+# Package: apps/sensors_test
+
+syscfg.vals:
+    # Enable the shell task.
+    SHELL_TASK: 1
+
+    # Include names for statistics.
+    STATS_NAMES: 1
+
+    # Log reboot messages to a flash circular buffer.
+    REBOOT_LOG_FCB: 1
+    LOG_FCB: 1
+
+    CONFIG_FCB: 1
+
+    # Enable shell commands.
+    STATS_CLI: 1
+    LOG_CLI: 1
+    CONFIG_CLI: 1
+
+    # Enable newtmgr commands.
+    STATS_NEWTMGR: 1
+    LOG_NEWTMGR: 1
+    CONFIG_NEWTMGR: 1
+
+    TSL2561_CLI: 1
+    BNO055_CLI: 1
+
+syscfg.defs:
+    TSL2561_PRESENT:
+        description: 'TSL2561 is present'
+        value : 1
+    LSM303DLHC_PRESENT:
+        description: 'LSM303 is present'
+        value : 1
+    BNO055_PRESENT:
+        description: 'BNO055 is present'
+        value : 1
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/60cd598c/apps/slinky/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/slinky/pkg.yml b/apps/slinky/pkg.yml
index db9cc10..3159cb9 100644
--- a/apps/slinky/pkg.yml
+++ b/apps/slinky/pkg.yml
@@ -30,11 +30,6 @@ pkg.deps:
     - mgmt/newtmgr
     - mgmt/newtmgr/transport/nmgr_shell
     - kernel/os
-    - hw/sensor
-    - hw/drivers/sensors/sim
-    - hw/drivers/sensors/lsm303dlhc
-    - hw/drivers/sensors/tsl2561
-    - hw/drivers/sensors/bno055
     - boot/bootutil
     - sys/shell
     - sys/config

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/60cd598c/apps/slinky/src/main.c
----------------------------------------------------------------------
diff --git a/apps/slinky/src/main.c b/apps/slinky/src/main.c
index 0abdcc6..7ab13d6 100755
--- a/apps/slinky/src/main.c
+++ b/apps/slinky/src/main.c
@@ -29,10 +29,6 @@
 #include <log/log.h>
 #include <stats/stats.h>
 #include <config/config.h>
-#include <sensor/sensor.h>
-#include <lsm303dlhc/lsm303dlhc.h>
-#include <tsl2561/tsl2561.h>
-#include <bno055/bno055.h>
 #include "flash_map/flash_map.h"
 #include <hal/hal_system.h>
 #if MYNEWT_VAL(SPLIT_LOADER)
@@ -237,133 +233,6 @@ init_tasks(void)
             TASK2_PRIO, OS_WAIT_FOREVER, pstack, TASK2_STACK_SIZE);
 }
 
-#if !ARCH_sim
-static int
-config_sensor(void)
-{
-    struct os_dev *dev;
-    int rc;
-
-#if MYNEWT_VAL(TSL2561_PRESENT)
-    struct tsl2561_cfg tslcfg;
-
-    dev = (struct os_dev *) os_dev_open("light0", OS_TIMEOUT_NEVER, NULL);
-    assert(dev != NULL);
-    rc = tsl2561_init(dev, NULL);
-    if (rc) {
-        os_dev_close(dev);
-        goto err;
-    }
-
-    /* Gain set to 1X and Inetgration time set to 13ms */
-    tslcfg.gain = TSL2561_LIGHT_GAIN_1X;
-    tslcfg.integration_time = TSL2561_LIGHT_ITIME_13MS;
-
-    rc = tsl2561_config((struct tsl2561 *)dev, &tslcfg);
-    if (rc) {
-        os_dev_close(dev);
-        goto err;
-    }
-    os_dev_close(dev);
-#endif
-
-#if MYNEWT_VAL(LSM303DLHC_PRESENT)
-    struct lsm303dlhc_cfg lsmcfg;
-
-    dev = (struct os_dev *) os_dev_open("accel0", OS_TIMEOUT_NEVER, NULL);
-    assert(dev != NULL);
-
-    rc = lsm303dlhc_init(dev, NULL);
-    if (rc) {
-        os_dev_close(dev);
-        goto err;
-    }
-
-    /* read once per sec.  API should take this value in ms. */
-    lsmcfg.accel_rate = LSM303DLHC_ACCEL_RATE_1;
-    lsmcfg.accel_range = LSM303DLHC_ACCEL_RANGE_2;
-
-    rc = lsm303dlhc_config((struct lsm303dlhc *) dev, &lsmcfg);
-    if (rc) {
-        os_dev_close(dev);
-        goto err;
-    }
-    os_dev_close(dev);
-#endif
-
-#if MYNEWT_VAL(BNO055_PRESENT)
-    struct bno055_cfg bcfg;
-
-    dev = (struct os_dev *) os_dev_open("accel1", OS_TIMEOUT_NEVER, NULL);
-    assert(dev != NULL);
-
-    rc = bno055_init(dev, NULL);
-    if (rc) {
-        os_dev_close(dev);
-        assert(0);
-        goto err;
-    }
-
-    bcfg.bc_units = BNO055_ACC_UNIT_MS2   | BNO055_ANGRATE_UNIT_DPS |
-                  BNO055_EULER_UNIT_DEG | BNO055_TEMP_UNIT_DEGC   |
-                  BNO055_DO_FORMAT_ANDROID;
-
-    bcfg.bc_opr_mode = BNO055_OPR_MODE_ACCONLY;
-
-    bcfg.bc_pwr_mode = BNO055_PWR_MODE_NORMAL;
-
-    rc = bno055_config((struct bno055 *) dev, &bcfg);
-    if (rc) {
-        os_dev_close(dev);
-        //assert(0);
-        goto err;
-    }
-    os_dev_close(dev);
-#endif
-
-    return (0);
-err:
-    return rc;
-}
-
-#endif
-
-#ifdef ARCH_sim
-static int
-config_sensor(void)
-{
-    struct os_dev *dev;
-    struct cfg;
-    int rc;
-
-    dev = (struct os_dev *) os_dev_open("simaccel0", OS_TIMEOUT_NEVER, NULL);
-    assert(dev != NULL);
-
-    rc = sim_accel_init(dev, NULL);
-    if (rc != 0) {
-        os_dev_close(dev);
-        goto err;
-    }
-
-    cfg.sac_nr_samples = 10;
-    cfg.sac_nr_axises = 1;
-    /* read once per sec.  API should take this value in ms. */
-    cfg.sac_sample_itvl = OS_TICKS_PER_SEC;
-
-    rc = sim_accel_config((struct sim_accel *) dev, &cfg);
-    if (rc != 0) {
-        os_dev_close(dev);
-        goto err;
-    }
-
-    os_dev_close(dev);
-
-    return (0);
-err:
-    return (rc);
-}
-#endif
-
 /**
  * main
  *
@@ -417,22 +286,10 @@ main(int argc, char **argv)
     }
 #endif
 
-#if MYNEWT_VAL(TSL2561_CLI)
-    tsl2561_shell_init();
-#endif
-
-#if MYNEWT_VAL(BNO055_CLI)
-    bno055_shell_init();
-#endif
-
-    config_sensor();
-
     /*
      * As the last thing, process events from default event queue.
      */
     while (1) {
         os_eventq_run(os_eventq_dflt_get());
     }
-
-    return (0);
 }


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: bca362caaf5e48ce4a5cb4d5a00dc601338de8ec
Parents: 4b7bd19
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 14:52:51 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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 };
 


[04/50] 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.

Posted by vi...@apache.org.
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/sensors_branch
Commit: 35b0a91b195a29c31523ef5cb1d2da3431c2937b
Parents: 0f880ef
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 9 16:00:05 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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,


[34/50] incubator-mynewt-core git commit: This closes #177.

Posted by vi...@apache.org.
This closes #177.

Merge remote-tracking branch 'rymanluk/gap_fix' into develop

* rymanluk/gap_fix:
  nimble/gap-test: Add unit tests
  nimble/gap: Fix validation of conn parameters


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

Branch: refs/heads/sensors_branch
Commit: b9675682c948064491e0e4ccfee81bd4dc6513be
Parents: 47166e2 866ef31
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Feb 21 09:12:17 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Feb 21 09:12:17 2017 -0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_gap.c             |   2 +-
 net/nimble/host/test/src/ble_gap_test.c   | 137 ++++++++++++++++++++-----
 net/nimble/host/test/src/ble_l2cap_test.c |   4 +-
 3 files changed, 114 insertions(+), 29 deletions(-)
----------------------------------------------------------------------



[29/50] incubator-mynewt-core git commit: MYNEWT-632; uart1 pin <-> syscfg reversed.

Posted by vi...@apache.org.
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/sensors_branch
Commit: 868f79dfaf7b25eeb5e740dde82cab2c830b59e0
Parents: 6b55b72
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 17 16:20:30 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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 = 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


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: d2321704587ec6e97dc7cb97fd007e65534f0de6
Parents: bca362c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 15:21:04 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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: 30000
     MSYS_1_BLOCK_COUNT:
-        description: 'TBD'
+        description: '1st system pool of mbufs; number of entries'
         value: 12
     MSYS_1_BLOCK_SIZE:
-        description: 'TBD'
+        description: '1st system pool of mbufs; size of an entry'
         value: 292
     MSYS_2_BLOCK_COUNT:
-        description: 'TBD'
+        description: '2nd system pool of mbufs; number of entries'
         value: 0
     MSYS_2_BLOCK_SIZE:
-        description: 'TBD'
+        description: '2nd system pool of mbufs; size of an entry'
         value: 0
     MSYS_3_BLOCK_COUNT:
-        description: 'TBD'
+        description: '3rd system pool of mbufs; number of entries'
         value: 0
     MSYS_3_BLOCK_SIZE:
-        description: 'TBD'
+        description: '3rd system pool of mbufs; size of an entry'
         value: 0
     MSYS_4_BLOCK_COUNT:
-        description: 'TBD'
+        description: '4th system pool of mbufs; number of entries'
         value: 0
     MSYS_4_BLOCK_SIZE:
-        description: 'TBD'
+        description: '4th system pool of mbufs; size of an entry'
         value: 0
     MSYS_5_BLOCK_COUNT:
-        description: 'TBD'
+        description: '5th system pool of mbufs; number of entries'
         value: 0
     MSYS_5_BLOCK_SIZE:
-        description: 'TBD'
+        description: '5th system pool of mbufs; size of an entry'
         value: 0

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/mgmt/imgmgr/syscfg.yml
----------------------------------------------------------------------
diff --git a/mgmt/imgmgr/syscfg.yml b/mgmt/imgmgr/syscfg.yml
index 8a687af..da42801 100644
--- a/mgmt/imgmgr/syscfg.yml
+++ b/mgmt/imgmgr/syscfg.yml
@@ -19,14 +19,11 @@
 # Package: mgmt/imgmgr
 
 syscfg.defs:
-    IMGMGR_FS:
-        description: 'TBD'
-        value: 0
     IMGMGR_COREDUMP:
-        description: 'TBD'
+        description: 'Newtmgr commands for fetching/erasing coredump'
         value: 0
     IMGMGR_CLI:
-        description: 'TBD'
+        description: 'CLI commands to interact with image management'
         value: 0
         restrictions:
             - SHELL_TASK

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/net/wifi/wifi_mgmt/syscfg.yml
----------------------------------------------------------------------
diff --git a/net/wifi/wifi_mgmt/syscfg.yml b/net/wifi/wifi_mgmt/syscfg.yml
index c0916fc..089c029 100644
--- a/net/wifi/wifi_mgmt/syscfg.yml
+++ b/net/wifi/wifi_mgmt/syscfg.yml
@@ -20,7 +20,7 @@
 
 syscfg.defs:
     WIFI_MGMT_CLI:
-        description: 'TBD'
+        description: 'CLI for interacting with Wi-Fi interfaces'
         value: 0
         restrictions:
             - SHELL_TASK

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/test/crash_test/syscfg.yml
----------------------------------------------------------------------
diff --git a/test/crash_test/syscfg.yml b/test/crash_test/syscfg.yml
index 0c41e5e..9074307 100644
--- a/test/crash_test/syscfg.yml
+++ b/test/crash_test/syscfg.yml
@@ -19,10 +19,10 @@
 
 syscfg.defs:
     CRASH_TEST_CLI:
-        description: 'TBD'
+        description: 'CLI for trying out crashes'
         value: 1
         restrictions:
             - SHELL_TASK
     CRASH_TEST_NEWTMGR:
-        description: 'TBD'
+        description: 'Newtmgr commands for crashing'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d2321704/test/runtest/syscfg.yml
----------------------------------------------------------------------
diff --git a/test/runtest/syscfg.yml b/test/runtest/syscfg.yml
index f9bad84..c085f7d 100644
--- a/test/runtest/syscfg.yml
+++ b/test/runtest/syscfg.yml
@@ -20,10 +20,10 @@
 
 syscfg.defs:
     RUNTEST_CLI:
-        description: 'TBD'
+        description: 'CLI commands for accessing tests'
         value: 1
         restrictions:
             - SHELL_TASK
     RUNTEST_NEWTMGR:
-        description: 'TBD'
+        description: 'Newtmgr command to execute tests'
         value: 1


[47/50] incubator-mynewt-core git commit: MYNEWT-629: Unexpected advertising state machine stop.

Posted by vi...@apache.org.
MYNEWT-629: Unexpected advertising state machine stop.

This commit should fix the bug where an advertising state machine that
was not expected to be stopped could be stopped when a different
state machine was stopped through the hci advertising enable command.

This change does affect both MULTI_ADV_SUPPORT and normal 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/1449ffcd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1449ffcd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1449ffcd

Branch: refs/heads/sensors_branch
Commit: 1449ffcdbac75131f98f933036696427bbc3b57a
Parents: 4ef28aa
Author: William San Filippo <wi...@runtime.io>
Authored: Wed Feb 22 09:36:20 2017 -0800
Committer: William San Filippo <wi...@runtime.io>
Committed: Wed Feb 22 09:38:25 2017 -0800

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll_adv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1449ffcd/net/nimble/controller/src/ble_ll_adv.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_adv.c b/net/nimble/controller/src/ble_ll_adv.c
index 077ca5a..1130638 100644
--- a/net/nimble/controller/src/ble_ll_adv.c
+++ b/net/nimble/controller/src/ble_ll_adv.c
@@ -739,11 +739,21 @@ ble_ll_adv_sm_stop(struct ble_ll_adv_sm *advsm)
 
         /* Set to standby if we are no longer advertising */
         OS_ENTER_CRITICAL(sr);
+#if MYNEWT_VAL(BLE_MULTI_ADV_SUPPORT)
+        if (g_ble_ll_cur_adv_sm == advsm) {
+            ble_phy_disable();
+            ble_ll_wfr_disable();
+            ble_ll_state_set(BLE_LL_STATE_STANDBY);
+            g_ble_ll_cur_adv_sm = NULL;
+        }
+#else
         if (ble_ll_state_get() == BLE_LL_STATE_ADV) {
             ble_phy_disable();
             ble_ll_wfr_disable();
             ble_ll_state_set(BLE_LL_STATE_STANDBY);
+            g_ble_ll_cur_adv_sm = NULL;
         }
+#endif
         OS_EXIT_CRITICAL(sr);
 
         os_eventq_remove(&g_ble_ll_data.ll_evq, &advsm->adv_txdone_ev);


[12/50] incubator-mynewt-core git commit: MYNEWT-335

Posted by vi...@apache.org.
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/sensors_branch
Commit: e0d92a5d34849310e0ddbb2179c3d960cf15cc91
Parents: d61c6cd
Author: Fabio Utzig <ut...@utzig.org>
Authored: Fri Feb 10 17:50:44 2017 -0800
Committer: Fabio Utzig <ut...@utzig.org>
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 0000000..deebe54
--- /dev/null
+++ b/fs/fcb/test/src/testcases/fcb_test_last_of_n.c
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+#include "fcb_test.h"
+
+TEST_CASE(fcb_test_last_of_n)
+{
+    const uint8_t ENTRIES = 5;
+    struct fcb *fcb;
+    int rc;
+    struct fcb_entry loc;
+    struct fcb_entry areas[ENTRIES];
+    uint8_t test_data[128];
+    uint8_t i;
+
+    fcb = &test_fcb;
+    fcb->f_scratch_cnt = 1;
+
+    /*
+     * Add some fcbs.
+     */
+    for (i = 0; i < ENTRIES; i++) {
+        rc = fcb_append(fcb, sizeof(test_data), &loc);
+        if (rc == FCB_ERR_NOSPACE) {
+            break;
+        }
+
+        rc = flash_area_write(loc.fe_area, loc.fe_data_off, test_data,
+          sizeof(test_data));
+        TEST_ASSERT(rc == 0);
+
+        rc = fcb_append_finish(fcb, &loc);
+        TEST_ASSERT(rc == 0);
+
+        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);
+    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);
+    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);
+    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);
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e0d92a5d/sys/log/full/src/log_fcb.c
----------------------------------------------------------------------
diff --git a/sys/log/full/src/log_fcb.c b/sys/log/full/src/log_fcb.c
index ea104d4..ed1f502 100644
--- a/sys/log/full/src/log_fcb.c
+++ b/sys/log/full/src/log_fcb.c
@@ -218,11 +218,10 @@ log_fcb_rtr_erase(struct log *log, void *arg)
     struct fcb fcb_scratch;
     struct fcb *fcb;
     const struct flash_area *ptr;
-    uint32_t offset;
+    struct fcb_entry entry;
     int rc;
 
     rc = 0;
-    offset = 0;
     if (!log) {
         rc = -1;
         goto err;
@@ -249,13 +248,13 @@ log_fcb_rtr_erase(struct log *log, void *arg)
     }
 
     /* Calculate offset of n-th last entry */
-    rc = fcb_offset_last_n(fcb, fcb_log->fl_entries, &offset);
+    rc = fcb_offset_last_n(fcb, fcb_log->fl_entries, &entry);
     if (rc) {
         goto err;
     }
 
     /* Copy to scratch */
-    rc = log_fcb_copy(log, fcb, &fcb_scratch, offset);
+    rc = log_fcb_copy(log, fcb, &fcb_scratch, entry.fe_elem_off);
     if (rc) {
         goto err;
     }


[49/50] incubator-mynewt-core git commit: SensorAPI - os_eventq_ensure() has been deprecated

Posted by vi...@apache.org.
SensorAPI - os_eventq_ensure() has been deprecated


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

Branch: refs/heads/sensors_branch
Commit: 8d1bde984ae2043fd8c2d03df955b3cd858d882c
Parents: d21ef0f
Author: Vipul Rahane <vi...@apache.org>
Authored: Thu Feb 23 13:51:25 2017 -0800
Committer: Vipul Rahane <vi...@apache.org>
Committed: Thu Feb 23 13:51:25 2017 -0800

----------------------------------------------------------------------
 hw/sensor/src/sensor.c | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/8d1bde98/hw/sensor/src/sensor.c
----------------------------------------------------------------------
diff --git a/hw/sensor/src/sensor.c b/hw/sensor/src/sensor.c
index 102c0fe..89a19df 100644
--- a/hw/sensor/src/sensor.c
+++ b/hw/sensor/src/sensor.c
@@ -234,8 +234,6 @@ done:
 struct os_eventq *
 sensor_mgr_evq_get(void)
 {
-    os_eventq_ensure(&sensor_mgr.mgr_eventq, NULL);
-
     return (sensor_mgr.mgr_eventq);
 }
 


[22/50] incubator-mynewt-core git commit: MYNEWT-627 BLE Host - Join rx frags into 1 mbuf

Posted by vi...@apache.org.
MYNEWT-627 BLE Host - Join rx frags into 1 mbuf


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

Branch: refs/heads/sensors_branch
Commit: 408caf5c0f7fd5e77846ede3df37954fa7a859ad
Parents: 4f5dd65
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Feb 14 12:30:26 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Feb 14 12:30:26 2017 -0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_l2cap.c | 26 +++++++++++++++++++++++++-
 net/nimble/host/syscfg.yml      |  7 +++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/408caf5c/net/nimble/host/src/ble_l2cap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap.c b/net/nimble/host/src/ble_l2cap.c
index 2fb48b6..2b60a30 100644
--- a/net/nimble/host/src/ble_l2cap.c
+++ b/net/nimble/host/src/ble_l2cap.c
@@ -173,6 +173,28 @@ ble_l2cap_discard_rx(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan)
     ble_l2cap_forget_rx(conn, chan);
 }
 
+static void
+ble_l2cap_append_rx(struct ble_l2cap_chan *chan, struct os_mbuf *frag)
+{
+    int rc;
+
+    (void)rc;
+
+#if MYNEWT_VAL(BLE_L2CAP_JOIN_RX_FRAGS)
+    /* Copy the data from the incoming fragment into the packet in progress. */
+    rc = os_mbuf_appendfrom(chan->rx_buf, frag, 0, OS_MBUF_PKTLEN(frag));
+    if (rc == 0) {
+        os_mbuf_free_chain(frag);
+        return;
+    }
+#endif
+
+    /* Join disabled or append failed due to mbuf shortage.  Just attach the
+     * mbuf to the end of the packet.
+     */
+    os_mbuf_concat(chan->rx_buf, frag);
+}
+
 static int
 ble_l2cap_rx_payload(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan,
                      struct os_mbuf *om,
@@ -182,9 +204,11 @@ ble_l2cap_rx_payload(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan,
     int rc;
 
     if (chan->rx_buf == NULL) {
+        /* First fragment in packet. */
         chan->rx_buf = om;
     } else {
-        os_mbuf_concat(chan->rx_buf, om);
+        /* Continuation of packet in progress. */
+        ble_l2cap_append_rx(chan, om);
     }
 
     /* Determine if packet is fully reassembled. */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/408caf5c/net/nimble/host/syscfg.yml
----------------------------------------------------------------------
diff --git a/net/nimble/host/syscfg.yml b/net/nimble/host/syscfg.yml
index dd42ed8..be9d953 100644
--- a/net/nimble/host/syscfg.yml
+++ b/net/nimble/host/syscfg.yml
@@ -46,6 +46,13 @@ syscfg.defs:
     BLE_L2CAP_SIG_MAX_PROCS:
         description: 'TBD'
         value: 1
+    BLE_L2CAP_JOIN_RX_FRAGS:
+        description: >
+            Whether to collapse incoming L2CAP fragments into a minimal set of
+            mbufs.
+                1: Slower, more memory efficient.
+                0: Faster, less memory efficient.
+        value: 1
     BLE_L2CAP_RX_FRAG_TIMEOUT:
         description: >
             Expiry time for incoming data packets (ms).  If this much time


[32/50] incubator-mynewt-core git commit: nimble/gap: Fix validation of conn parameters

Posted by vi...@apache.org.
nimble/gap: Fix validation of conn parameters

This fix obvious incorrect check for parameter validation.

Note, with this patch we finaly start check for requirements on
supervision timeout, that's why test script update was needed.


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

Branch: refs/heads/sensors_branch
Commit: a246f526267bc81199e57a22535b5d3f0173a660
Parents: 47166e2
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Tue Feb 14 05:58:42 2017 +0100
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Mon Feb 20 23:27:31 2017 +0100

----------------------------------------------------------------------
 net/nimble/host/src/ble_gap.c             |  2 +-
 net/nimble/host/test/src/ble_gap_test.c   | 52 +++++++++++++-------------
 net/nimble/host/test/src/ble_l2cap_test.c |  4 +-
 3 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a246f526/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index c85ff62..22462b4 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -2868,7 +2868,7 @@ ble_gap_update_params(uint16_t conn_handle,
     int rc;
 
     /* Validate parameters with a spec */
-    if (ble_gap_validate_conn_params(params)) {
+    if (!ble_gap_validate_conn_params(params)) {
             return BLE_HS_EINVAL;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a246f526/net/nimble/host/test/src/ble_gap_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_gap_test.c b/net/nimble/host/test/src/ble_gap_test.c
index a13255e..8cdbc11 100644
--- a/net/nimble/host/test/src/ble_gap_test.c
+++ b/net/nimble/host/test/src/ble_gap_test.c
@@ -2263,7 +2263,7 @@ TEST_CASE(ble_gap_test_case_update_conn_good)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
@@ -2273,7 +2273,7 @@ TEST_CASE(ble_gap_test_case_update_conn_good)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 100,
             .itvl_max = 100,
-            .supervision_timeout = 100,
+            .supervision_timeout = 200,
             .min_ce_len = 554,
             .max_ce_len = 554,
         }}),
@@ -2286,7 +2286,7 @@ TEST_CASE(ble_gap_test_case_update_conn_bad)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
@@ -2299,7 +2299,7 @@ TEST_CASE(ble_gap_test_case_update_conn_hci_fail)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
@@ -2311,7 +2311,7 @@ TEST_CASE(ble_gap_test_case_update_conn_l2cap)
     struct ble_gap_upd_params params = {
         .itvl_min = 10,
         .itvl_max = 100,
-        .supervision_timeout = 0,
+        .supervision_timeout = 200,
         .min_ce_len = 123,
         .max_ce_len = 456,
     };
@@ -2365,14 +2365,14 @@ TEST_CASE(ble_gap_test_case_update_req_good)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
@@ -2382,14 +2382,14 @@ TEST_CASE(ble_gap_test_case_update_req_good)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 100,
             .itvl_max = 100,
-            .supervision_timeout = 100,
+            .supervision_timeout = 200,
             .min_ce_len = 554,
             .max_ce_len = 554,
         }}),
@@ -2402,14 +2402,14 @@ TEST_CASE(ble_gap_test_case_update_req_hci_fail)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
@@ -2422,7 +2422,7 @@ TEST_CASE(ble_gap_test_case_update_req_reject)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
@@ -2432,7 +2432,7 @@ TEST_CASE(ble_gap_test_case_update_req_reject)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
@@ -2445,21 +2445,21 @@ TEST_CASE(ble_gap_test_case_update_concurrent_good)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
@@ -2469,21 +2469,21 @@ TEST_CASE(ble_gap_test_case_update_concurrent_good)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 20,
             .itvl_max = 200,
-            .supervision_timeout = 2,
+            .supervision_timeout = 350,
             .min_ce_len = 111,
             .max_ce_len = 222,
         }}),
@@ -2496,21 +2496,21 @@ TEST_CASE(ble_gap_test_case_update_concurrent_hci_fail)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 20,
             .itvl_max = 200,
-            .supervision_timeout = 2,
+            .supervision_timeout = 350,
             .min_ce_len = 111,
             .max_ce_len = 222,
         }}),
@@ -2520,21 +2520,21 @@ TEST_CASE(ble_gap_test_case_update_concurrent_hci_fail)
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 10,
             .itvl_max = 100,
-            .supervision_timeout = 0,
+            .supervision_timeout = 200,
             .min_ce_len = 123,
             .max_ce_len = 456,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 50,
             .itvl_max = 500,
-            .supervision_timeout = 20,
+            .supervision_timeout = 800,
             .min_ce_len = 555,
             .max_ce_len = 888,
         }}),
         ((struct ble_gap_upd_params[]) { {
             .itvl_min = 20,
             .itvl_max = 200,
-            .supervision_timeout = 2,
+            .supervision_timeout = 350,
             .min_ce_len = 111,
             .max_ce_len = 222,
         }}),
@@ -2711,7 +2711,7 @@ TEST_CASE(ble_gap_test_case_update_timeout)
     struct ble_gap_upd_params params = {
         .itvl_min = 10,
         .itvl_max = 100,
-        .supervision_timeout = 0,
+        .supervision_timeout = 200,
         .min_ce_len = 123,
         .max_ce_len = 456,
     };

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a246f526/net/nimble/host/test/src/ble_l2cap_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_l2cap_test.c b/net/nimble/host/test/src/ble_l2cap_test.c
index dc1c373..7c60aa9 100644
--- a/net/nimble/host/test/src/ble_l2cap_test.c
+++ b/net/nimble/host/test/src/ble_l2cap_test.c
@@ -474,7 +474,7 @@ ble_l2cap_test_util_peer_updates(int accept)
     l2cap_params.itvl_min = 0x200;
     l2cap_params.itvl_max = 0x300;
     l2cap_params.slave_latency = 0;
-    l2cap_params.timeout_multiplier = 0x100;
+    l2cap_params.timeout_multiplier = 0x500;
     ble_l2cap_test_util_rx_update_req(2, 1, &l2cap_params);
 
     /* Ensure an update response command got sent. */
@@ -485,7 +485,7 @@ ble_l2cap_test_util_peer_updates(int accept)
         params.itvl_min = 0x200;
         params.itvl_max = 0x300;
         params.latency = 0;
-        params.supervision_timeout = 0x100;
+        params.supervision_timeout = 0x500;
         params.min_ce_len = BLE_GAP_INITIAL_CONN_MIN_CE_LEN;
         params.max_ce_len = BLE_GAP_INITIAL_CONN_MAX_CE_LEN;
         ble_l2cap_test_util_verify_tx_update_conn(&params);


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 88191c27f772d3d9f2e43ff0ed55b80c5258560d
Parents: 0724409
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 10 15:59:33 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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


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

Posted by vi...@apache.org.
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/c00eeee7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/c00eeee7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/c00eeee7

Branch: refs/heads/sensors_branch
Commit: c00eeee7c4cdbe5dd474b03b95c8870d7eda20c9
Parents: 7944913
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 13:54:23 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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/c00eeee7/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		0xc0ffeeee
 #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/c00eeee7/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/c00eeee7/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/c00eeee7/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/c00eeee7/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/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c
index ade741a..bfdcc21 100644
--- a/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c
+++ b/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c
@@ -27,6 +27,7 @@ TEST_CASE(config_test_save_2_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/c00eeee7/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c
----------------------------------------------------------------------
diff --git a/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c b/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c
index 3cb7cee..99d79ef 100644
--- a/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c
+++ b/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c
@@ -27,6 +27,7 @@ TEST_CASE(config_test_save_3_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 = 4;
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c00eeee7/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c
----------------------------------------------------------------------
diff --git a/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c b/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c
index a9a5efc..90e17d9 100644
--- a/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c
+++ b/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c
@@ -26,6 +26,7 @@ TEST_CASE(config_test_save_one_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]);
 


[15/50] incubator-mynewt-core git commit: This closes #171.

Posted by vi...@apache.org.
This closes #171.

Merge remote-tracking branch 'rymanluk/l2cap_coc_sig' into develop

* rymanluk/l2cap_coc_sig:
  bletiny: Add support to connect/disconnect L2CAP LE COC
  nimble/l2cap: Add support to disconnect L2CAP LE COC
  nimble/l2cap: Add support to connect L2CAP LE COC
  nimble/l2cap: Add LE L2CAP COC API
  nimble/l2cap: Move ble_l2cap_chan_mtu() to ble_att
  nimble/l2cap: Remove prefix blc_ and blh_ from L2CAP structs
  nimble/l2cap: Remove not needed checks
  kernel/queue: Fix SLIST_REMOVE macro


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

Branch: refs/heads/sensors_branch
Commit: 0727c55dcfb6a7718b38bcfec4068f652ca314fa
Parents: 85638d2 8b73a4d
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Feb 13 11:23:27 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Feb 13 11:23:27 2017 -0800

----------------------------------------------------------------------
 apps/bletiny/src/bletiny.h                  |  12 +-
 apps/bletiny/src/cmd.c                      | 145 ++++++
 apps/bletiny/src/main.c                     | 222 +++++++++
 kernel/os/include/os/queue.h                |   9 +-
 net/nimble/host/include/host/ble_hs.h       |   4 +
 net/nimble/host/include/host/ble_l2cap.h    | 114 +++++
 net/nimble/host/src/ble_att.c               |  38 +-
 net/nimble/host/src/ble_att_clt.c           |   6 +-
 net/nimble/host/src/ble_att_priv.h          |   1 +
 net/nimble/host/src/ble_att_svr.c           |   6 +-
 net/nimble/host/src/ble_gattc.c             |   2 +-
 net/nimble/host/src/ble_hs_conn.c           |  20 +-
 net/nimble/host/src/ble_hs_conn_priv.h      |   3 +
 net/nimble/host/src/ble_hs_priv.h           |   1 +
 net/nimble/host/src/ble_l2cap.c             | 110 +++--
 net/nimble/host/src/ble_l2cap_coc.c         | 131 ++++++
 net/nimble/host/src/ble_l2cap_coc_priv.h    |  68 +++
 net/nimble/host/src/ble_l2cap_priv.h        |  39 +-
 net/nimble/host/src/ble_l2cap_sig.c         | 563 ++++++++++++++++++++++-
 net/nimble/host/src/ble_l2cap_sig_cmd.c     |  51 +-
 net/nimble/host/src/ble_l2cap_sig_priv.h    |  44 +-
 net/nimble/host/src/ble_sm.c                |   7 +-
 net/nimble/host/syscfg.yml                  |   5 +
 net/nimble/host/test/src/ble_att_svr_test.c |  14 +-
 net/nimble/host/test/src/ble_hs_conn_test.c |  15 +-
 net/nimble/host/test/src/ble_hs_test_util.c |   6 +-
 net/nimble/host/test/src/ble_l2cap_test.c   |  15 +-
 27 files changed, 1502 insertions(+), 149 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0727c55d/net/nimble/host/src/ble_l2cap.c
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0727c55d/net/nimble/host/test/src/ble_att_svr_test.c
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0727c55d/net/nimble/host/test/src/ble_l2cap_test.c
----------------------------------------------------------------------
diff --cc net/nimble/host/test/src/ble_l2cap_test.c
index 2681b26,e8dbfa8..dc1c373
--- a/net/nimble/host/test/src/ble_l2cap_test.c
+++ b/net/nimble/host/test/src/ble_l2cap_test.c
@@@ -365,13 -364,8 +364,13 @@@ TEST_CASE(ble_l2cap_test_case_frag_chan
      conn = ble_hs_conn_find(2);
      TEST_ASSERT_FATAL(conn != NULL);
      TEST_ASSERT(conn->bhc_rx_chan != NULL &&
-                 conn->bhc_rx_chan->blc_cid == BLE_L2CAP_CID_ATT);
+                 conn->bhc_rx_chan->scid == BLE_L2CAP_CID_ATT);
      ble_hs_unlock();
 +
 +    /* Terminate the connection.  The received fragments should get freed.
 +     * Mbuf leaks are tested in the post-test-case callback.
 +     */
 +    ble_hs_test_util_conn_disconnect(2);
  }
  
  TEST_CASE(ble_l2cap_test_case_frag_timeout)


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: c9fdcc0e984567347b036f92ed6bc7a019866e86
Parents: cb6d0cb
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 17:36:52 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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",


[09/50] incubator-mynewt-core git commit: MYNEWT-626 Replace os_task_suspend() with remove.

Posted by vi...@apache.org.
MYNEWT-626 Replace os_task_suspend() with remove.


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

Branch: refs/heads/sensors_branch
Commit: 851880542d521316cf2d1339887e367497562bd0
Parents: a4aa979
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Feb 10 17:04:07 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Fri Feb 10 17:04:07 2017 -0800

----------------------------------------------------------------------
 apps/testbench/src/testbench_mutex.c | 16 ++++++++--------
 apps/testbench/src/testbench_sem.c   |  8 ++++----
 kernel/os/include/os/os_sched.h      |  2 +-
 kernel/os/include/os/os_task.h       |  3 +--
 kernel/os/src/os_sched.c             | 15 ++++++++-------
 kernel/os/src/os_task.c              |  6 +++---
 6 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/85188054/apps/testbench/src/testbench_mutex.c
----------------------------------------------------------------------
diff --git a/apps/testbench/src/testbench_mutex.c b/apps/testbench/src/testbench_mutex.c
index 85bf684..59c8158 100644
--- a/apps/testbench/src/testbench_mutex.c
+++ b/apps/testbench/src/testbench_mutex.c
@@ -56,19 +56,19 @@ testbench_mutex_tc_posttest(void* arg)
     int taskcount = (int) arg;
 
     if (taskcount >= 1) {
-        err = os_task_suspend(&task1);
+        err = os_task_remove(&task1);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 2) {
-        err = os_task_suspend(&task2);
+        err = os_task_remove(&task2);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 3) {
-        err = os_task_suspend(&task3);
+        err = os_task_remove(&task3);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 4) {
-        err = os_task_suspend(&task4);
+        err = os_task_remove(&task4);
         TEST_ASSERT(err == OS_OK);
     }
 
@@ -100,19 +100,19 @@ testbench_mutex_posttest(void* arg)
     int taskcount = (int) arg;
 
     if (taskcount >= 1) {
-        err = os_task_suspend(&task1);
+        err = os_task_remove(&task1);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 2) {
-        err = os_task_suspend(&task2);
+        err = os_task_remove(&task2);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 3) {
-        err = os_task_suspend(&task3);
+        err = os_task_remove(&task3);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 4) {
-        err = os_task_suspend(&task4);
+        err = os_task_remove(&task4);
         TEST_ASSERT(err == OS_OK);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/85188054/apps/testbench/src/testbench_sem.c
----------------------------------------------------------------------
diff --git a/apps/testbench/src/testbench_sem.c b/apps/testbench/src/testbench_sem.c
index 5801a60..a14a36f 100644
--- a/apps/testbench/src/testbench_sem.c
+++ b/apps/testbench/src/testbench_sem.c
@@ -44,19 +44,19 @@ testbench_sem_posttest(void* arg)
     int taskcount = (int) arg;
 
     if (taskcount >= 1) {
-        err = os_task_suspend(&task1);
+        err = os_task_remove(&task1);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 2) {
-        err = os_task_suspend(&task2);
+        err = os_task_remove(&task2);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 3) {
-        err = os_task_suspend(&task3);
+        err = os_task_remove(&task3);
         TEST_ASSERT(err == OS_OK);
     }
     if (taskcount >= 4) {
-        err = os_task_suspend(&task4);
+        err = os_task_remove(&task4);
         TEST_ASSERT(err == OS_OK);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/85188054/kernel/os/include/os/os_sched.h
----------------------------------------------------------------------
diff --git a/kernel/os/include/os/os_sched.h b/kernel/os/include/os/os_sched.h
index df14ced..1ac5c8d 100644
--- a/kernel/os/include/os/os_sched.h
+++ b/kernel/os/include/os/os_sched.h
@@ -35,7 +35,7 @@ void os_sched_os_timer_exp(void);
 os_error_t os_sched_insert(struct os_task *);
 int os_sched_sleep(struct os_task *, os_time_t nticks);
 int os_sched_wakeup(struct os_task *);
-int os_sched_suspend(struct os_task *);
+int os_sched_remove(struct os_task *);
 void os_sched_resort(struct os_task *);
 os_time_t os_sched_wakeup_ticks(os_time_t now);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/85188054/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 64c0850..3b7e652 100644
--- a/kernel/os/include/os/os_task.h
+++ b/kernel/os/include/os/os_task.h
@@ -47,7 +47,6 @@ struct os_task_obj
 typedef enum os_task_state {
     OS_TASK_READY = 1,
     OS_TASK_SLEEP = 2,
-    OS_TASK_SUSPEND = 3
 } os_task_state_t;
 
 /* Task flags */
@@ -99,7 +98,7 @@ struct os_task {
 int os_task_init(struct os_task *, const char *, os_task_func_t, void *,
         uint8_t, os_time_t, os_stack_t *, uint16_t);
 
-int os_task_suspend(struct os_task *t);
+int os_task_remove(struct os_task *t);
 
 uint8_t os_task_count(void);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/85188054/kernel/os/src/os_sched.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/os_sched.c b/kernel/os/src/os_sched.c
index da90de1..0cbe615 100644
--- a/kernel/os/src/os_sched.c
+++ b/kernel/os/src/os_sched.c
@@ -19,6 +19,7 @@
 
 #include "os/os.h"
 #include "os/queue.h"
+#include "os_priv.h"
 
 #include <assert.h>
 
@@ -29,9 +30,8 @@
  *   @{
  */
 
-TAILQ_HEAD(, os_task) g_os_run_list = TAILQ_HEAD_INITIALIZER(g_os_run_list);
-
-TAILQ_HEAD(, os_task) g_os_sleep_list = TAILQ_HEAD_INITIALIZER(g_os_sleep_list);
+struct os_task_list g_os_run_list = TAILQ_HEAD_INITIALIZER(g_os_run_list);
+struct os_task_list g_os_sleep_list = TAILQ_HEAD_INITIALIZER(g_os_sleep_list);
 
 struct os_task *g_current_task;
 
@@ -194,12 +194,12 @@ os_sched_sleep(struct os_task *t, os_time_t nticks)
 }
 
 /**
- * os sched suspend
+ * os sched remove
  *
  * XXX
  * NOTE - This routine is currently experimental and not ready for common use
  *
- * Stops a task and removes it from the run list
+ * Stops a task and removes it from the task list.
  *
  * @return int
  *
@@ -207,7 +207,7 @@ os_sched_sleep(struct os_task *t, os_time_t nticks)
  * the scheduler
  */
 int
-os_sched_suspend(struct os_task *t)
+os_sched_remove(struct os_task *t)
 {
 
     if (t->t_state == OS_TASK_SLEEP) {
@@ -215,10 +215,11 @@ os_sched_suspend(struct os_task *t)
     } else if (t->t_state == OS_TASK_READY) {
         TAILQ_REMOVE(&g_os_run_list, t, t_os_list);
     }
-    t->t_state = OS_TASK_SUSPEND;
     t->t_next_wakeup = 0;
     t->t_flags |= OS_TASK_FLAG_NO_TIMEOUT;
 
+    STAILQ_REMOVE(&g_os_task_list, t, os_task, t_os_task_list);
+
     return OS_OK;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/85188054/kernel/os/src/os_task.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/os_task.c b/kernel/os/src/os_task.c
index f3106bd..45c48a1 100644
--- a/kernel/os/src/os_task.c
+++ b/kernel/os/src/os_task.c
@@ -153,12 +153,12 @@ err:
 }
 
 /*
- * Suspend specified task
+ * Removes specified task
  * XXX
  * NOTE: This interface is currently experimental and not ready for common use
  */
 int
-os_task_suspend(struct os_task *t)
+os_task_remove(struct os_task *t)
 {
     struct os_task *current;
     int rc;
@@ -202,7 +202,7 @@ os_task_suspend(struct os_task *t)
     }
 
     OS_ENTER_CRITICAL(sr);
-    rc = os_sched_suspend(t);
+    rc = os_sched_remove(t);
     OS_EXIT_CRITICAL(sr);
     return rc;
 }


[19/50] 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 packages.

Posted by vi...@apache.org.
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/sensors_branch
Commit: d3397d7ab617fa3200f7be629668a83cfb529e64
Parents: 51af56c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Mon Feb 13 12:09:34 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 3ad2ce23d15a7a6cb6f7805ede3ae8510034b1ae
Parents: 745d627 925b6bb
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Feb 15 15:19:16 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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(-)
----------------------------------------------------------------------



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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 794572bf473e1738327d87df6202bb441a15196c
Parents: 0f1ec97
Author: Fabio Utzig <ut...@utzig.org>
Authored: Thu Feb 9 20:24:15 2017 -0800
Committer: Fabio Utzig <ut...@utzig.org>
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; k<MULTI_SIZE; k++){
         j = os_callout_queued(&callout_stop_test[k]);
         TEST_ASSERT(j == 0);
     }
 
-
     /* Show that  callout is not armed after calling callout_stop */
     for(k = 0; k<MULTI_SIZE; k++){
         os_callout_stop(&callout_stop_test[k]);
@@ -181,12 +179,12 @@ callout_task_stop_receive(void *arg)
 
 
      }
-     
+
     /* Show that event is removed from the queued after calling callout_stop */
     for(k=0; k<MULTI_SIZE; k++){
         os_callout_stop(&callout_stop_test[k]);
         /* Testing that the event has been removed from queue */
-        TEST_ASSERT_FATAL(1); 
+        TEST_ASSERT_FATAL(1);
      }
     /* Finishes the test when OS has been started */
     os_test_restart();
@@ -207,7 +205,7 @@ callout_task_stop_speak(void *arg)
     TEST_ASSERT(i == 1);
 
     os_callout_stop(&callout_speak);
-    
+
     /* Send the callout */ 
     os_time_delay(OS_TICKS_PER_SEC/ 100 );
     /* Finishes the test when OS has been started */
@@ -232,7 +230,7 @@ TEST_CASE_DECL(callout_test_stop)
 TEST_CASE_DECL(callout_test)
 
 TEST_SUITE(os_callout_test_suite)
-{   
+{
     callout_test();
     callout_test_stop();
     callout_test_speak();

http://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/kernel/os/test/src/eventq_test.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/eventq_test.c b/kernel/os/test/src/eventq_test.c
index a48546d..b716bd6 100644
--- a/kernel/os/test/src/eventq_test.c
+++ b/kernel/os/test/src/eventq_test.c
@@ -26,12 +26,10 @@
 
 /* Task 1 sending task */
 /* Define task stack and task object */
-#define SEND_TASK_PRIO        (1)
 struct os_task eventq_task_s;
 os_stack_t eventq_task_stack_s[MY_STACK_SIZE];
 
 /* Task 2 receiving task */
-#define RECEIVE_TASK_PRIO     (2)
 struct os_task eventq_task_r;
 os_stack_t eventq_task_stack_r[MY_STACK_SIZE];
 
@@ -50,34 +48,28 @@ uint8_t my_event_type = 1;
 
 /* Setting up data for the poll */
 /* Define the task stack for the eventq_task_poll_send */
-#define SEND_TASK_POLL_PRIO        (3)
 struct os_task eventq_task_poll_s;
 os_stack_t eventq_task_stack_poll_s[POLL_STACK_SIZE];
 
 /* Define the task stack for the eventq_task_poll_receive */
-#define RECEIVE_TASK_POLL_PRIO     (4)
 struct os_task eventq_task_poll_r;
 os_stack_t eventq_task_stack_poll_r[POLL_STACK_SIZE ];
 
 /* Setting the data for the poll timeout */
 /* Define the task stack for the eventq_task_poll_timeout_send */
-#define SEND_TASK_POLL_TIMEOUT_PRIO        (5)
 struct os_task eventq_task_poll_timeout_s;
 os_stack_t eventq_task_stack_poll_timeout_s[POLL_STACK_SIZE];
 
 /* Define the task stack for the eventq_task_poll_receive */
-#define RECEIVE_TASK_POLL_TIMEOUT_PRIO     (6)
 struct os_task eventq_task_poll_timeout_r;
 os_stack_t eventq_task_stack_poll_timeout_r[POLL_STACK_SIZE];
 
 /* Setting the data for the poll single */
 /* Define the task stack for the eventq_task_poll_single_send */
-#define SEND_TASK_POLL_SINGLE_PRIO        (7)
 struct os_task eventq_task_poll_single_s;
 os_stack_t eventq_task_stack_poll_single_s[POLL_STACK_SIZE];
 
 /* Define the task stack for the eventq_task_poll_single_receive */
-#define RECEIVE_TASK_POLL_SINGLE_PRIO     (8)
 struct os_task eventq_task_poll_single_r;
 os_stack_t eventq_task_stack_poll_single_r[POLL_STACK_SIZE];
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/eventq_test.h
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/eventq_test.h b/kernel/os/test/src/eventq_test.h
index 32c3377..7fea3a2 100644
--- a/kernel/os/test/src/eventq_test.h
+++ b/kernel/os/test/src/eventq_test.h
@@ -31,27 +31,29 @@
 #endif
 
 #if MYNEWT_VAL(SELFTEST)
-#define MY_STACK_SIZE        (5120)
-#define POLL_STACK_SIZE        (4096)
+#define MY_STACK_SIZE                   (5120)
+#define POLL_STACK_SIZE                 (4096)
 #else
-#define MY_STACK_SIZE        (128)
-#define POLL_STACK_SIZE        (32) /* for now */
+#define MY_STACK_SIZE                   (128)
+#define POLL_STACK_SIZE                 (32) /* for now */
 #endif
 
+#define INITIAL_EVENTQ_TASK_PRIO        (10)
+
 /* Task 1 sending task */
 /* Define task stack and task object */
-#define SEND_TASK_PRIO        (1)
+#define SEND_TASK_PRIO                  (INITIAL_EVENTQ_TASK_PRIO + 1)
 extern struct os_task eventq_task_s;
 extern os_stack_t eventq_task_stack_s[MY_STACK_SIZE];
 
 /* Task 2 receiving task */
-#define RECEIVE_TASK_PRIO     (2)
+#define RECEIVE_TASK_PRIO               (INITIAL_EVENTQ_TASK_PRIO + 2)
 extern struct os_task eventq_task_r;
 extern os_stack_t eventq_task_stack_r[MY_STACK_SIZE];
 
 extern struct os_eventq my_eventq;
 
-#define SIZE_MULTI_EVENT        (4)
+#define SIZE_MULTI_EVENT       (4)
 extern struct os_eventq multi_eventq[SIZE_MULTI_EVENT];
 
 /* This is to set the events we will use below */
@@ -63,34 +65,34 @@ extern uint8_t my_event_type;
 
 /* Setting up data for the poll */
 /* Define the task stack for the eventq_task_poll_send */
-#define SEND_TASK_POLL_PRIO        (3)
+#define SEND_TASK_POLL_PRIO             (INITIAL_EVENTQ_TASK_PRIO + 3)
 extern struct os_task eventq_task_poll_s;
 extern os_stack_t eventq_task_stack_poll_s[POLL_STACK_SIZE];
 
 /* Define the task stack for the eventq_task_poll_receive */
-#define RECEIVE_TASK_POLL_PRIO     (4)
+#define RECEIVE_TASK_POLL_PRIO          (INITIAL_EVENTQ_TASK_PRIO + 4)
 extern struct os_task eventq_task_poll_r;
 extern os_stack_t eventq_task_stack_poll_r[POLL_STACK_SIZE ];
 
 /* Setting the data for the poll timeout */
 /* Define the task stack for the eventq_task_poll_timeout_send */
-#define SEND_TASK_POLL_TIMEOUT_PRIO        (5)
+#define SEND_TASK_POLL_TIMEOUT_PRIO     (INITIAL_EVENTQ_TASK_PRIO + 5)
 extern struct os_task eventq_task_poll_timeout_s;
 extern os_stack_t eventq_task_stack_poll_timeout_s[POLL_STACK_SIZE];
 
 /* Define the task stack for the eventq_task_poll_receive */
-#define RECEIVE_TASK_POLL_TIMEOUT_PRIO     (6)
+#define RECEIVE_TASK_POLL_TIMEOUT_PRIO  (INITIAL_EVENTQ_TASK_PRIO + 6)
 extern struct os_task eventq_task_poll_timeout_r;
 extern os_stack_t eventq_task_stack_poll_timeout_r[POLL_STACK_SIZE];
 
 /* Setting the data for the poll single */
 /* Define the task stack for the eventq_task_poll_single_send */
-#define SEND_TASK_POLL_SINGLE_PRIO        (7)
+#define SEND_TASK_POLL_SINGLE_PRIO      (INITIAL_EVENTQ_TASK_PRIO + 7)
 extern struct os_task eventq_task_poll_single_s;
 extern os_stack_t eventq_task_stack_poll_single_s[POLL_STACK_SIZE];
 
 /* Define the task stack for the eventq_task_poll_single_receive */
-#define RECEIVE_TASK_POLL_SINGLE_PRIO     (8)
+#define RECEIVE_TASK_POLL_SINGLE_PRIO   (INITIAL_EVENTQ_TASK_PRIO + 8)
 extern struct os_task eventq_task_poll_single_r;
 extern os_stack_t eventq_task_stack_poll_single_r[POLL_STACK_SIZE];
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/testcases/event_test_poll_single_sr.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/event_test_poll_single_sr.c b/kernel/os/test/src/testcases/event_test_poll_single_sr.c
index 416528b..50a28b4 100644
--- a/kernel/os/test/src/testcases/event_test_poll_single_sr.c
+++ b/kernel/os/test/src/testcases/event_test_poll_single_sr.c
@@ -24,11 +24,6 @@ TEST_CASE(event_test_poll_single_sr)
 {
     int i;
 
-#if MYNEWT_VAL(SELFTEST)
-    /* Initializing the OS */
-    os_init(NULL);
-    sysinit();
-#endif
     /* Initialize the task */
     os_task_init(&eventq_task_poll_single_s, "eventq_task_poll_single_s",
         eventq_task_poll_single_send, NULL, SEND_TASK_POLL_SINGLE_PRIO,
@@ -44,10 +39,4 @@ TEST_CASE(event_test_poll_single_sr)
 
         m_event[i].ev_arg = (void *)(intptr_t)(10 * i);
     }
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Does not return until OS_restart is called */
-    os_start();
-#endif
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/testcases/event_test_poll_sr.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/event_test_poll_sr.c b/kernel/os/test/src/testcases/event_test_poll_sr.c
index e3dfbf6..eba2763 100644
--- a/kernel/os/test/src/testcases/event_test_poll_sr.c
+++ b/kernel/os/test/src/testcases/event_test_poll_sr.c
@@ -23,11 +23,6 @@ TEST_CASE(event_test_poll_sr)
 {
     int i;
 
-#if MYNEWT_VAL(SELFTEST)
-    /* Initializing the OS */
-    os_init(NULL);
-    sysinit();
-#endif
     /* Initialize the task */
     os_task_init(&eventq_task_poll_s, "eventq_task_poll_s", eventq_task_poll_send,
         NULL, SEND_TASK_POLL_PRIO, OS_WAIT_FOREVER, eventq_task_stack_poll_s, 
@@ -42,10 +37,4 @@ TEST_CASE(event_test_poll_sr)
     for (i = 0; i < SIZE_MULTI_EVENT; i++){
         os_eventq_init(&multi_eventq[i]);
     }
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Does not return until OS_restart is called */
-    os_start();
-#endif
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c b/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c
index be92879..541cfcf 100644
--- a/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c
+++ b/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c
@@ -23,11 +23,6 @@ TEST_CASE(event_test_poll_timeout_sr)
 {
     int i;
 
-#if MYNEWT_VAL(SELFTEST)
-    /* Initializing the OS */
-    os_init(NULL);
-    sysinit();
-#endif
     /* Initialize the task */
     os_task_init(&eventq_task_poll_timeout_s, "eventq_task_poll_timeout_s",
         eventq_task_poll_timeout_send, NULL, SEND_TASK_POLL_TIMEOUT_PRIO,
@@ -44,10 +39,4 @@ TEST_CASE(event_test_poll_timeout_sr)
 
         m_event[i].ev_arg = NULL;
     }
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Does not return until OS_restart is called */
-    os_start();
-#endif
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/testcases/event_test_src.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/event_test_src.c b/kernel/os/test/src/testcases/event_test_src.c
index 76231c5..605fcb2 100644
--- a/kernel/os/test/src/testcases/event_test_src.c
+++ b/kernel/os/test/src/testcases/event_test_src.c
@@ -22,11 +22,6 @@ TEST_CASE(event_test_sr)
 {
     int i;
 
-#if MYNEWT_VAL(SELFTEST)
-    /* Initializing the OS */
-    os_init(NULL);
-    sysinit();
-#endif
     /* Initialize the task */
     os_task_init(&eventq_task_s, "eventq_task_s", eventq_task_send, NULL,
         SEND_TASK_PRIO, OS_WAIT_FOREVER, eventq_task_stack_s, MY_STACK_SIZE);
@@ -41,10 +36,4 @@ TEST_CASE(event_test_sr)
     for (i = 0; i < SIZE_MULTI_EVENT; i++){
         os_eventq_init(&multi_eventq[i]);
     }
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Does not return until OS_restart is called */
-    os_start();
-#endif
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/testcases/os_callout_test.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/os_callout_test.c b/kernel/os/test/src/testcases/os_callout_test.c
index 5354a1d..1f791dc 100644
--- a/kernel/os/test/src/testcases/os_callout_test.c
+++ b/kernel/os/test/src/testcases/os_callout_test.c
@@ -21,13 +21,6 @@
 /* Test case to test the basics of the callout */
 TEST_CASE(callout_test)
 {
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Initializing the OS */
-    os_init(NULL);
-    sysinit();
-#endif
-
     /* Initialize the sending task */
     os_task_init(&callout_task_struct_send, "callout_task_send",
         callout_task_send, NULL, SEND_CALLOUT_TASK_PRIO, OS_WAIT_FOREVER,
@@ -42,9 +35,4 @@ TEST_CASE(callout_test)
 
     /* Initialize the callout function */
     os_callout_init(&callout_test_c, &callout_evq, my_callout, NULL);
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Does not return until OS_restart is called */
-    os_start();
-#endif
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/testcases/os_callout_test_speak.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/os_callout_test_speak.c b/kernel/os/test/src/testcases/os_callout_test_speak.c
index bdd647b..1ce7634 100644
--- a/kernel/os/test/src/testcases/os_callout_test_speak.c
+++ b/kernel/os/test/src/testcases/os_callout_test_speak.c
@@ -21,13 +21,6 @@
 /* Test case to test case for speak and listen */
 TEST_CASE(callout_test_speak)
 {
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Initializing the OS */
-    os_init(NULL);
-    sysinit();
-#endif
-
     /* Initialize the sending task */
     os_task_init(&callout_task_struct_speak, "callout_task_speak",
         callout_task_stop_speak, NULL, SPEAK_CALLOUT_TASK_PRIO,
@@ -43,9 +36,4 @@ TEST_CASE(callout_test_speak)
     /* Initialize the callout function */
     os_callout_init(&callout_speak, &callout_evq,
         my_callout_speak_func, NULL);
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Does not return until OS_restart is called */
-    os_start();
-#endif
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/kernel/os/test/src/testcases/os_callout_test_stop.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/os_callout_test_stop.c b/kernel/os/test/src/testcases/os_callout_test_stop.c
index 98ba7e4..6497d13 100644
--- a/kernel/os/test/src/testcases/os_callout_test_stop.c
+++ b/kernel/os/test/src/testcases/os_callout_test_stop.c
@@ -23,12 +23,6 @@ TEST_CASE(callout_test_stop)
 {
     int k;
 
-#if MYNEWT_VAL(SELFTEST)
-    /* Initializing the OS */
-    os_init(NULL);
-    sysinit();
-#endif
-
     /* Initialize the sending task */
     os_task_init(&callout_task_struct_stop_send, "callout_task_stop_send",
         callout_task_stop_send, NULL, SEND_STOP_CALLOUT_TASK_PRIO,
@@ -49,10 +43,4 @@ TEST_CASE(callout_test_stop)
         os_callout_init(&callout_stop_test[k], &callout_stop_evq[k],
            my_callout_stop_func, NULL);
     }
-
-#if MYNEWT_VAL(SELFTEST)
-    /* Does not return until OS_restart is called */
-    os_start();
-#endif
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/sys/flash_map/test/src/testcases/flash_map_test_case_1.c
----------------------------------------------------------------------
diff --git a/sys/flash_map/test/src/testcases/flash_map_test_case_1.c b/sys/flash_map/test/src/testcases/flash_map_test_case_1.c
index b4a7f79..883fba0 100644
--- a/sys/flash_map/test/src/testcases/flash_map_test_case_1.c
+++ b/sys/flash_map/test/src/testcases/flash_map_test_case_1.c
@@ -33,10 +33,6 @@ TEST_CASE(flash_map_test_case_1)
     int sect_cnt;
     uint32_t end;
 
-#if MYNEWT_VAL(SELFTEST)
-    sysinit();
-#endif
-
     for (i = 0; i < flash_map_entries; i++) {
         rc = flash_area_open(i, &fa);
         if (rc) {

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/794572bf/sys/flash_map/test/src/testcases/flash_map_test_case_2.c
----------------------------------------------------------------------
diff --git a/sys/flash_map/test/src/testcases/flash_map_test_case_2.c b/sys/flash_map/test/src/testcases/flash_map_test_case_2.c
index 412c320..ef978b7 100644
--- a/sys/flash_map/test/src/testcases/flash_map_test_case_2.c
+++ b/sys/flash_map/test/src/testcases/flash_map_test_case_2.c
@@ -33,10 +33,6 @@ TEST_CASE(flash_map_test_case_2)
     uint8_t wd[256];
     uint8_t rd[256];
 
-#if MYNEWT_VAL(SELFTEST)
-    sysinit();
-#endif
-
     rc = flash_area_open(FLASH_AREA_IMAGE_0, &fa);
     TEST_ASSERT_FATAL(rc == 0, "flash_area_open() fail");
 


[24/50] incubator-mynewt-core git commit: MYNEWT-492: Update TBD in syscfg files.

Posted by vi...@apache.org.
MYNEWT-492: Update TBD in syscfg files.


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

Branch: refs/heads/sensors_branch
Commit: 745d6279d482aae185d60fd151b88147a596bfb1
Parents: 408caf5
Author: William San Filippo <wi...@runtime.io>
Authored: Wed Feb 15 11:37:04 2017 -0800
Committer: William San Filippo <wi...@runtime.io>
Committed: Wed Feb 15 11:39:25 2017 -0800

----------------------------------------------------------------------
 net/nimble/controller/syscfg.yml     | 35 +++++++++++++++++++++----------
 net/nimble/transport/uart/syscfg.yml | 18 ++++++++--------
 2 files changed, 33 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/745d6279/net/nimble/controller/syscfg.yml
----------------------------------------------------------------------
diff --git a/net/nimble/controller/syscfg.yml b/net/nimble/controller/syscfg.yml
index b5119cd..357decc 100644
--- a/net/nimble/controller/syscfg.yml
+++ b/net/nimble/controller/syscfg.yml
@@ -20,11 +20,13 @@
 
 syscfg.defs:
     BLE_DEVICE:
-        description: 'TBD'
+        description: >
+            Used by package management system to include BLE hardware
+            drivers.
         value: 1
 
     BLE_LL_PRIO:
-        description: 'TBD'
+        description: 'The priority of the LL task'
         type: 'task_priority'
         value: 0
 
@@ -51,11 +53,11 @@ syscfg.defs:
     #  The values provided below are merely meant to be an example and should
     #  be replaced by values appropriate for your platform.
     BLE_LL_OUR_SCA:
-        description: 'TBD'
+        description: 'The system clock accuracy of the device.'
         value: '60'    # in ppm
 
     BLE_LL_MASTER_SCA:
-        description: 'TBD'
+        description: 'Enumerated value based on our sca'
         value: '4'
 
     BLE_LL_TX_PWR_DBM:
@@ -77,10 +79,12 @@ syscfg.defs:
     # Configuration items for the number of duplicate advertisers and the
     # number of advertisers from which we have heard a scan response.
     BLE_LL_NUM_SCAN_DUP_ADVS:
-        description: 'TBD'
+        description: 'The number of duplicate advertisers stored.'
         value: '8'
     BLE_LL_NUM_SCAN_RSP_ADVS:
-        description: 'TBD'
+        description: >
+            The number of advertisers from which we have heard a scan
+            response. Prevents sending duplicate events to host.
         value: '8'
 
     BLE_LL_WHITELIST_SIZE:
@@ -95,16 +99,21 @@ syscfg.defs:
     # maximum size of the PDU's that will be sent and/or received in a
     # connection.
     BLE_LL_MAX_PKT_SIZE:
-        description: 'TBD'
+        description: 'The maximum PDU size that can be sent/received'
         value: '251'
     BLE_LL_SUPP_MAX_RX_BYTES:
-        description: 'TBD'
+        description: 'The maximum supported received PDU size'
         value: 'MYNEWT_VAL_BLE_LL_MAX_PKT_SIZE'
     BLE_LL_SUPP_MAX_TX_BYTES:
-        description: 'TBD'
+        description: 'The maximum supported transmit PDU size'
         value: 'MYNEWT_VAL_BLE_LL_MAX_PKT_SIZE'
     BLE_LL_CONN_INIT_MAX_TX_BYTES:
-        description: 'TBD'
+        description: >
+            Used to set the initial maximum transmit PDU size in a
+            connection. If this is set to a value greater than 27,
+            the controller will automatically attempt to do the
+            data length update procedure. The host can always tell
+            the controller to update this value.
         value: '27'
 
     # The number of slots that will be allocated to each connection
@@ -121,7 +130,11 @@ syscfg.defs:
 
     # The number of random bytes to store
     BLE_LL_RNG_BUFSIZE:
-        description: 'TBD'
+        description: >
+            The number of random bytes that the link layer will try to
+            always have available for the host to use. Decreasing this
+            value may cause host delays if the host needs lots of random
+            material often.
         value: '32'
 
     # Configuration for LL supported features.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/745d6279/net/nimble/transport/uart/syscfg.yml
----------------------------------------------------------------------
diff --git a/net/nimble/transport/uart/syscfg.yml b/net/nimble/transport/uart/syscfg.yml
index 6b0673f..81b47f3 100644
--- a/net/nimble/transport/uart/syscfg.yml
+++ b/net/nimble/transport/uart/syscfg.yml
@@ -20,14 +20,14 @@
 
 syscfg.defs:
     BLE_HCI_EVT_BUF_SIZE:
-        description: 'TBD'
+        description: 'The size of the allocated event buffers'
         # The largest event the nimble controller will send is 70 bytes.
         value: 70
     BLE_HCI_EVT_HI_BUF_COUNT:
-        description: 'TBD'
+        description: 'The number of high priority event buffers'
         value: 8
     BLE_HCI_EVT_LO_BUF_COUNT:
-        description: 'TBD'
+        description: 'The number of low priority event buffers'
         value: 8
     BLE_ACL_BUF_COUNT:
         description: 'The number of ACL data buffers'
@@ -49,20 +49,20 @@ syscfg.defs:
         value: 12
 
     BLE_HCI_UART_PORT:
-        description: 'TBD'
+        description: 'The uart to use for the HCI uart interface'
         value:            0
     BLE_HCI_UART_BAUD:
-        description: 'TBD'
+        description: 'The baud rate of the HCI uart interface'
         value:            1000000
     BLE_HCI_UART_DATA_BITS:
-        description: 'TBD'
+        description: 'Number of data bits used for HCI uart interface'
         value:       8
     BLE_HCI_UART_STOP_BITS:
-        description: 'TBD'
+        description: 'Number of stop bits used for HCI uart interface'
         value:       1
     BLE_HCI_UART_PARITY:
-        description: 'TBD'
+        description: 'Parity used for HCI uart interface'
         value:          HAL_UART_PARITY_NONE
     BLE_HCI_UART_FLOW_CTRL:
-        description: 'TBD'
+        description: 'Flow control used for HCI uart interface'
         value:       HAL_UART_FLOW_CTL_RTS_CTS


[21/50] incubator-mynewt-core git commit: queue.h - Revert recent changes.

Posted by vi...@apache.org.
queue.h - Revert recent changes.

Preserve original queue.h semantics, as distasteful as they may be!


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

Branch: refs/heads/sensors_branch
Commit: 4f5dd65cfe508c14685ecc617081e398f1c88981
Parents: 4f4f687
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Feb 14 11:58:01 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Feb 14 11:58:01 2017 -0800

----------------------------------------------------------------------
 kernel/os/include/os/queue.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f5dd65c/kernel/os/include/os/queue.h
----------------------------------------------------------------------
diff --git a/kernel/os/include/os/queue.h b/kernel/os/include/os/queue.h
index a3a0790..faffd85 100755
--- a/kernel/os/include/os/queue.h
+++ b/kernel/os/include/os/queue.h
@@ -158,11 +158,10 @@ struct {                                                \
     }                                                       \
     else {                                                  \
         struct type *curelm = SLIST_FIRST((head));          \
-        while (SLIST_NEXT(curelm, field) &&                 \
-               SLIST_NEXT(curelm, field) != (elm)) {        \
-              curelm = SLIST_NEXT(curelm, field);           \
-        }                                                   \
-        SLIST_NEXT(curelm, field) = SLIST_NEXT(elm, field); \
+        while (SLIST_NEXT(curelm, field) != (elm))          \
+            curelm = SLIST_NEXT(curelm, field);             \
+        SLIST_NEXT(curelm, field) =                         \
+            SLIST_NEXT(SLIST_NEXT(curelm, field), field);   \
     }                                                       \
 } while (0)
 


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

Posted by vi...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/incubator-mynewt-core into sensors_branch


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

Branch: refs/heads/sensors_branch
Commit: d21ef0fdd1215c2cd52871d0b5d5d11be3de1682
Parents: ac59feb 1449ffc
Author: Vipul Rahane <vi...@apache.org>
Authored: Thu Feb 23 13:13:29 2017 -0800
Committer: Vipul Rahane <vi...@apache.org>
Committed: Thu Feb 23 13:13:29 2017 -0800

----------------------------------------------------------------------
 .rat-excludes                                   |  59 +-
 LICENSE                                         | 144 +++--
 NOTICE                                          |   2 +-
 README.md                                       |  10 +-
 apps/blecent/src/main.c                         |  29 +-
 apps/blecent/src/misc.c                         |  40 +-
 apps/blecent/syscfg.yml                         |   1 -
 apps/blehci/syscfg.yml                          |   1 -
 apps/bleprph/pkg.yml                            |   1 +
 apps/bleprph/src/bleprph.h                      |   1 +
 apps/bleprph/src/main.c                         |  38 +-
 apps/bleprph/syscfg.yml                         |   1 -
 apps/bleprph_oic/src/main.c                     |  47 +-
 apps/bleprph_oic/syscfg.yml                     |   2 -
 apps/blesplit/README.md                         |  55 ++
 apps/blesplit/pkg.yml                           |  44 ++
 apps/blesplit/src/blesplit.h                    |  59 ++
 apps/blesplit/src/main.c                        | 287 +++++++++
 apps/blesplit/src/misc.c                        |  43 ++
 apps/blesplit/syscfg.yml                        |  47 ++
 apps/bletest/src/bletest_hci.c                  |  22 +-
 apps/bletest/src/main.c                         |  36 +-
 apps/bletest/syscfg.yml                         |   9 +-
 apps/bletiny/src/bletiny.h                      |  28 +-
 apps/bletiny/src/cmd.c                          | 426 +++++++-----
 apps/bletiny/src/main.c                         | 312 +++++++--
 apps/bletiny/src/misc.c                         |  16 +-
 apps/bletiny/syscfg.yml                         |   1 -
 apps/bleuart/src/main.c                         |  20 +-
 apps/bleuart/syscfg.yml                         |   1 -
 apps/boot/pkg.yml                               |   2 +-
 apps/boot/src/boot.c                            |  20 +-
 apps/boot/syscfg.yml                            |   6 +-
 apps/ocf_sample/src/ocf_ble.c                   |  13 +-
 apps/ocf_sample/syscfg.yml                      |   1 -
 apps/slinky/src/main.c                          |   8 +-
 apps/slinky/syscfg.yml                          |  14 -
 apps/slinky_oic/src/main.c                      |   7 +-
 apps/slinky_oic/syscfg.yml                      |   1 -
 apps/spitest/src/main.c                         |   6 +-
 apps/spitest/syscfg.yml                         |   1 -
 apps/splitty/src/main.c                         |   8 +-
 apps/splitty/syscfg.yml                         |   4 -
 apps/testbench/pkg.yml                          |   1 +
 apps/testbench/src/testbench.c                  |   4 +-
 apps/testbench/src/testbench.h                  |  15 -
 apps/testbench/src/testbench_mutex.c            |  16 +-
 apps/testbench/src/testbench_sem.c              |   8 +-
 apps/testbench/syscfg.yml                       |  19 +-
 apps/timtest/src/main.c                         |   6 +-
 boot/boot_serial/pkg.yml                        |  10 +-
 boot/boot_serial/src/boot_serial.c              | 248 ++++++-
 boot/boot_serial/src/boot_serial_priv.h         |  16 +-
 .../src/testcases/boot_serial_empty_img_msg.c   |   2 +-
 .../test/src/testcases/boot_serial_img_msg.c    |   2 +-
 .../testcases/boot_serial_upload_bigger_image.c |   2 +-
 boot/bootutil/src/bootutil_misc.c               |  19 +-
 boot/bootutil/src/image_ec256.c                 |   2 +-
 boot/bootutil/src/image_rsa.c                   |   2 +
 boot/bootutil/src/loader.c                      | 182 +++---
 boot/bootutil/syscfg.yml                        |   6 +-
 boot/split_app/pkg.yml                          |   4 +
 boot/split_app/src/split_app.c                  |   8 +
 compiler/arm-none-eabi-m4/syscfg.yml            |   4 +
 compiler/gdbmacros/mbuf.gdb                     |  40 +-
 compiler/gdbmacros/os.gdb                       |  38 ++
 fs/fatfs/src/mynewt_glue.c                      |  18 +
 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 +++
 fs/fs/include/fs/fs.h                           |   5 +
 fs/fs/src/fs_dirent.c                           |   3 +-
 fs/fs/src/fs_file.c                             |   2 +-
 fs/fs/src/fs_mount.c                            |  18 +-
 fs/fs/src/fs_nmgr.c                             | 270 ++++++++
 fs/fs/src/fs_priv.h                             |   4 +
 fs/fs/src/fsutil.c                              |   4 +-
 fs/fs/syscfg.yml                                |   6 +-
 fs/nffs/src/nffs.c                              |   5 +-
 fs/nffs/syscfg.yml                              |   4 +-
 hw/bsp/arduino_primo_nrf52/include/bsp/bsp.h    |   4 +-
 hw/bsp/arduino_primo_nrf52/pkg.yml              |   3 +
 hw/bsp/arduino_primo_nrf52/split-primo.ld       |   4 +-
 .../arch/cortex_m4/gcc_startup_nrf52_split.s    |   5 +-
 hw/bsp/arduino_primo_nrf52/src/hal_bsp.c        |   4 +-
 hw/bsp/arduino_primo_nrf52/syscfg.yml           |  46 +-
 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                  |  74 +++
 hw/bsp/bmd200/boot-nrf51xxac.ld                 |  27 +
 hw/bsp/bmd200/bsp.yml                           |  62 ++
 hw/bsp/bmd200/include/bsp/boards.h              |  19 +
 hw/bsp/bmd200/include/bsp/bsp.h                 |  53 ++
 hw/bsp/bmd200/include/bsp/cmsis_nvic.h          |  30 +
 hw/bsp/bmd200/nrf51dk_debug.sh                  |  36 ++
 hw/bsp/bmd200/nrf51dk_download.sh               |  41 ++
 hw/bsp/bmd200/nrf51dk_no_boot.ld                | 179 ++++++
 hw/bsp/bmd200/nrf51xxac.ld                      |  25 +
 hw/bsp/bmd200/pkg.yml                           |  90 +++
 hw/bsp/bmd200/split-nrf51dk.ld                  | 185 ++++++
 .../src/arch/cortex_m0/gcc_startup_nrf51.s      | 280 ++++++++
 .../arch/cortex_m0/gcc_startup_nrf51_split.s    | 182 ++++++
 hw/bsp/bmd200/src/hal_bsp.c                     | 189 ++++++
 hw/bsp/bmd200/src/sbrk.c                        |  59 ++
 hw/bsp/bmd200/syscfg.yml                        |  96 +++
 hw/bsp/bmd300eval/pkg.yml                       |   4 +
 hw/bsp/bmd300eval/split-bmd300eval.ld           |   4 +-
 .../arch/cortex_m4/gcc_startup_nrf52_split.s    |   5 +-
 hw/bsp/bmd300eval/src/hal_bsp.c                 |   4 +-
 hw/bsp/bmd300eval/syscfg.yml                    |  22 +-
 hw/bsp/ci40/syscfg.yml                          |  23 +-
 hw/bsp/frdm-k64f/frdm-k64_debug.sh              |   1 +
 hw/bsp/frdm-k64f/frdm-k64_download.sh           |   2 +-
 hw/bsp/frdm-k64f/pkg.yml                        |   4 +-
 hw/bsp/frdm-k64f/syscfg.yml                     |  62 +-
 hw/bsp/nrf51-arduino_101/syscfg.yml             |  27 +-
 .../arch/cortex_m0/gcc_startup_nrf51_split.s    |   5 +
 hw/bsp/nrf51-blenano/syscfg.yml                 |  24 +-
 .../arch/cortex_m0/gcc_startup_nrf51_split.s    |   5 +
 hw/bsp/nrf51dk-16kbram/syscfg.yml               |  24 +-
 hw/bsp/nrf51dk/split-nrf51dk.ld                 |   4 +-
 .../arch/cortex_m0/gcc_startup_nrf51_split.s    |   5 +
 hw/bsp/nrf51dk/syscfg.yml                       |  24 +-
 hw/bsp/nrf52840pdk/pkg.yml                      |   3 +
 .../arch/cortex_m4/gcc_startup_nrf52_split.s    |   5 +-
 hw/bsp/nrf52840pdk/src/hal_bsp.c                |   4 +-
 hw/bsp/nrf52840pdk/syscfg.yml                   |  33 +-
 hw/bsp/nrf52dk/include/bsp/bsp.h                |  11 +
 hw/bsp/nrf52dk/pkg.yml                          |   3 +
 hw/bsp/nrf52dk/split-nrf52dk.ld                 |   4 +-
 .../arch/cortex_m4/gcc_startup_nrf52_split.s    |   5 +-
 hw/bsp/nrf52dk/src/hal_bsp.c                    |   4 +-
 hw/bsp/nrf52dk/syscfg.yml                       |  35 +-
 hw/bsp/nucleo-f401re/pkg.yml                    |   3 +
 hw/bsp/nucleo-f401re/src/hal_bsp.c              |   4 +
 hw/bsp/nucleo-f401re/syscfg.yml                 |  14 +-
 hw/bsp/olimex_stm32-e407_devboard/pkg.yml       |   3 +
 .../run_from_flash.ld                           | 204 ------
 .../run_from_loader.ld                          | 210 ------
 .../olimex_stm32-e407_devboard/run_from_sram.ld | 202 ------
 hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c |  48 +-
 hw/bsp/olimex_stm32-e407_devboard/syscfg.yml    |  21 +-
 hw/bsp/rb-nano2/pkg.yml                         |   3 +
 hw/bsp/rb-nano2/split-rb-nano2.ld               |   4 +-
 .../arch/cortex_m4/gcc_startup_nrf52_split.s    |   4 +
 hw/bsp/rb-nano2/src/hal_bsp.c                   |  12 +
 hw/bsp/rb-nano2/syscfg.yml                      |  27 +-
 hw/bsp/stm32f4discovery/pkg.yml                 |   3 +
 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/stm32f4discovery/src/hal_bsp.c           |   4 +
 hw/bsp/stm32f4discovery/syscfg.yml              |   5 +-
 hw/bsp/usbmkw41z/boot-mkw41z512.ld              |   4 +-
 hw/bsp/usbmkw41z/mkw41z512.ld                   |   4 +-
 hw/bsp/usbmkw41z/syscfg.yml                     |   2 +-
 hw/drivers/nimble/nrf51/src/ble_hw.c            |  12 +-
 hw/drivers/nimble/nrf52/src/ble_hw.c            |  12 +-
 hw/hal/include/hal/hal_system.h                 |  16 +-
 hw/mcu/native/pkg.yml                           |   2 +-
 hw/mcu/native/src/hal_system.c                  |   3 +-
 hw/mcu/nordic/nrf51xxx/nrf51.ld                 |   4 +-
 hw/mcu/nordic/nrf51xxx/src/hal_i2c.c            |   4 +-
 hw/mcu/nordic/nrf51xxx/src/hal_system_start.c   |  27 +
 hw/mcu/nordic/nrf52xxx/nrf52.ld                 |   4 +-
 hw/mcu/nordic/nrf52xxx/src/hal_i2c.c            |   4 +-
 hw/mcu/nordic/nrf52xxx/src/hal_system_start.c   |  29 +-
 hw/mcu/nxp/MK64F12/src/hal_flash.c              |  57 +-
 hw/mcu/nxp/MK64F12/src/hal_uart.c               | 144 +++--
 hw/mcu/stm/stm32f4xx/stm32f401.ld               |   8 +-
 hw/mcu/stm/stm32f4xx/stm32f407.ld               |   8 +-
 kernel/os/include/os/endian.h                   | 159 ++++-
 kernel/os/include/os/os.h                       |   2 +-
 kernel/os/include/os/os_eventq.h                |   2 -
 kernel/os/include/os/os_fault.h                 |  24 +-
 kernel/os/include/os/os_sched.h                 |   2 +-
 kernel/os/include/os/os_task.h                  |   5 +-
 kernel/os/src/arch/cortex_m4/m4/HAL_CM4.s       |  18 +-
 kernel/os/src/arch/cortex_m4/os_arch_arm.c      |  13 +
 kernel/os/src/arch/cortex_m4/os_fault.c         |  26 +-
 kernel/os/src/endian.c                          | 218 +++++++
 kernel/os/src/os.c                              |  28 +-
 kernel/os/src/os_dev.c                          |  44 +-
 kernel/os/src/os_eventq.c                       |  47 +-
 kernel/os/src/os_mempool.c                      |   8 +
 kernel/os/src/os_msys_init.c                    |   1 +
 kernel/os/src/os_sched.c                        |  15 +-
 kernel/os/src/os_task.c                         |  11 +-
 kernel/os/syscfg.yml                            |  26 +-
 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 +-
 kernel/os/test/src/mempool_test.c               |   2 +-
 kernel/os/test/src/mutex_test.c                 |   2 +-
 kernel/os/test/src/os_test.c                    |   2 +-
 kernel/os/test/src/os_test_priv.h               |  16 +-
 kernel/os/test/src/sem_test.c                   |   2 +-
 .../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 -
 libc/baselibc/pkg.yml                           |   3 +-
 libc/baselibc/src/start.c                       |   5 +-
 mgmt/imgmgr/include/imgmgr/imgmgr.h             |  10 +-
 mgmt/imgmgr/src/imgmgr.c                        |  17 +-
 mgmt/imgmgr/src/imgmgr_fs.c                     | 233 -------
 mgmt/imgmgr/src/imgmgr_priv.h                   |   9 -
 mgmt/imgmgr/syscfg.yml                          |   7 +-
 mgmt/mgmt/include/mgmt/mgmt.h                   |   3 +-
 mgmt/newtmgr/include/newtmgr/newtmgr.h          |  13 +-
 mgmt/newtmgr/nmgr_os/src/newtmgr_os.c           |   2 +-
 mgmt/newtmgr/src/newtmgr.c                      |  24 +-
 mgmt/newtmgr/transport/nmgr_shell/pkg.yml       |   2 +-
 mgmt/newtmgr/transport/nmgr_uart/pkg.yml        |   1 +
 .../newtmgr/transport/nmgr_uart/src/nmgr_uart.c |  44 +-
 mgmt/newtmgr/transport/nmgr_uart/syscfg.yml     |   2 +-
 mgmt/oicmgr/src/oicmgr.c                        |   1 +
 .../mn_socket/test/src/testcases/socket_tests.c |   2 +-
 net/nimble/controller/src/ble_ll.c              |   4 +-
 net/nimble/controller/src/ble_ll_adv.c          |  24 +-
 net/nimble/controller/src/ble_ll_conn.c         |  22 +-
 net/nimble/controller/src/ble_ll_conn_hci.c     | 118 ++--
 net/nimble/controller/src/ble_ll_ctrl.c         | 116 ++--
 net/nimble/controller/src/ble_ll_hci.c          |  34 +-
 net/nimble/controller/src/ble_ll_hci_ev.c       |  44 +-
 net/nimble/controller/src/ble_ll_resolv.c       |   2 +-
 net/nimble/controller/src/ble_ll_scan.c         |   8 +-
 net/nimble/controller/syscfg.yml                |  35 +-
 net/nimble/host/include/host/ble_gap.h          |  61 +-
 net/nimble/host/include/host/ble_gatt.h         |   4 +-
 net/nimble/host/include/host/ble_hs.h           |   4 +
 net/nimble/host/include/host/ble_hs_adv.h       |  64 +-
 net/nimble/host/include/host/ble_hs_id.h        |   3 +-
 net/nimble/host/include/host/ble_l2cap.h        | 114 ++++
 net/nimble/host/include/host/ble_store.h        |  23 +-
 net/nimble/host/pts/pts-gatt.txt                |   4 +-
 .../host/services/gatt/src/ble_svc_gatt.c       |   4 +-
 net/nimble/host/src/ble_att.c                   |  38 +-
 net/nimble/host/src/ble_att_clt.c               |  16 +-
 net/nimble/host/src/ble_att_priv.h              |   1 +
 net/nimble/host/src/ble_att_svr.c               |  23 +-
 net/nimble/host/src/ble_eddystone.c             |   9 +-
 net/nimble/host/src/ble_gap.c                   | 480 ++++++--------
 net/nimble/host/src/ble_gap_priv.h              |   9 +-
 net/nimble/host/src/ble_gattc.c                 |  24 +-
 net/nimble/host/src/ble_gatts.c                 |  30 +-
 net/nimble/host/src/ble_hs.c                    |   3 +-
 net/nimble/host/src/ble_hs_adv.c                | 272 +++++---
 net/nimble/host/src/ble_hs_adv_priv.h           |   6 +-
 net/nimble/host/src/ble_hs_conn.c               |  59 +-
 net/nimble/host/src/ble_hs_conn_priv.h          |  25 +-
 net/nimble/host/src/ble_hs_dbg.c                |  72 +--
 net/nimble/host/src/ble_hs_hci.c                |  10 +-
 net/nimble/host/src/ble_hs_hci_cmd.c            | 110 ++--
 net/nimble/host/src/ble_hs_hci_evt.c            |  60 +-
 net/nimble/host/src/ble_hs_hci_util.c           |   8 +-
 net/nimble/host/src/ble_hs_id.c                 |  38 +-
 net/nimble/host/src/ble_hs_misc.c               |  18 +-
 net/nimble/host/src/ble_hs_priv.h               |   1 +
 net/nimble/host/src/ble_hs_startup.c            |   2 +-
 net/nimble/host/src/ble_ibeacon.c               |   4 +-
 net/nimble/host/src/ble_l2cap.c                 | 136 ++--
 net/nimble/host/src/ble_l2cap_coc.c             | 131 ++++
 net/nimble/host/src/ble_l2cap_coc_priv.h        |  68 ++
 net/nimble/host/src/ble_l2cap_priv.h            |  39 +-
 net/nimble/host/src/ble_l2cap_sig.c             | 563 +++++++++++++++-
 net/nimble/host/src/ble_l2cap_sig_cmd.c         |  63 +-
 net/nimble/host/src/ble_l2cap_sig_priv.h        |  44 +-
 net/nimble/host/src/ble_sm.c                    | 475 ++++++++------
 net/nimble/host/src/ble_sm_alg.c                |   2 +-
 net/nimble/host/src/ble_sm_cmd.c                | 633 +-----------------
 net/nimble/host/src/ble_sm_lgcy.c               |  98 ++-
 net/nimble/host/src/ble_sm_priv.h               | 123 +---
 net/nimble/host/src/ble_sm_sc.c                 | 189 +++---
 net/nimble/host/src/ble_store.c                 |  31 +-
 net/nimble/host/src/ble_uuid.c                  |  11 +-
 net/nimble/host/store/ram/src/ble_store_ram.c   |  23 +-
 net/nimble/host/syscfg.yml                      |  12 +
 net/nimble/host/test/src/ble_att_clt_test.c     |  26 +-
 net/nimble/host/test/src/ble_att_svr_test.c     |  41 +-
 net/nimble/host/test/src/ble_gap_test.c         | 560 ++++++++--------
 net/nimble/host/test/src/ble_gatt_disc_c_test.c |   4 +-
 net/nimble/host/test/src/ble_gatt_disc_d_test.c |   2 +-
 net/nimble/host/test/src/ble_gatt_disc_s_test.c |   8 +-
 net/nimble/host/test/src/ble_gatt_find_s_test.c |  10 +-
 net/nimble/host/test/src/ble_gatt_read_test.c   |   2 +-
 .../host/test/src/ble_gatts_notify_test.c       |   6 +-
 net/nimble/host/test/src/ble_hs_adv_test.c      | 640 +++++++------------
 net/nimble/host/test/src/ble_hs_conn_test.c     |  49 +-
 net/nimble/host/test/src/ble_hs_hci_test.c      |   4 +-
 net/nimble/host/test/src/ble_hs_test_util.c     | 185 ++++--
 net/nimble/host/test/src/ble_hs_test_util.h     |  16 +-
 net/nimble/host/test/src/ble_l2cap_test.c       |  38 +-
 net/nimble/host/test/src/ble_os_test.c          |  29 +-
 net/nimble/host/test/src/ble_sm_lgcy_test.c     |  28 +-
 net/nimble/host/test/src/ble_sm_sc_test.c       |  52 +-
 net/nimble/host/test/src/ble_sm_test_util.c     | 390 +++++++++--
 net/nimble/include/nimble/ble.h                 |  68 +-
 net/nimble/src/util.c                           | 219 -------
 net/nimble/transport/uart/syscfg.yml            |  18 +-
 net/oic/pkg.yml                                 |   3 +
 net/oic/src/api/oc_buffer.c                     |   1 +
 net/oic/src/port/mynewt/adaptor.c               |   9 +-
 net/oic/src/port/mynewt/ble_adaptor.c           |   2 +-
 net/wifi/wifi_mgmt/syscfg.yml                   |   2 +-
 sys/config/pkg.yml                              |   2 +-
 sys/config/src/config_fcb.c                     |   2 -
 sys/config/src/config_init.c                    |  30 +-
 sys/config/syscfg.yml                           |  20 +-
 .../src/testcases/config_test_compress_reset.c  |   2 +
 .../src/testcases/config_test_empty_fcb.c       |   1 +
 .../src/testcases/config_test_save_1_fcb.c      |   1 +
 .../src/testcases/config_test_save_2_fcb.c      |   1 +
 .../src/testcases/config_test_save_3_fcb.c      |   1 +
 .../src/testcases/config_test_save_one_fcb.c    |   1 +
 sys/console/full/pkg.yml                        |   2 +-
 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 +
 sys/flash_map/include/flash_map/flash_map.h     |  13 +-
 sys/flash_map/pkg.yml                           |   2 +-
 sys/flash_map/src/flash_map.c                   |  45 +-
 sys/flash_map/syscfg.yml                        |   2 +-
 .../test/src/testcases/flash_map_test_case_1.c  |   6 +-
 .../test/src/testcases/flash_map_test_case_2.c  |   6 +-
 sys/log/full/include/log/log.h                  |  47 +-
 sys/log/full/src/log.c                          | 108 +++-
 sys/log/full/src/log_cbmem.c                    |  12 +-
 sys/log/full/src/log_console.c                  |   9 +-
 sys/log/full/src/log_fcb.c                      |  19 +-
 sys/log/full/src/log_nmgr.c                     |  47 +-
 sys/log/full/src/log_shell.c                    |   3 +-
 sys/log/full/syscfg.yml                         |  12 +-
 sys/log/full/test/src/log_test.c                |   6 +-
 sys/log/full/test/src/log_test.h                |   8 +-
 sys/log/full/test/src/testcases/log_flush_fcb.c |   4 +-
 sys/log/full/test/src/testcases/log_walk_fcb.c  |   4 +-
 sys/mfg/include/mfg/mfg.h                       |   9 +
 sys/reboot/include/reboot/log_reboot.h          |   3 +-
 sys/reboot/pkg.yml                              |   1 -
 sys/reboot/src/log_reboot.c                     |  31 +-
 sys/reboot/syscfg.yml                           |  12 +-
 sys/shell/src/shell.c                           |   3 +-
 sys/shell/syscfg.yml                            |   4 +-
 sys/stats/full/pkg.yml                          |   2 +-
 sys/stats/stub/include/stats/stats.h            |   2 +-
 test/crash_test/syscfg.yml                      |   4 +-
 test/flash_test/src/flash_test/flash_test.c     |  20 +-
 test/runtest/include/runtest/runtest.h          |   5 +
 test/runtest/pkg.yml                            |   3 +-
 test/runtest/src/runtest.c                      |  19 +
 test/runtest/src/runtest_nmgr.c                 |   8 -
 test/runtest/syscfg.yml                         |   4 +-
 test/testutil/src/testutil.c                    |   2 +-
 373 files changed, 10914 insertions(+), 6393 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d21ef0fd/net/oic/src/api/oc_buffer.c
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d21ef0fd/net/oic/src/port/mynewt/ble_adaptor.c
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d21ef0fd/sys/shell/src/shell.c
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d21ef0fd/sys/shell/syscfg.yml
----------------------------------------------------------------------


[17/50] incubator-mynewt-core git commit: This closes #174.

Posted by vi...@apache.org.
This closes #174.

Merge remote-tracking branch 'andrzej-kaczmarek/nimble/cleanup' into develop

* andrzej-kaczmarek/nimble/cleanup:
  apps/blesplit: Fix build after ble_uuid and ble_addr changes
  nimble: Cleanup address types usage


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

Branch: refs/heads/sensors_branch
Commit: 57a5bb60278ecf84b991042057561111750b2fcf
Parents: 8b510e9 605955c
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Feb 13 11:33:37 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Feb 13 11:33:37 2017 -0800

----------------------------------------------------------------------
 apps/blecent/src/main.c                     |  4 ++--
 apps/bleprph_oic/src/main.c                 |  2 +-
 apps/blesplit/src/main.c                    | 14 +++++++-------
 apps/bleuart/src/main.c                     |  2 +-
 apps/ocf_sample/src/ocf_ble.c               |  2 +-
 net/nimble/host/src/ble_hs_id.c             |  8 ++++----
 net/nimble/host/src/ble_hs_misc.c           | 12 ++++++------
 net/nimble/host/test/src/ble_gap_test.c     | 24 ++++++++++++------------
 net/nimble/host/test/src/ble_hs_test_util.c |  2 +-
 net/nimble/host/test/src/ble_os_test.c      |  2 +-
 net/nimble/host/test/src/ble_sm_lgcy_test.c | 24 ++++++++++++------------
 net/nimble/host/test/src/ble_sm_sc_test.c   | 24 ++++++++++++------------
 12 files changed, 60 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/57a5bb60/apps/bleprph_oic/src/main.c
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/57a5bb60/apps/blesplit/src/main.c
----------------------------------------------------------------------
diff --cc apps/blesplit/src/main.c
index 711803f,ade8019..8c349c1
--- a/apps/blesplit/src/main.c
+++ b/apps/blesplit/src/main.c
@@@ -51,24 -51,24 +51,24 @@@ static voi
  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);
+                 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);
+                 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);
+                 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);
+                 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);
  }
  
  /**

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/57a5bb60/net/nimble/host/test/src/ble_hs_test_util.c
----------------------------------------------------------------------


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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 0724409d0bc0ec8cd0ece1937eb4802ecf474ba2
Parents: 35b0a91 0f1ec97
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 9 16:40:17 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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(-)
----------------------------------------------------------------------



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

Posted by vi...@apache.org.
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/sensors_branch
Commit: 0112f46afa912d63c8560e68dd41e739256f9346
Parents: fa6cc19
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 16:36:20 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
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 NRF51'
         value: 1
 
     XTAL_32768_SYNTH:
-        description: 'TBD'
+        description: 'Synthesize 32k clock.'
         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: 24
     UART_0_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART0'
         value: 25
     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
 
     SPI_0_MASTER:
-        description: 'SPI 0 master'
+        description: 'Whether to enable SPI 0 in master mode'
         value:  0
     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'
+        description: 'Whether to enable SPI 1 in slave mode'
         value:  0
-        restrictions:
-            - "!SPI_1_MASTER"
 
     TIMER_0:
         description: 'NRF51 Timer 0'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0112f46a/hw/bsp/bmd200/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/bmd200/syscfg.yml b/hw/bsp/bmd200/syscfg.yml
index d9650d9..8890a38 100644
--- a/hw/bsp/bmd200/syscfg.yml
+++ b/hw/bsp/bmd200/syscfg.yml
@@ -21,30 +21,35 @@
 
 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: 0
+        restrictions:
+            - "!XTAL_32768_SYNTH"
+
     XTAL_32768_SYNTH:
-        description: 'TBD'
+        description: 'Synthesize 32k clock.'
         value: 1
+        restrictions:
+            - "!XTAL_32768"
 
     UART_0:
-        description: 'TBD'
+        description: 'Whether to enable UART0'
         value: 1
     UART_0_PIN_TX:
-        description: 'TBD'
+        description: 'TX pin for UART0'
         value: 10
     UART_0_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART0'
         value: 9
     UART_0_PIN_RTS:
-        description: 'TBD'
+        description: 'RTS pin for UART0'
         value: 11
     UART_0_PIN_CTS:
-        description: 'TBD'
+        description: 'CTS pin for UART0'
         value: 8
 
     SPI_0_MASTER:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0112f46a/hw/bsp/bmd300eval/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/bmd300eval/syscfg.yml b/hw/bsp/bmd300eval/syscfg.yml
index 02b29e0..0018ee1 100644
--- a/hw/bsp/bmd300eval/syscfg.yml
+++ b/hw/bsp/bmd300eval/syscfg.yml
@@ -21,32 +21,38 @@
 
 syscfg.defs:
     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:  6
     UART_0_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART0'
         value:  8
     UART_0_PIN_RTS:
-        description: 'TBD'
+        description: 'RTS pin for UART0'
         value:  5
     UART_0_PIN_CTS:
-        description: 'TBD'
+        description: 'CTS pin for UART0'
         value:  7
 
     UART_1:
-        description: 'Bitbanger UART'
+        description: 'Whether to enable bitbanger UART1'
         value:  0
+    UART_1_PIN_TX:
+        description: 'TX pin for UART1'
+        value:  -1
+    UART_1_PIN_RX:
+        description: 'RX pin for UART1'
+        value:  -1
 
     SPI_0_MASTER:
         description: 'SPI 0 master'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0112f46a/hw/bsp/ci40/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/ci40/syscfg.yml b/hw/bsp/ci40/syscfg.yml
index ffed5aa..ddcf459 100644
--- a/hw/bsp/ci40/syscfg.yml
+++ b/hw/bsp/ci40/syscfg.yml
@@ -25,9 +25,9 @@ syscfg.defs:
         value:  546000000ul
 
     UART_0:
-        description: 'TBD'
+        description: 'Whether to enable UART0'
         value:  1
 
     UART_1:
-        description: 'TBD'
+        description: 'Whether to enable UART1'
         value:  1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0112f46a/hw/bsp/frdm-k64f/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/frdm-k64f/syscfg.yml b/hw/bsp/frdm-k64f/syscfg.yml
index c6c8e30..5b26863 100644
--- a/hw/bsp/frdm-k64f/syscfg.yml
+++ b/hw/bsp/frdm-k64f/syscfg.yml
@@ -21,109 +21,109 @@
 
 syscfg.defs:
     BSP_MK64F12:
-        description: 'TBD'
+        description: 'Set to indicate that BSP has NXP MK64F12'
         value: 1
 
     # UART0 PINS on CMSIS-DAP Interface
     UART_0:
-        description: 'TBD'
+        description: 'Whether to enable UART0'
         value:  1
     UART_0_PORT:
-        description: 'TBD'
+        description: 'GPIO port for UART0 pins'
         value:  PORTB
     UART_0_PORT_CLOCK:
-        description: 'TBD'
+        description: 'Clock to enable for UART0 pins'
         value:  kCLOCK_PortB
     UART_0_PIN_TX:
-        description: 'TBD'
+        description: 'TX pin for UART0'
         value:  16
     UART_0_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART0'
         value:  17
 
     # PINS conflict with SPI0 must choose 1
     UART_1:
-        description: 'TBD'
+        description: 'Whether to enable UART1'
         value:  0
     UART_1_PORT:
-        description: 'TBD'
+        description: 'GPIO port for UART1 pins'
         value:  PORTC
     UART_1_PORT_CLOCK:
-        description: 'TBD'
+        description: 'Clock to enable for UART1 pins'
         value:  kCLOCK_PortC
     UART_1_PIN_TX:
-        description: 'TBD'
+        description: 'TX pin for UART1'
         value:  3
     UART_1_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART1x'
         value:  4
 
     # PINS conflict with SPI0 must choose 1
     UART_2:
-        description: 'TBD'
+        description: 'Whether to enable UART2'
         value:  0
     UART_2_PORT:
-        description: 'TBD'
+        description: 'GPIO port for UART2 pins'
         value:  PORTD
     UART_2_PORT_CLOCK:
-        description: 'TBD'
+        description: 'Clock to enable for UART2 pins'
         value:  kCLOCK_PortD
     UART_2_PIN_TX:
-        description: 'TBD'
+        description: 'TX pin for UART2'
         value:  2
     UART_2_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART2'
         value:  3
 
     # PINS conflict with ENET0 must choose 1
     UART_3:
-        description: 'TBD'
+        description: 'Whether to enable UART3'
         value:  0
     UART_3_PORT:
-        description: 'TBD'
+        description: 'GPIO port for UART3 pins'
         value:  PORTC
     UART_3_PORT_CLOCK:
-        description: 'TBD'
+        description: 'Clock to enable for UART3 pins'
         value:  kCLOCK_PortC
     UART_3_PIN_TX:
-        description: 'TBD'
+        description: 'TX pin for UART3'
         value:  16
     UART_3_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART3'
         value:  17
 
     # PINS conflict with ENET0 must choose 1
     UART_4:
-        description: 'TBD'
+        description: 'Whether to enable UART4'
         value:  0
     UART_4_PORT:
-        description: 'TBD'
+        description: 'GPIO port for UART4 pins'
         value:  PORTC
     UART_4_PORT_CLOCK:
-        description: 'TBD'
+        description: 'Clock to enable for UART4 pins'
         value:  kCLOCK_PortC
     UART_4_PIN_TX:
-        description: 'TBD'
+        description: 'TX pin for UART4'
         value:  14
     UART_4_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART4'
         value:  15
 
     # PINS conflict with I2S0 must choose 1
     UART_5:
-        description: 'TBD'
+        description: 'Whether to enable UART5'
         value:  0
     UART_5_PORT:
-        description: 'TBD'
+        description: 'GPIO port for UART5 pins'
         value:  PORTE
     UART_5_PORT_CLOCK:
-        description: 'TBD'
+        description: 'Clock to enable for UART5 pins'
         value:  kCLOCK_PortE
     UART_5_PIN_TX:
-        description: 'TBD'
+        description: 'TX pin for UART5'
         value:  9
     UART_5_PIN_RX:
-        description: 'TBD'
+        description: 'RX pin for UART5'
         value:  8
 
 syscfg.vals:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0112f46a/hw/bsp/nrf51-arduino_101/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-arduino_101/syscfg.yml b/hw/bsp/nrf51-arduino_101/syscfg.yml
index c513e26..9491b6d 100644
--- a/hw/bsp/nrf51-arduino_101/syscfg.yml
+++ b/hw/bsp/nrf51-arduino_101/syscfg.yml
@@ -21,31 +21,28 @@
 
 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: 12
     UART_0_PIN_CTS:
-        description: 'TBD'
+        description: 'CTS pin for UART0'
         value: 10
-    UART_1:
-        description: 'TBD'
-        value:  0
 
     SPI_0_MASTER:
         description: 'SPI 0 master'
@@ -53,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:  1
-        restrictions:
-            - "!SPI_1_MASTER"
 
     TIMER_0:
         description: 'NRF51 Timer 0'