You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2017/02/08 21:49:37 UTC

[01/13] incubator-mynewt-core git commit: nimble/host: Add generic BD address type

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 1d2d46b82 -> 4719b3f50


nimble/host: Add generic BD address type

Just a few minor fixes as the BLE_ADDR_TYPE_xxx macros were renamed BLE_ADDR_xxx
but not updated in all 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/6f99c8cc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/6f99c8cc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/6f99c8cc

Branch: refs/heads/develop
Commit: 6f99c8cc14f41a4381ebf5fcb035f6ac66e94c8e
Parents: ad4050f
Author: William San Filippo <wi...@runtime.io>
Authored: Wed Feb 1 14:50:52 2017 -0800
Committer: William San Filippo <wi...@runtime.io>
Committed: Wed Feb 1 14:50:52 2017 -0800

----------------------------------------------------------------------
 apps/blesplit/src/main.c             | 2 +-
 apps/bletest/src/main.c              | 2 +-
 apps/ocf_sample/src/ocf_ble.c        | 2 +-
 hw/drivers/nimble/nrf51/src/ble_hw.c | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6f99c8cc/apps/blesplit/src/main.c
----------------------------------------------------------------------
diff --git a/apps/blesplit/src/main.c b/apps/blesplit/src/main.c
index 4643e1c..020934f 100755
--- a/apps/blesplit/src/main.c
+++ b/apps/blesplit/src/main.c
@@ -127,7 +127,7 @@ blesplit_advertise(void)
     memset(&adv_params, 0, sizeof adv_params);
     adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
     adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
