[GitHub] [mynewt-core] benmccrea merged pull request #2447: hw/mcu/dialog: Fix watchdog init when using RCX

2020-12-18 Thread GitBox


benmccrea merged pull request #2447:
URL: https://github.com/apache/mynewt-core/pull/2447


   



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: hw/mcu/dialog: Fix watchdog init when using RCX

2020-12-18 Thread benmccrea
This is an automated email from the ASF dual-hosted git repository.

benmccrea 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 df96df0  hw/mcu/dialog: Fix watchdog init when using RCX
 new 99d11be  Merge pull request #2447 from 
supervillain101/dialog_watchdog_lpclk_fix
df96df0 is described below

commit df96df01c1225caa4d875400c33498b61efd595a
Author: Philip Burkhardt 
AuthorDate: Fri Dec 18 12:35:53 2020 -0800

hw/mcu/dialog: Fix watchdog init when using RCX

RCX oscillator runs at 15kHz.  Watchdog initialization did not account
for both RCX and EXT 32kHz oscillators when calculating WDT init value.
---
 hw/mcu/dialog/da1469x/src/hal_watchdog.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/hw/mcu/dialog/da1469x/src/hal_watchdog.c 
b/hw/mcu/dialog/da1469x/src/hal_watchdog.c
index ba606c5..c8e07fb 100644
--- a/hw/mcu/dialog/da1469x/src/hal_watchdog.c
+++ b/hw/mcu/dialog/da1469x/src/hal_watchdog.c
@@ -29,7 +29,11 @@ hal_watchdog_init(uint32_t expire_msecs)
 SYS_WDOG->WATCHDOG_CTRL_REG = 
SYS_WDOG_WATCHDOG_CTRL_REG_WDOG_FREEZE_EN_Msk;
 GPREG->SET_FREEZE_REG |= GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Msk;
 
+#if MYNEWT_VAL_CHOICE(MCU_LPCLK_SOURCE, RCX)
+g_hal_watchdog_reload_val = expire_msecs / 21;
+#else
 g_hal_watchdog_reload_val = expire_msecs / 10;
+#endif
 assert((g_hal_watchdog_reload_val & 0xC000) == 0);
 
 while (SYS_WDOG->WATCHDOG_CTRL_REG & 
SYS_WDOG_WATCHDOG_CTRL_REG_WRITE_BUSY_Msk) {



[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2447: hw/mcu/dialog: Fix watchdog init when using RCX

2020-12-18 Thread GitBox


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


   
   
   
   ## 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 commented on pull request #2447: hw/mcu/dialog: Fix watchdog init when using RCX

2020-12-18 Thread GitBox


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


   
   
   
   ## 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 commented on pull request #2447: hw/mcu/dialog: Fix watchdog init when using RCX

2020-12-18 Thread GitBox


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


   
   
   
   ## 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] supervillain101 opened a new pull request #2447: hw/mcu/dialog: Fix watchdog init when using RCX

2020-12-18 Thread GitBox


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


   RCX oscillator runs at 15kHz.  Watchdog initialization did not account
   for both RCX and EXT 32kHz oscillators when calculating WDT init value.



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] v01d commented on pull request #895: ble_gap: fix warning about implicit cast form pointer to int

2020-12-18 Thread GitBox


v01d commented on pull request #895:
URL: https://github.com/apache/mynewt-nimble/pull/895#issuecomment-748296235


   Thanks!



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-nimble] branch master updated: ble_gap: fix warning about implicit cast form pointer to int

2020-12-18 Thread andk
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 5fbb666  ble_gap: fix warning about implicit cast form pointer to int
5fbb666 is described below

commit 5fbb6660a433217b8eaf1b95de410379f868616c
Author: Matias N 
AuthorDate: Fri Dec 18 14:50:56 2020 -0300

ble_gap: fix warning about implicit cast form pointer to int
---
 nimble/host/src/ble_gap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 1631cf4..bbedc31 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -745,7 +745,7 @@ ble_gap_has_client(struct ble_gap_master_state *out_state)
 return 0;
 }
 
-return out_state->cb;
+return out_state->cb != NULL;
 }
 
 static void



[GitHub] [mynewt-nimble] andrzej-kaczmarek merged pull request #895: ble_gap: fix warning about implicit cast form pointer to int

2020-12-18 Thread GitBox


andrzej-kaczmarek merged pull request #895:
URL: https://github.com/apache/mynewt-nimble/pull/895


   



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] apache-mynewt-bot commented on pull request #895: ble_gap: fix warning about implicit cast form pointer to int

