[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-06 Thread GitBox


apache-mynewt-bot commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670289247







This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] vrahane edited a comment on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-06 Thread GitBox


vrahane edited a comment on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670280350


   Others are welcome to review as well, I just wanted to add @wes3 and 
@ccollins476ad cause they know about it and helped me get through the hurdles



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] vrahane commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-06 Thread GitBox


vrahane commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670280350


   Others can review as well, I just wanted to add @wes3 and @ccollins476ad 
cause they know about it and helped me get through the hurdles



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] vrahane commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-06 Thread GitBox


vrahane commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670278594


   I will squash all useless commits and keep only the useful ones.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] vrahane opened a new pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-06 Thread GitBox


vrahane opened a new pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348


   - [ ] Make sure works with MCUboot
   - [ ] No TZ and SPM layer, so for now works only in Secure mode, will be 
added later
   - [ ] All memory is Secure only
   - [ ] Tested with Blinky
   - [ ] Tested with Slinky



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2347: docs: Add section about conditional settings

2020-08-06 Thread GitBox


apache-mynewt-bot commented on pull request #2347:
URL: https://github.com/apache/mynewt-core/pull/2347#issuecomment-670259884


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2347: docs: Add section about conditional settings

2020-08-06 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2347:
URL: https://github.com/apache/mynewt-core/pull/2347#issuecomment-670134016


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] ccollins476ad commented on a change in pull request #2347: docs: Add section about conditional settings

2020-08-06 Thread GitBox


ccollins476ad commented on a change in pull request #2347:
URL: https://github.com/apache/mynewt-core/pull/2347#discussion_r466759290



##
File path: docs/os/modules/sysinitconfig/sysinitconfig.rst
##
@@ -352,6 +352,47 @@ use the flash area named ``FLASH_AREA_NFFS`` in the 
``syscfg.yml`` file.
 syscfg.vals:
 NFFS_FLASH_AREA: FLASH_AREA_NFFS
 
+Conditional Settings
+
+
+Setings in most Mynewt YAML files can be made conditional on syscfg
+settings.  For example, a package might depend on a second package
+*only if a syscfg setting has a particular value*.  The condition can
+be the value of a single syscfg setting or an arbitrary expression
+involving many settings.
+
+Examples of Conditional Settings
+
+
+Example 6
+`
+
+In this example, a package depends on `lib/pkg2` only if `MY_SETTING` has a

Review comment:
   Thanks @utzig!  I will need to render this text locally to make sure I 
am not messing up more stuff.
   
   By the way, I just noticed that there already was a "conditional settings" 
section at the bottom of the page!  I think the one I added is a bit better 
because it is more succinct and it talks about using arbitrary expressions.  
So, I removed the old one.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] utzig commented on a change in pull request #2347: docs: Add section about conditional settings

2020-08-06 Thread GitBox


utzig commented on a change in pull request #2347:
URL: https://github.com/apache/mynewt-core/pull/2347#discussion_r466719014



##
File path: docs/os/modules/sysinitconfig/sysinitconfig.rst
##
@@ -352,6 +352,47 @@ use the flash area named ``FLASH_AREA_NFFS`` in the 
``syscfg.yml`` file.
 syscfg.vals:
 NFFS_FLASH_AREA: FLASH_AREA_NFFS
 
+Conditional Settings
+
+
+Setings in most Mynewt YAML files can be made conditional on syscfg
+settings.  For example, a package might depend on a second package
+*only if a syscfg setting has a particular value*.  The condition can
+be the value of a single syscfg setting or an arbitrary expression
+involving many settings.
+
+Examples of Conditional Settings
+
+
+Example 6
+`
+
+In this example, a package depends on `lib/pkg2` only if `MY_SETTING` has a

Review comment:
   Unlike Markdown where inline literals use a single backquote ("`"), 
reStructuredText uses double backquotes ("``") around the text.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2347: docs: Add section about conditional settings

2020-08-06 Thread GitBox


apache-mynewt-bot commented on pull request #2347:
URL: https://github.com/apache/mynewt-core/pull/2347#issuecomment-670134016


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] ccollins476ad opened a new pull request #2347: docs: Add section about conditional settings

2020-08-06 Thread GitBox


ccollins476ad opened a new pull request #2347:
URL: https://github.com/apache/mynewt-core/pull/2347


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] vrahane commented on pull request #2342: Add INA219 current sensor driver

2020-08-06 Thread GitBox


vrahane commented on pull request #2342:
URL: https://github.com/apache/mynewt-core/pull/2342#issuecomment-670097458


   @jipanienko: I see what you mean, the code looks fine. Thank you.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] vrahane merged pull request #2342: Add INA219 current sensor driver