-    rc = ble_gap_adv_start(BLE_ADDR_TYPE_PUBLIC, 0, NULL, BLE_HS_FOREVER,
+    rc = ble_gap_adv_start(BLE_ADDR_PUBLIC, 0, NULL, BLE_HS_FOREVER,
                            &adv_params, blesplit_gap_event, NULL);
     if (rc != 0) {
         BLESPLIT_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6f99c8cc/apps/bletest/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletest/src/main.c b/apps/bletest/src/main.c
index 79f7e98..d56ec2b 100755
--- a/apps/bletest/src/main.c
+++ b/apps/bletest/src/main.c
@@ -649,7 +649,7 @@ bletest_init_scanner(void)
 #endif
         if (add_whitelist & 1) {
             rc = bletest_hci_le_add_to_whitelist(g_bletest_cur_peer_addr,
-                                                 BLE_ADDR_TYPE_RANDOM);
+                                                 BLE_ADDR_RANDOM);
             assert(rc == 0);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6f99c8cc/apps/ocf_sample/src/ocf_ble.c
----------------------------------------------------------------------
diff --git a/apps/ocf_sample/src/ocf_ble.c b/apps/ocf_sample/src/ocf_ble.c
index 21e015a..e52155d 100644
--- a/apps/ocf_sample/src/ocf_ble.c
+++ b/apps/ocf_sample/src/ocf_ble.c
@@ -145,7 +145,7 @@ ocf_ble_advertise(void)
     memset(&adv_params, 0, sizeof adv_params);
     adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
     adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
-    rc = ble_gap_adv_start(BLE_ADDR_TYPE_PUBLIC, 0, NULL, BLE_HS_FOREVER,
+    rc = ble_gap_adv_start(BLE_ADDR_PUBLIC, 0, NULL, BLE_HS_FOREVER,
                            &adv_params, ocf_ble_gap_event, NULL);
     if (rc != 0) {
         OCF_BLE_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6f99c8cc/hw/drivers/nimble/nrf51/src/ble_hw.c
----------------------------------------------------------------------
diff --git a/hw/drivers/nimble/nrf51/src/ble_hw.c b/hw/drivers/nimble/nrf51/src/ble_hw.c
index bbd2a50..9f268cc 100644
--- a/hw/drivers/nimble/nrf51/src/ble_hw.c
+++ b/hw/drivers/nimble/nrf51/src/ble_hw.c
@@ -88,7 +88,7 @@ ble_hw_whitelist_add(uint8_t *addr, uint8_t addr_type)
         if ((mask & g_ble_hw_whitelist_mask) == 0) {
             NRF_RADIO->DAB[i] = get_le32(addr);
             NRF_RADIO->DAP[i] = get_le16(addr + 4);
-            if (addr_type == BLE_ADDR_TYPE_RANDOM) {
+            if (addr_type == BLE_ADDR_RANDOM) {
                 NRF_RADIO->DACNF |= (mask << 8);
             }
             g_ble_hw_whitelist_mask |= mask;
@@ -126,7 +126,7 @@ ble_hw_whitelist_rmv(uint8_t *addr, uint8_t addr_type)
         if (mask & g_ble_hw_whitelist_mask) {
             if ((dab == NRF_RADIO->DAB[i]) && (dap == NRF_RADIO->DAP[i])) {
                 cfg_addr = txadd & mask;
-                if (addr_type == BLE_ADDR_TYPE_RANDOM) {
+                if (addr_type == BLE_ADDR_RANDOM) {
                     if (cfg_addr != 0) {
                         break;
                     }


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

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


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

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

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



[12/13] incubator-mynewt-core git commit: boot_serial; fix build for unittest.

Posted by ma...@apache.org.
boot_serial; fix build for unittest.


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

Branch: refs/heads/develop
Commit: de35d2337189a69d97aa3fdccc4f7bfaeb31efc9
Parents: b9a8ae7
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Mon Feb 6 16:40:11 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Mon Feb 6 16:40:11 2017 -0800

----------------------------------------------------------------------
 boot/boot_serial/pkg.yml | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/de35d233/boot/boot_serial/pkg.yml
----------------------------------------------------------------------
diff --git a/boot/boot_serial/pkg.yml b/boot/boot_serial/pkg.yml
index 544c63a..660eb2c 100644
--- a/boot/boot_serial/pkg.yml
+++ b/boot/boot_serial/pkg.yml
@@ -38,6 +38,11 @@ pkg.deps:
 pkg.req_apis:
     - console
 
+pkg.cflags.SELFTEST:
+    - -DBOOT_SERIAL_DETECT_PIN=0
+    - -DBOOT_SERIAL_DETECT_PIN_VAL=1
+    - -DBOOT_SERIAL_DETECT_PIN_CFG=0
+
 pkg.init:
     boot_serial_os_dev_init: 0
     boot_serial_pkg_init: 200


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

Posted by ma...@apache.org.
stm32f4discovery; allow building bootloader without uart0.


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

Branch: refs/heads/develop
Commit: 2b124b6765a87df1f26a93b6df90654c1376cbd9
Parents: 39e6125
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 2 15:12:52 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Feb 2 15:12:52 2017 -0800

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


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


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

Posted by ma...@apache.org.
blesplit - Fix compiler errs after host API chg.


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

Branch: refs/heads/develop
Commit: 0d848ae98a5ec8b222814c59e7fb3d51d370072b
Parents: 6f99c8c
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Feb 2 14:12:00 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Feb 2 14:12:00 2017 -0800

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


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


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

Posted by ma...@apache.org.
MYNEWT-618; bootloader was not calling hal_bsp_init(), so
uart was not getting initialized.
Watchdog needs to be tickled from within serial downloader.


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

Branch: refs/heads/develop
Commit: 2c909377d4b3f1e1e9b886c061e48baf9ba7a2fb
Parents: d484e46
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 3 15:44:27 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Feb 3 15:44:27 2017 -0800

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


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

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

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


[10/13] incubator-mynewt-core git commit: MYNEWT-618; add a gpio for testing serial bootloader with nrf52dk.

Posted by ma...@apache.org.
MYNEWT-618; add a gpio for testing serial bootloader with nrf52dk.


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

Branch: refs/heads/develop
Commit: 6b0d977c3d3c9b78b7124c46c66a33c2f26cb699
Parents: 2c90937
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 3 15:51:20 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Feb 3 15:51:20 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6b0d977c/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 7c6df66..2805a6c 100644
--- a/hw/bsp/nrf52dk/include/bsp/bsp.h
+++ b/hw/bsp/nrf52dk/include/bsp/bsp.h
@@ -22,6 +22,8 @@
 
 #include <inttypes.h>
 
+#include <syscfg/syscfg.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -44,6 +46,12 @@ extern uint8_t _ram_start;
 /* UART info */
 #define CONSOLE_UART    "uart0"
 
+#if MYNEWT_VAL(BOOT_SERIAL)
+#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
+#endif
+
 #define NFFS_AREA_MAX   (8)
 
 #ifdef __cplusplus


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

Posted by ma...@apache.org.
nucleo-f401re; fix build for bootloader.


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

Branch: refs/heads/develop
Commit: 39e61255baa421670bc94015faad8eda0eb379ff
Parents: 196cf7d
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 2 14:58:36 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Feb 2 14:58:36 2017 -0800

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


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


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

Posted by ma...@apache.org.
kernel/os; rename macro __bswap_XX -> os_bswap_XX.
__bswap_32() is an inline function in Linux system headers,
and causes trouble with simulator builds.


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

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

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


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


[08/13] incubator-mynewt-core git commit: README.md; first take at updating the list of BSPs/features.

Posted by ma...@apache.org.
README.md; first take at updating the list of BSPs/features.


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

Branch: refs/heads/develop
Commit: d484e468da99350b8d8ef9e2db486208f5262dc9
Parents: f08ca0c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 2 20:36:26 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Feb 2 20:36:26 2017 -0800

----------------------------------------------------------------------
 README.md | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d484e468/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 12c8227..29c7beb 100644
--- a/README.md
+++ b/README.md
@@ -35,12 +35,14 @@ It currently supports the following hardware platforms:
 * BLE Nano from RedBear (Nordic nRF51822 SoC based)
 * BLE Nano2 and Blend2 from RedBear (Nordic nRF52832 SoC based)
 * BMD-300-EVAL-ES from Rigado (Cortex-M4)
-* STM32F3DISCOVERY from ST Micro (Cortex-M4)
+* BMD-200 from Rigado (Cortex-M0)
 * STM32F4DISCOVERY from ST Micro (Cortex-M4)
 * STM32-E407 from Olimex (Cortex-M4)
 * Arduino Zero (Cortex-M0)
 * Arduino Zero Pro (Cortex-M0)
 * Arduino M0 Pro (Cortex-M0)
+* Arduino MKR1000 (Cortex-M0)
+* Arduino Primo NRF52 (Cortex-M4)
 * NUCLEO-F401RE (Cortex-M4)
 * FRDM-K64F from NXP (Cortex-M4)
 
@@ -59,11 +61,15 @@ completely replaces the proprietary SoftDevice on Nordic chipsets.
     - Support for up to 32 simultaneous connections.
     - Legacy and SC (secure connections) SMP support (pairing and bonding).
 * A flash filesystem, NFFS, which is designed for tiny (128KB->16MB) flashes.
+* FatFS
+* Flash Circular Buffer
+* JSON and CBOR encoding
 * Bootloader support
 * Remote Software Upgrade
 * HAL and BSP infrastructure designed to abstract microcontroller specifics
 * Shell and Console support
 * Statistics and Logging Infrastructure
+* OIC Client and Server
 
 For more information on the Mynewt OS, please visit our website [here](https://mynewt.apache.org/).
 If you'd like to get started, visit the [Quick Start Guide](http://mynewt.apache.org/quick-start/).
@@ -75,6 +81,7 @@ Mynewt is being actively developed.  Some of the features we're currently workin
 * Deep sleep: Mynewt OS will coordinate peripherals and processor to put the
   processor to sleep when all tasks are idle.
 * Sensor API
+* IP Stack
 * Support for different boards and microcontroller architectures, we're working
   on:
     - ESP8266


[04/13] incubator-mynewt-core git commit: nimble/controller; silence compile warning about uninitialized variable.

Posted by ma...@apache.org.
nimble/controller; silence compile warning about uninitialized
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/196cf7d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/196cf7d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/196cf7d4

Branch: refs/heads/develop
Commit: 196cf7d4b6160a6b675a5e579128a8ce7413d84e
Parents: 8c5c8fc
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 2 14:43:55 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Feb 2 14:43:55 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/196cf7d4/net/nimble/controller/src/ble_ll_conn.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_conn.c b/net/nimble/controller/src/ble_ll_conn.c
index 33a54f3..4a96467 100644
--- a/net/nimble/controller/src/ble_ll_conn.c
+++ b/net/nimble/controller/src/ble_ll_conn.c
@@ -2646,7 +2646,7 @@ ble_ll_conn_rx_isr_end(uint8_t *rxbuf, struct ble_mbuf_hdr *rxhdr)
     uint8_t conn_nesn;
     uint8_t reply;
     uint8_t rem_bytes;
-    uint8_t opcode;
+    uint8_t opcode = 0;
     uint8_t rx_pyld_len;
     uint32_t endtime;
     struct os_mbuf *txpdu;


[07/13] incubator-mynewt-core git commit: NOTICE; update copyright to include 2017.

Posted by ma...@apache.org.
NOTICE; update copyright to include 2017.


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

Branch: refs/heads/develop
Commit: f08ca0c02b59e1d95a6bbc12d82ce987f45f24ac
Parents: 2b124b6
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 2 20:35:46 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Feb 2 20:35:46 2017 -0800

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


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


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

Posted by ma...@apache.org.
MYNEWT-619 Splitty - Console does not output

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


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

Branch: refs/heads/develop
Commit: b9a8ae72bcabdd046d4f564905939deeea4fe46b
Parents: 6b0d977
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Feb 6 13:51:46 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Feb 6 13:54:35 2017 -0800

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


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