2020-12-18 Thread GitBox


apache-mynewt-bot commented on pull request #895:
URL: https://github.com/apache/mynewt-nimble/pull/895#issuecomment-748230688


   
   
   
   ## 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-nimble] v01d opened a new pull request #895: ble_gap: fix warning about implicit cast form pointer to int

2020-12-18 Thread GitBox


v01d opened a new pull request #895:
URL: https://github.com/apache/mynewt-nimble/pull/895


   This solves the following warning:
   
   returning 'int (*)(struct ble_gap_event *, void *)' from a function with 
return type '_Bool8' {aka 'unsigned char'} makes integer from pointer without a 
cast [-Werror=int-conversion]
   
   which was found when building nimBLE as part of NuttX



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] kasjer merged pull request #2446: hw/mcu/dialog: Fix typo in da1469x_dma.h

2020-12-18 Thread GitBox


kasjer merged pull request #2446:
URL: https://github.com/apache/mynewt-core/pull/2446


   



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: hw/mcu/dialog: Fix typo in da1469x_dma.h

2020-12-18 Thread jerzy
This is an automated email from the ASF dual-hosted git repository.

jerzy 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 b761964  hw/mcu/dialog: Fix typo in da1469x_dma.h
b761964 is described below

commit b761964d0490e80d24c49e059fac75e3f0e643d1
Author: Jerzy Kasenberg 
AuthorDate: Fri Dec 18 15:54:19 2020 +0100

hw/mcu/dialog: Fix typo in da1469x_dma.h

Should be MCU_ was MCI_
---
 hw/mcu/dialog/da1469x/include/mcu/da1469x_dma.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/mcu/dialog/da1469x/include/mcu/da1469x_dma.h 
b/hw/mcu/dialog/da1469x/include/mcu/da1469x_dma.h
index 972ccc4..def0517 100644
--- a/hw/mcu/dialog/da1469x/include/mcu/da1469x_dma.h
+++ b/hw/mcu/dialog/da1469x/include/mcu/da1469x_dma.h
@@ -29,7 +29,7 @@ extern "C" {
 #endif
 
 /* DMA peripheral can be one of following values */
-#define MCI_DMA_PERIPH_SPI  (0)
+#define MCU_DMA_PERIPH_SPI  (0)
 #define MCU_DMA_PERIPH_SPI2 (1)
 #define MCU_DMA_PERIPH_UART (2)
 #define MCU_DMA_PERIPH_UART2(3)



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2446: hw/mcu/dialog: Fix typo in da1469x_dma.h

2020-12-18 Thread GitBox


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


   
   
   
   ## 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] kasjer opened a new pull request #2446: hw/mcu/dialog: Fix typo in da1469x_dma.h

2020-12-18 Thread GitBox


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


   Should be MCU_ was MCI_



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 #2445: sensor creator init split

2020-12-18 Thread GitBox


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


   
   
   
   ## 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] kasjer opened a new pull request #2445: sensor creator init split

2020-12-18 Thread GitBox


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


   This solves the problem of sensor_creator usage along with SPI flash that is 
present in flash map.
   
   If BSP uses SPI flash and sensor creator with SPI devices that are connected 
to the same
   SPI bus as flash, not initializing chip select pin for those other devices 
may lead to wrong
   reads from flash.
   It happens when uninitialized yet GPIO is still perceived by sensor as 
active and sensor responds
   to requests that should be answered by flash.
   
   This adds sensor_dev_init() that has initialization code taken from 
sensor_dev_create().
   Thai also changes flash_map initialization stage to accommodate for other 
initialization that
   could be needed before flash_map can be initialized.



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-mcumgr] branch master updated: zephyr: Add support for image ROM address verification

2020-12-18 Thread utzig
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 74e77ad  zephyr: Add support for image ROM address verification
74e77ad is described below

commit 74e77ad08090c0e389a27118fdebe20783dca2e4
Author: Dominik Ermel 
AuthorDate: Thu Dec 10 15:17:04 2020 +

zephyr: Add support for image ROM address verification

The commit adds IMAGE_F_ROM_FIXED_ADDR flag that allows to use
ih_load_addr to identify the flash address the image is intendant to
start at.
The code, that supports this flag, will reject image before attempting
flash write if slot address differs from the base address of the image.
The feature can be used to mark Direct-XIP images with slot address
they are intended for.
The CONFIG_IMG_MGMT_REJECT_DIRECT_XIP_MISMATCHED_SLOT has been added
to turn the featre on.

