You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2016/09/23 05:57:07 UTC

[1/3] incubator-mynewt-core git commit: No jira ticket: update the blenano nrf51 bsp

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 6542b3095 -> 96e85a1eb


No jira ticket: update the blenano nrf51 bsp


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

Branch: refs/heads/develop
Commit: e5156a28b8b8a3b6f955d4135bb1c12ca214bef5
Parents: 6542b30
Author: William San Filippo <wi...@runtime.io>
Authored: Thu Sep 22 21:58:10 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Thu Sep 22 22:56:59 2016 -0700

----------------------------------------------------------------------
 hw/bsp/nrf51-blenano/pkg.yml | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e5156a28/hw/bsp/nrf51-blenano/pkg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-blenano/pkg.yml b/hw/bsp/nrf51-blenano/pkg.yml
index 55f3e4d..4699231 100644
--- a/hw/bsp/nrf51-blenano/pkg.yml
+++ b/hw/bsp/nrf51-blenano/pkg.yml
@@ -6,7 +6,7 @@
 # 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,
@@ -35,7 +35,7 @@ pkg.part2linkerscript: "split-nrf51dk.ld"
 pkg.downloadscript: nrf51dk_download.sh
 pkg.debugscript: nrf51dk_debug.sh
 pkg.cflags:
-    # Nordic SDK files require these defines.
+    # Nordic SDK files require this define.
     - '-DNRF51'
 
 pkg.deps:
@@ -61,7 +61,7 @@ pkg.syscfg_defs:
 
     CLOCK_FREQ:
         description: 'TBD'
-        value:  1000000
+        value: 1000000
 
     XTAL_32768:
         description: 'TBD'
@@ -69,20 +69,14 @@ pkg.syscfg_defs:
 
     ADC_0:
         description: 'TBD'
-        value:  0
-    ADC_0_RESOLUTION:
-        description: 'TBD'
-        value: 'SAADC_CONFIG_RESOLUTION'
-    ADC_0_OVERSAMPLE:
-        description: 'TBD'
-        value: 'SAADC_CONFIG_OVERSAMPLE'
+        value: 1
     ADC_0_INTERRUPT_PRIORITY:
         description: 'TBD'
-        value: 'SAADC_CONFIG_IRQ_PRIORITY'
+        value: 'ADC_CONFIG_IRQ_PRIORITY'
 
     UART_0:
         description: 'TBD'
-        value:  1
+        value: 1
     UART_0_PIN_TX:
         description: 'TBD'
         value: 9
@@ -98,7 +92,7 @@ pkg.syscfg_defs:
 
     SPI_MASTER:
         description: 'TBD'
-        value:  0
+        value: 0
     SPI_SLAVE:
         description: 'TBD'
-        value:  0
+        value: 0


[3/3] incubator-mynewt-core git commit: Get arduino primo building

Posted by we...@apache.org.
Get arduino primo building


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

Branch: refs/heads/develop
Commit: 96e85a1eb933ed84b1f00c7ac06f9c78f9a98778
Parents: b2bf7ad
Author: William San Filippo <wi...@runtime.io>
Authored: Thu Sep 22 22:53:37 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Thu Sep 22 22:57:00 2016 -0700

----------------------------------------------------------------------
 hw/bsp/arduino_primo_nrf52/src/os_bsp.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/96e85a1e/hw/bsp/arduino_primo_nrf52/src/os_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/arduino_primo_nrf52/src/os_bsp.c b/hw/bsp/arduino_primo_nrf52/src/os_bsp.c
index 49249c7..6c2c2c4 100644
--- a/hw/bsp/arduino_primo_nrf52/src/os_bsp.c
+++ b/hw/bsp/arduino_primo_nrf52/src/os_bsp.c
@@ -41,9 +41,12 @@
 #include "app_util_platform.h"
 #include "nrf.h"
 #include "app_error.h"
-#include "adc_nrf52/adc_nrf52.h"
 #include "nrf_drv_saadc.h"
 