2020-08-06 Thread GitBox


vrahane merged pull request #2342:
URL: https://github.com/apache/mynewt-core/pull/2342


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[mynewt-core] branch master updated: Add INA219 current sensor driver

2020-08-06 Thread vipulrahane
This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
 new 49667cf  Add INA219 current sensor driver
 new ca50207  Merge pull request #2342 from jipanienko/rama7
49667cf is described below

commit 49667cf1e1181a41548d1395f25e1fc69aebfa97
Author: J. Ipanienko 
AuthorDate: Mon Aug 3 13:12:50 2020 -0500

Add INA219 current sensor driver
---
 hw/drivers/sensors/ina219/include/ina219/ina219.h | 246 +++
 hw/drivers/sensors/ina219/pkg.yml |  40 ++
 hw/drivers/sensors/ina219/src/ina219.c| 496 ++
 hw/drivers/sensors/ina219/src/ina219_shell.c  | 252 +++
 hw/drivers/sensors/ina219/syscfg.yml  |  61 +++
 5 files changed, 1095 insertions(+)

diff --git a/hw/drivers/sensors/ina219/include/ina219/ina219.h 
b/hw/drivers/sensors/ina219/include/ina219/ina219.h
new file mode 100644
index 000..94e131e
--- /dev/null
+++ b/hw/drivers/sensors/ina219/include/ina219/ina219.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2020 Jesus Ipanienko
+ *
+ * Licensed 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 __INA219_H__
+#define __INA219_H__
+
+#include 
+#include 
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define INA219_CONFIGURATION_REG_ADDR   0
+#define INA219_SHUNT_VOLTAGE_REG_ADDR   1
+#define INA219_BUS_VOLTAGE_REG_ADDR 2
+#define INA219_POWER_REG_ADDR   3
+#define INA219_CURRENT_REG_ADDR 4
+#define INA219_CALIBRATION_REG_ADDR 5
+
+#define INA219_CONF_REG_RST_Msk 0x8000
+#define INA219_CONF_REG_RST_Pos 15
+#define INA219_CONF_REG_BRNG_Msk0x2000
+#define INA219_CONF_REG_BRNG_Pos13
+#define INA219_CONF_REG_PG_Msk  0x1800
+#define INA219_CONF_REG_PG_Pos  11
+#define INA219_CONF_REG_BADC_Msk0x0780
+#define INA219_CONF_REG_BADC_Pos7
+#define INA219_CONF_REG_SADC_Msk0x0078
+#define INA219_CONF_REG_SADC_Pos3
+#define INA219_CONF_REG_MODE_Msk0x0007
+#define INA219_CONF_REG_MODE_Pos0
+
+/* 10 uV */
+#define INA219_SHUNT_VOLTAGE_LSB10
+/* 4 mV at 16V full scale */
+#define INA219_BUS_VOLTAGE_16V_LSB  4
+/* 8 mV at 32V full scale */
+#define INA219_BUS_VOLTAGE_32V_LSB  8
+
+/* INA219 ADC mode/sample */
+enum ina219_adc_mode {
+INA219_ADC_9_BITS   = 0,
+INA219_ADC_10_BITS  = 1,
+INA219_ADC_11_BITS  = 2,
+INA219_ADC_12_BITS  = 3,
+INA219_ADC_2_SAMPLES= 9,
+INA219_ADC_4_SAMPLES= 10,
+INA219_ADC_8_SAMPLES= 11,
+INA219_ADC_16_SAMPLES   = 12,
+INA219_ADC_32_SAMPLES   = 13,
+INA219_ADC_64_SAMPLES   = 14,
+INA219_ADC_128_SAMPLES  = 15,
+};
+
+/* INA219 operating modes */
+enum ina219_oper_mode {
+INA219_OPER_POWER_DOWN  = 0,
+INA219_OPER_SHUNT_VOLTAGE_TRIGGERED = 1,
+INA219_OPER_BUS_VOLTAGE_TRIGGERED   = 2,
+INA219_OPER_SHUNT_AND_BUS_TRIGGERED = 3,
+INA219_OPER_ADC_OFF = 4,
+INA219_OPER_CONTINUOUS_MODE = 4,
+INA219_OPER_SHUNT_VOLTAGE_CONTINUOUS= 5,
+INA219_OPER_BUS_VOLTAGE_CONTINUOUS  = 6,
+INA219_OPER_SHUNT_AND_BUS_CONTINUOUS= 7,
+};
+
+enum ina219_vbus_full_scale {
+INA219_VBUS_FULL_SCALE_16V  = 0,
+INA219_VBUS_FULL_SCALE_32V  = 1,
+};
+
+struct ina219_hw_cfg {
+struct sensor_itf itf;
+/** Shunt resistance in mOhm. */
+uint32_t shunt_resistance;
+};
+
+struct ina219_cfg {
+/** VBus adc mode */
+enum ina219_adc_mode vbus_mode;
+/** Shunt adc mode */
+enum ina219_adc_mode vshunt_mode;
+/** Operation mode mode */
+enum ina219_oper_mode oper_mode;
+/** Full scale for VBUS */
+enum ina219_vbus_full_scale vbus_fs;
+
+uint32_t sensors_mask;
+};
+
+/* Define the stats section and records */
+STATS_SECT_START(ina219_stat_section)
+STATS_SECT_ENTRY(read_count)
+STATS_SECT_ENTRY(write_count)
+STATS_SECT_ENTRY(read_errors)
+STATS_SECT_ENTRY(write_errors)
+STATS_SECT_END
+
+struct ina219_dev {
+struct os_dev dev;
+struct sensor sensor;
+/* Hardware wiring config, (shunt, i2c) */
+struct ina219_hw_cfg hw_cfg;
+
+uint16_t config_reg;
+  

[GitHub] [mynewt-core] vrahane merged pull request #2335: Add INA226 current sensor driver

2020-08-06 Thread GitBox


vrahane merged pull request #2335:
URL: https://github.com/apache/mynewt-core/pull/2335


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[mynewt-core] branch master updated: Add INA226 current sensor driver

2020-08-06 Thread vipulrahane
This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
 new 1c06628  Add INA226 current sensor driver
 new ca7f099  Merge pull request #2335 from jipanienko/rama2
1c06628 is described below

commit 1c06628a9c338badf9c817e915c6ee91a1e07126
Author: J. Ipanienko 
AuthorDate: Fri Jul 17 14:09:24 2020 -0700

Add INA226 current sensor driver
---
 hw/drivers/sensors/ina226/include/ina226/ina226.h | 259 ++
 hw/drivers/sensors/ina226/pkg.yml |  24 +
 hw/drivers/sensors/ina226/src/ina226.c| 565 ++
 hw/drivers/sensors/ina226/src/ina226_shell.c  | 238 +
 hw/drivers/sensors/ina226/syscfg.yml  |  47 ++
 5 files changed, 1133 insertions(+)

diff --git a/hw/drivers/sensors/ina226/include/ina226/ina226.h 
b/hw/drivers/sensors/ina226/include/ina226/ina226.h
new file mode 100644
index 000..c9eb7b1
--- /dev/null
+++ b/hw/drivers/sensors/ina226/include/ina226/ina226.h
@@ -0,0 +1,259 @@
+#ifndef __INA226_H__
+#define __INA226_H__
+
+#include 
+#include 
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define INA226_CONFIGURATION_REG_ADDR   0x00
+#define INA226_SHUNT_VOLTAGE_REG_ADDR   0x01
+#define INA226_BUS_VOLTAGE_REG_ADDR 0x02
+#define INA226_POWER_REG_ADDR   0x03
+#define INA226_CURRENT_REG_ADDR 0x04
+#define INA226_CALIBRATION_REG_ADDR 0x05
+#define INA226_MASK_ENABLE_REG_ADDR 0x06
+#define INA226_ALERT_LIMIT_REG_ADDR 0x07
+#define INA226_MFG_ID_REG_ADDR  0xFE
+#define INA226_DIE_ID_REG_ADDR  0xFF
+
+#define INA226_CONF_OPER_MODE_Pos   0u
+#define INA226_CONF_OPER_MODE_Msk   (7u << INA226_CONF_OPER_MODE_Pos)
+#define INA226_CONF_VSHCT_Pos   3u
+#define INA226_CONF_VSHCT_Msk   (7u << INA226_CONF_VSHCT_Pos)
+#define INA226_CONF_VBUSCT_Pos  6u
+#define INA226_CONF_VBUSCT_Msk  (7u << INA226_CONF_VBUSCT_Pos)
+#define INA226_CONF_AVG_Pos 9u
+#define INA226_CONF_AVG_Msk (7u << INA226_CONF_AVG_Pos)
+#define INA226_CONF_RST_Pos 15u
+#define INA226_CONF_RST_Msk (1u << INA226_CONF_RST_Pos)
+
+#define INA226_MANUFACTURER_ID  0x5449
+
+#define INA226_MASK_ENABLE_LEN  0x0001
+#define INA226_MASK_ENABLE_APOL 0x0002
+#define INA226_MASK_ENABLE_OVF  0x0004
+#define INA226_MASK_ENABLE_CVRF 0x0008
+#define INA226_MASK_ENABLE_AFF  0x0010
+#define INA226_MASK_ENABLE_CNVR 0x0400
+#define INA226_MASK_ENABLE_POL  0x0800
+#define INA226_MASK_ENABLE_BUL  0x1000
+#define INA226_MASK_ENABLE_BOL  0x2000
+#define INA226_MASK_ENABLE_SUL  0x4000
+#define INA226_MASK_ENABLE_SOL  0x8000
+
+/* 2500 nV */
+#define INA226_SHUNT_VOLTAGE_LSB2500
+/* 1250 uV */
+#define INA226_BUS_VOLTAGE_LSB  1250
+
+/* INA226 operating modes */
+enum ina226_avg_mode {
+INA226_AVG_1,
+INA226_AVG_4,
+INA226_AVG_16,
+INA226_AVG_64,
+INA226_AVG_128,
+INA226_AVG_256,
+INA226_AVG_512,
+INA226_AVG_1024,
+};
+
+/* Bus/shunt voltage conversion time */
+enum ina226_ct {
+INA226_CT_140_US,
+INA226_CT_204_US,
+INA226_CT_332_US,
+INA226_CT_588_US,
+INA226_CT_1100_US,
+INA226_CT_2116_US,
+INA226_CT_4156_US,
+INA226_CT_8244_US,
+};
+
+/* INA226 operating modes */
+enum ina226_oper_mode {
+INA226_OPER_POWER_DOWN  = 0,
+INA226_OPER_SHUNT_VOLTAGE_TRIGGERED = 1,
+INA226_OPER_BUS_VOLTAGE_TRIGGERED   = 2,
+INA226_OPER_SHUNT_AND_BUS_TRIGGERED = 3,
+INA226_OPER_CONTINUOUS_MODE = 4,
+INA226_OPER_SHUNT_VOLTAGE_CONTINUOUS= 5,
+INA226_OPER_BUS_VOLTAGE_CONTINUOUS  = 6,
+INA226_OPER_SHUNT_AND_BUS_CONTINUOUS= 7,
+};
+
+struct ina226_hw_cfg {
+struct sensor_itf itf;
+/** Shunt resistance in mOhm. */
+uint32_t shunt_resistance;
+/** Interrupt pin number, -1 if not used. */
+int16_t interrupt_pin;
+/** Interrupt pin requires pull-up. Set to false if external pull up 
resistor is present. */
+bool interrupt_pullup;
+};
+
+struct ina226_cfg {
+/** VBus conversion time */
+enum ina226_ct vbusct;
+/** Shunt conversion time */
+enum ina226_ct vshct;
+/** Averaging mode */
+enum ina226_avg_mode avg_mode;
+};
+
+/* Define the stats section and records */
+STATS_SECT_START(ina226_stat_section)
+STATS_SECT_ENTRY(read_count)
+STATS_SECT_ENTRY(write_count)
+STATS_SECT_ENTRY(read_errors)
+STATS_SECT_ENTRY(write_errors)
+STATS_SECT_END
+
+struct ina226_dev {
+struct os_dev dev;
+struct sensor sensor;
+/* Hardware

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2346: otp_tool: Use a default baudrate.

2020-08-06 Thread GitBox


apache-mynewt-bot commented on pull request #2346:
URL: https://github.com/apache/mynewt-core/pull/2346#issuecomment-670048372


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] nkaje opened a new pull request #2346: otp_tool: Use a default baudrate.

2020-08-06 Thread GitBox


nkaje opened a new pull request #2346:
URL: https://github.com/apache/mynewt-core/pull/2346


   Use a default baudrate of 50. Update all the APIs
   to pass in an option to use a different baudrate if desired.
   
   Signed-off-by: Naveen Kaje 



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #540: nimble/host: Add support to accept or reject pairing request through GAP event

2020-08-06 Thread GitBox


rymanluk commented on a change in pull request #540:
URL: https://github.com/apache/mynewt-nimble/pull/540#discussion_r466374748



##
File path: nimble/host/src/ble_gap.c
##
@@ -5309,6 +5309,29 @@ ble_gap_identity_event(uint16_t conn_handle)
 ble_gap_call_conn_event_cb(&event, conn_handle);
 }
 
+int
+ble_gap_pairing_req_event(const struct ble_gap_pairing_req *req)
+{
+#if !NIMBLE_BLE_SM
+return 0;
+#endif
+
+struct ble_gap_event event;
+int rc;
+
+memset(&event, 0, sizeof event);
+event.type = BLE_GAP_EVENT_PAIRING_REQUEST;
+event.pairing_req.io_cap = req->io_cap;
+event.pairing_req.oob_data_flag = req->oob_data_flag;
+event.pairing_req.authreq = req->authreq;
+event.pairing_req.max_enc_key_size = req->max_enc_key_size;
+event.pairing_req.init_key_dist = req->init_key_dist;
+event.pairing_req.resp_key_dist = req->resp_key_dist;
+
+rc = ble_gap_call_conn_event_cb(&event, req->conn_handle);

Review comment:
   Thanks @prasad-alatkar 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] danielkucera commented on a change in pull request #2253: bsp/pinetime: Add bsp for PineTime smartwatch

2020-08-06 Thread GitBox


danielkucera commented on a change in pull request #2253:
URL: https://github.com/apache/mynewt-core/pull/2253#discussion_r466365681



##
File path: hw/bsp/pinetime/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_m4
+bsp.compiler: compiler/arm-none-eabi-m4
+bsp.linkerscript:
+- "hw/bsp/pinetime/pinetime.ld"
+- "@apache-mynewt-core/hw/mcu/nordic/nrf52xxx/nrf52.ld"
+bsp.linkerscript.BOOT_LOADER.OVERWRITE:
+- "hw/bsp/pinetime/boot-pinetime.ld"
+- "@apache-mynewt-core/hw/mcu/nordic/nrf52xxx/nrf52.ld"
+bsp.part2linkerscript: "hw/bsp/pinetime/split-pinetime.ld"

Review comment:
   where is the `split-pinetime.ld` file???





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] andrzej-kaczmarek commented on a change in pull request #2345: hal_flash: put flash into standby before deep sleep

2020-08-06 Thread GitBox


andrzej-kaczmarek commented on a change in pull request #2345:
URL: https://github.com/apache/mynewt-core/pull/2345#discussion_r465778309



##
File path: hw/mcu/dialog/da1469x/src/arch/cortex_m33/da1469x_m33_sleep.S
##
@@ -119,6 +119,23 @@ da1469x_m33_sleep:
 movsr3, #0
 str r3, [r0, #0]
 
+/*
+ * Disable QSPI continuous mode to achieve flash standby

Review comment:
   this code should be configurable by syscfg 
(`MCU_DEEP_SLEEP_QSPIC_QUAD_DISABLE`?)
   if flash is connected to some rail that is disabled in deep sleep, it does 
not make much sense to do any extra work since it will be powered down anyway

##
File path: hw/mcu/dialog/da1469x/src/hal_flash.c
##
@@ -317,6 +317,14 @@ da1469x_hff_read(const struct hal_flash *dev, uint32_t 
address, void *dst,
 return -1;
 }
 
+/*
+ * Make sure we are in continuous mode
+ */
+if (!(QSPIC->QSPIC_CTRLMODE_REG & 
QSPIC_QSPIC_CTRLMODE_REG_QSPIC_AUTO_MD_Msk))
+{
+da1469x_qspi_mode_auto(dev);
+}

Review comment:
   this code is executed from flash so we are already in auto-mode so this 
change seems redundant

##
File path: hw/mcu/dialog/da1469x/src/arch/cortex_m33/da1469x_m33_sleep.S
##
@@ -149,6 +166,32 @@ da1469x_m33_sleep:
 orr r1, r1, #0x1000
 str r1, [r2, #0]
 
+/*
+ * Flash is likely in QPI mode but QSPIC assumes it is in single mode so we
+ * should make sure both are in sync by forcing exit from QPI mode and then
+ * re-enter it. We need to do this before we start executing code from flash
+ * again.
+ */
+ldr r0, =QSPIC_BASE
+ldr r1, [r0, #(QSPIC_CTRLMOD_OFFSET)]
+bic r1, r1, #1  /* Clear automode */
+orr r1, r1, #0x3c   /* Set IO2/IO3 DAT and OEN */
+str r1, [r0, #(QSPIC_CTRLMOD_OFFSET)]
+mov r1, #1  /* Set single */
+str r1, [r0, #(QSPIC_CTRLBUS_OFFSET)]
+mov r1, #8  /* Enable CS */
+str r1, [r0, #(QSPIC_CTRLBUS_OFFSET)]
+mov r1, #0xff   /* Exit QPI mode */
+strbr1, [r0, #(QSPIC_WRITEDATA_OFFSET)]
+mov r1, #16 /* Disable CS */
+str r1, [r0, #(QSPIC_CTRLBUS_OFFSET)]

Review comment:
   code above this line is not necessary since we are already in single 
mode - it was done before wfi





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org