Signed-off-by: Dominik Ermel 
---
 cmd/img_mgmt/include/img_mgmt/image.h  |  1 +
 cmd/img_mgmt/include/img_mgmt/img_mgmt.h   |  2 ++
 cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c | 20 
 cmd/img_mgmt/src/img_mgmt.c|  1 +
 4 files changed, 24 insertions(+)

diff --git a/cmd/img_mgmt/include/img_mgmt/image.h 
b/cmd/img_mgmt/include/img_mgmt/image.h
index 53ca7f6..6de917a 100644
--- a/cmd/img_mgmt/include/img_mgmt/image.h
+++ b/cmd/img_mgmt/include/img_mgmt/image.h
@@ -34,6 +34,7 @@ extern "C" {
 
 /** Image header flags. */
 #define IMAGE_F_NON_BOOTABLE0x0010 /* Split image app. */
+#define IMAGE_F_ROM_FIXED_ADDR  0x0100
 
 /** Image trailer TLV types. */
 #define IMAGE_TLV_SHA2560x10   /* SHA256 of image hdr and body */
diff --git a/cmd/img_mgmt/include/img_mgmt/img_mgmt.h 
b/cmd/img_mgmt/include/img_mgmt/img_mgmt.h
index 4385477..78e6ba5 100644
--- a/cmd/img_mgmt/include/img_mgmt/img_mgmt.h
+++ b/cmd/img_mgmt/include/img_mgmt/img_mgmt.h
@@ -259,6 +259,7 @@ extern const char *img_mgmt_err_str_flash_open_failed;
 extern const char *img_mgmt_err_str_flash_erase_failed;
 extern const char *img_mgmt_err_str_flash_write_failed;
 extern const char *img_mgmt_err_str_downgrade;
+extern const char *img_mgmt_err_str_image_bad_flash_addr;
 #else
 #define img_mgmt_error_rsp(ctxt, rc, rsn) (rc)
 #define img_mgmt_err_str_app_reject   NULL
@@ -269,6 +270,7 @@ extern const char *img_mgmt_err_str_downgrade;
 #define img_mgmt_err_str_flash_erase_failed   NULL
 #define img_mgmt_err_str_flash_write_failed   NULL
 #define img_mgmt_err_str_downgradeNULL
+#define img_mgmt_err_str_image_bad_flash_addr NULL
 #endif
 
 #ifdef __cplusplus
diff --git a/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c 
b/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c
index b4a4e3b..d6169b8 100644
--- a/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c
+++ b/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c
@@ -495,6 +495,26 @@ img_mgmt_impl_upload_inspect(const struct 
img_mgmt_upload_req *req,
 return MGMT_ERR_ENOMEM;
 }
 
+
+#if defined(CONFIG_IMG_MGMT_REJECT_DIRECT_XIP_MISMATCHED_SLOT)
+if (hdr->ih_flags & IMAGE_F_ROM_FIXED_ADDR) {
+rc = flash_area_open(action->area_id, &fa);
+if (rc) {
+*errstr = img_mgmt_err_str_flash_open_failed;
+return MGMT_ERR_EUNKNOWN;
+}
+
+if (fa->fa_off != hdr->ih_load_addr) {
+*errstr = img_mgmt_err_str_image_bad_flash_addr;
+flash_area_close(fa);
+return MGMT_ERR_EINVAL;
+}
+
+flash_area_close(fa);
+}
+#endif
+
+
 if (req->upgrade) {
 /* User specified upgrade-only.  Make sure new image version is
  * greater than that of the currently running image.
diff --git a/cmd/img_mgmt/src/img_mgmt.c b/cmd/img_mgmt/src/img_mgmt.c
index 029b4cc..1a40ffc 100644
--- a/cmd/img_mgmt/src/img_mgmt.c
+++ b/cmd/img_mgmt/src/img_mgmt.c
@@ -72,6 +72,7 @@ const char *img_mgmt_err_str_flash_open_failed = "fa open 
fail";
 const char *img_mgmt_err_str_flash_erase_failed = "fa erase fail";
 const char *img_mgmt_err_str_flash_write_failed = "fa write fail";
 const char *img_mgmt_err_str_downgrade = "downgrade";
+const char *img_mgmt_err_str_image_bad_flash_addr = "img addr mismatch";
 #endif
 
 /**



[GitHub] [mynewt-mcumgr] utzig merged pull request #104: zephyr: Add support for image ROM address verification

2020-12-18 Thread GitBox


utzig merged pull request #104:
URL: https://github.com/apache/mynewt-mcumgr/pull/104


   



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