+#if MYNEWT_VAL(ADC_0)
+#include "adc_nrf52/adc_nrf52.h"
+#endif
+
 static struct flash_area bsp_flash_areas[] = {
     [FLASH_AREA_BOOTLOADER] = {
         .fa_flash_id = 0,       /* internal flash */
@@ -163,8 +166,8 @@ bsp_init(void)
 #endif
 
 #if MYNEWT_VAL(SPI_SLAVE)
-    /*  We initialize one SPI interface as a master. */
-    spi_cfg.csn_pin = SPIS0_CONFIG_CSN_PIN;
+    spi_cfg.csn_pin = SPI_SS_PIN;
+    spi_cfg.csn_pullup = NRF_GPIO_PIN_PULLUP;
     rc = hal_spi_init(0, &spi_cfg, HAL_SPI_TYPE_SLAVE);
     assert(rc == 0);
 #endif


[2/3] incubator-mynewt-core git commit: Bring bmd300 bsp up to date.

Posted by we...@apache.org.
Bring bmd300 bsp up to date.


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

Branch: refs/heads/develop
Commit: b2bf7ada22691526cc33bf864b491b0510eaee12
Parents: e5156a2
Author: William San Filippo <wi...@runtime.io>
Authored: Thu Sep 22 22:22:06 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Thu Sep 22 22:57:00 2016 -0700

----------------------------------------------------------------------
 hw/bsp/bmd300eval/include/bsp/bsp.h            |   5 +-
 hw/bsp/bmd300eval/include/bsp/nrf_drv_config.h |   2 -
 hw/bsp/bmd300eval/pkg.yml                      |  15 ++-
 hw/bsp/bmd300eval/src/os_bsp.c                 | 102 +++++++++++++++++---
 4 files changed, 103 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b2bf7ada/hw/bsp/bmd300eval/include/bsp/bsp.h
----------------------------------------------------------------------
diff --git a/hw/bsp/bmd300eval/include/bsp/bsp.h b/hw/bsp/bmd300eval/include/bsp/bsp.h
index 6edeeb4..a338875 100644
--- a/hw/bsp/bmd300eval/include/bsp/bsp.h
+++ b/hw/bsp/bmd300eval/include/bsp/bsp.h
@@ -6,7 +6,7 @@
  * 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,
@@ -42,7 +42,8 @@ extern uint8_t _ram_start;
 #define LED_BLINK_PIN   (17)
 
 /* UART info */
-#define CONSOLE_UART    0
+#define CONSOLE_UART    "uart0"
+#define CONSOLE_UART_SPEED      115200
 
 #define NFFS_AREA_MAX    (8)
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b2bf7ada/hw/bsp/bmd300eval/include/bsp/nrf_drv_config.h
----------------------------------------------------------------------
diff --git a/hw/bsp/bmd300eval/include/bsp/nrf_drv_config.h b/hw/bsp/bmd300eval/include/bsp/nrf_drv_config.h
index 173193a..653a4de 100644
--- a/hw/bsp/bmd300eval/include/bsp/nrf_drv_config.h
+++ b/hw/bsp/bmd300eval/include/bsp/nrf_drv_config.h
@@ -208,7 +208,6 @@
 
 #if (SPI0_ENABLED == 1)
 #define SPI0_USE_EASY_DMA 1
-#define SPI0_CONFIG_CSN_PIN         22 /* Note: not defined by SDK */
 #define SPI0_CONFIG_SCK_PIN         23
 #define SPI0_CONFIG_MOSI_PIN        24
 #define SPI0_CONFIG_MISO_PIN        25
@@ -249,7 +248,6 @@
 #define SPIS0_ENABLED 1
 
 #if (SPIS0_ENABLED == 1)
-#define SPIS0_CONFIG_CSN_PIN         22 /* Note: not defined by SDK */
 #define SPIS0_CONFIG_SCK_PIN         23
 #define SPIS0_CONFIG_MOSI_PIN        24
 #define SPIS0_CONFIG_MISO_PIN        25

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b2bf7ada/hw/bsp/bmd300eval/pkg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/bmd300eval/pkg.yml b/hw/bsp/bmd300eval/pkg.yml
index 8849cdb..d54aa7f 100644
--- a/hw/bsp/bmd300eval/pkg.yml
+++ b/hw/bsp/bmd300eval/pkg.yml
@@ -83,8 +83,21 @@ pkg.syscfg_defs:
     UART_0:
         description: 'TBD'
         value:  1
-    UART_1:
+    UART_0_PIN_TX:
+        description: 'TBD'
+        value:  6
+    UART_0_PIN_RX:
+        description: 'TBD'
+        value:  8
+    UART_0_PIN_RTS:
         description: 'TBD'
+        value:  5
+    UART_0_PIN_CTS:
+        description: 'TBD'
+        value:  7
+
+    UART_1:
+        description: 'Bitbanger UART'
         value:  0
 
     SPI_MASTER:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b2bf7ada/hw/bsp/bmd300eval/src/os_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/bmd300eval/src/os_bsp.c b/hw/bsp/bmd300eval/src/os_bsp.c
index 4e336be..259701d 100644
--- a/hw/bsp/bmd300eval/src/os_bsp.c
+++ b/hw/bsp/bmd300eval/src/os_bsp.c
@@ -16,18 +16,36 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <assert.h>
-#include <hal/flash_map.h>
-#include <hal/hal_bsp.h>
-#include <hal/hal_spi.h>
-#ifdef BSP_CFG_SPI_MASTER
+
+#include "syscfg/syscfg.h"
+#include "hal/flash_map.h"
+#include "hal/hal_bsp.h"
+#include "hal/hal_cputime.h"
+#include "hal/hal_flash.h"
+#include "hal/hal_spi.h"
+#include "mcu/nrf52_hal.h"
+#include "uart/uart.h"
+#include "uart_hal/uart_hal.h"
+#include "os/os_dev.h"
+#include "bsp.h"
+
+#if MYNEWT_VAL(SPI_MASTER)
 #include "nrf_drv_spi.h"
 #endif
-#ifdef BSP_CFG_SPI_SLAVE
+#if MYNEWT_VAL(SPI_SLAVE)
 #include "nrf_drv_spis.h"
 #endif
 #include "nrf_drv_config.h"
-#include <app_util_platform.h>
+#include "app_util_platform.h"
+#include "nrf.h"
+#include "app_error.h"
+#include "nrf_drv_saadc.h"
+
+#if MYNEWT_VAL(ADC_0)
+#include "adc_nrf52/adc_nrf52.h"
+#endif
 
 static struct flash_area bsp_flash_areas[] = {
     [FLASH_AREA_BOOTLOADER] = {
@@ -58,6 +76,34 @@ static struct flash_area bsp_flash_areas[] = {
     }
 };
 
+#if MYNEWT_VAL(UART_0)
+static struct uart_dev os_bsp_uart0;
+static const struct nrf52_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(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_cputimer_freq = MYNEWT_VAL(CLOCK_FREQ),
+};
+#endif
+
+#if MYNEWT_VAL(ADC_0)
+static struct adc_dev os_bsp_adc0;
+static nrf_drv_saadc_config_t os_bsp_adc0_config = {
+    .resolution         = MYNEWT_VAL(ADC_0_RESOLUTION),
+    .oversample         = MYNEWT_VAL(ADC_0_OVERSAMPLE),
+    .interrupt_priority = MYNEWT_VAL(ADC_0_INTERRUPT_PRIORITY),
+};
+#endif
+
 void _close(int fd);
 
 /*
@@ -87,35 +133,59 @@ void bsp_slot_init_split_application(void) {
 void
 bsp_init(void)
 {
-#ifdef BSP_CFG_SPI_MASTER
     int rc;
+
+#if MYNEWT_VAL(SPI_MASTER)
     nrf_drv_spi_config_t spi_cfg = NRF_DRV_SPI_DEFAULT_CONFIG(0);
 #endif
-#ifdef BSP_CFG_SPI_SLAVE
-    int rc;
+#if MYNEWT_VAL(SPI_SLAVE)
     nrf_drv_spis_config_t spi_cfg = NRF_DRV_SPIS_DEFAULT_CONFIG(0);
 #endif
 
     /*
      * XXX this reference is here to keep this function in.
      */
-    _sbrk(0);
-    _close(0);
+    (void)_sbrk;
+    //(void)_close;
+
+    /* Set cputime to count at 1 usec increments */
+    rc = cputime_init(MYNEWT_VAL(CLOCK_FREQ));
+    assert(rc == 0);
 
     flash_area_init(bsp_flash_areas,
       sizeof(bsp_flash_areas) / sizeof(bsp_flash_areas[0]));
 
-#ifdef BSP_CFG_SPI_MASTER
-    /*  We initialize one SPI interface as a master. */
+    rc = hal_flash_init();
+    assert(rc == 0);
+
+#if MYNEWT_VAL(SPI_MASTER)
     rc = hal_spi_init(0, &spi_cfg, HAL_SPI_TYPE_MASTER);
     assert(rc == 0);
 #endif
 
-#ifdef BSP_CFG_SPI_SLAVE
-    /*  We initialize one SPI interface as a master. */
-    spi_cfg.csn_pin = SPIS0_CONFIG_CSN_PIN;
+#if MYNEWT_VAL(SPI_SLAVE)
+    spi_cfg.csn_pin = SPI_SS_PIN;
     spi_cfg.csn_pullup = NRF_GPIO_PIN_PULLUP;
     rc = hal_spi_init(0, &spi_cfg, HAL_SPI_TYPE_SLAVE);
     assert(rc == 0);
 #endif
+
+#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(UART_1)
+    rc = os_dev_create((struct os_dev *) &os_bsp_bitbang_uart1, "uart1",
+      OS_DEV_INIT_PRIMARY, 0, uart_bitbang_init, (void *)&os_bsp_uart1_cfg);
+    assert(rc == 0);
+#endif
+
+#if MYNEWT_VAL(ADC_0)
+    rc = os_dev_create((struct os_dev *) &os_bsp_adc0, "adc0",
+            OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT,
+            nrf52_adc_dev_init, &os_bsp_adc0_config);
+    assert(rc == 0);
+#endif
 }