[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2902: hw/ipc_nrf5340: Some updates

2022-10-12 Thread GitBox


apache-mynewt-bot commented on PR #2902:
URL: https://github.com/apache/mynewt-core/pull/2902#issuecomment-1276970015

   
   
   
   ## 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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2901: hw/mcu/nrf5340: Enable cache by default

2022-10-12 Thread GitBox


apache-mynewt-bot commented on PR #2901:
URL: https://github.com/apache/mynewt-core/pull/2901#issuecomment-1276952601

   
   
   
   ## 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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #1389: nimble/host: Add APIs to handle vs HCI commands and events

2022-10-12 Thread GitBox


apache-mynewt-bot commented on PR #1389:
URL: https://github.com/apache/mynewt-nimble/pull/1389#issuecomment-1276933161

   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    nimble/host/src/ble_gap.c
   
   
   ```diff
   @@ -6099,8 +6098,8 @@
#endif


/*
   - * $preempt 
 *
   - 
*/
   +* $preempt  
*
   
+*/

void
ble_gap_preempt_no_lock(void)
   ```
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] agross-korg commented on a diff in pull request #2884: Flash autoconfigure updates

2022-10-12 Thread GitBox


agross-korg commented on code in PR #2884:
URL: https://github.com/apache/mynewt-core/pull/2884#discussion_r994028463


##
hw/mcu/dialog/da1469x/src/hal_flash.c:
##
@@ -430,6 +430,9 @@ qspi_read_rdid(const struct hal_flash *dev)
 int i;
 uint32_t result;
 
+da1469x_qspi_mode_manual(dev);
+da1469x_qspi_wait_busy(dev);

Review Comment:
   I disagree on this.  I think you need to assure a function can do what it 
needs to do without requiring something being done outside as a prerequisite.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] agross-korg commented on a diff in pull request #2884: Flash autoconfigure updates

2022-10-12 Thread GitBox


agross-korg commented on code in PR #2884:
URL: https://github.com/apache/mynewt-core/pull/2884#discussion_r994027924


##
hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h:
##
@@ -85,6 +85,8 @@ struct qspi_flash_config {
 extern const struct qspi_flash_config rdids[];
 extern const int qspi_flash_config_array_size;
 
+extern const struct qspi_flash_config *rdid_detected;

Review Comment:
   I added the accessor function in the 5cfcdee commit below.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] agross-korg commented on pull request #2884: Flash autoconfigure updates

2022-10-12 Thread GitBox


agross-korg commented on PR #2884:
URL: https://github.com/apache/mynewt-core/pull/2884#issuecomment-1276912080

   I thought they were all resolved with the push I did.  Let me double check 
that the changes hit all of the points.  I thought they had.


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] andrzej-kaczmarek commented on pull request #2884: Flash autoconfigure updates

2022-10-12 Thread GitBox


andrzej-kaczmarek commented on PR #2884:
URL: https://github.com/apache/mynewt-core/pull/2884#issuecomment-1276831554

   @agross-korg why this was merged with unresolved comments?


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[mynewt-core] branch master updated: da1469x: Add option to not disable watchdog on init

2022-10-12 Thread agross
This is an automated email from the ASF dual-hosted git repository.

agross 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 4c5522a9e da1469x: Add option to not disable watchdog on init
4c5522a9e is described below

commit 4c5522a9e5665b03f149c4e194f86ce87bb52098
Author: Andy Gross 
AuthorDate: Fri Sep 23 13:32:10 2022 -0500

da1469x: Add option to not disable watchdog on init

This patch adds a facility to control whether or not the Dialog watchdog is
disabled when the hal_watchdog_init function is being called.

Signed-off-by: Andy Gross 
---
 hw/mcu/dialog/da1469x/src/hal_watchdog.c | 5 -
 hw/mcu/dialog/da1469x/syscfg.yml | 5 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/hw/mcu/dialog/da1469x/src/hal_watchdog.c 
b/hw/mcu/dialog/da1469x/src/hal_watchdog.c
index c8e07fbd5..d7c7bbeff 100644
--- a/hw/mcu/dialog/da1469x/src/hal_watchdog.c
+++ b/hw/mcu/dialog/da1469x/src/hal_watchdog.c
@@ -27,7 +27,10 @@ int
 hal_watchdog_init(uint32_t expire_msecs)
 {
 SYS_WDOG->WATCHDOG_CTRL_REG = 
SYS_WDOG_WATCHDOG_CTRL_REG_WDOG_FREEZE_EN_Msk;
+
+#if MYNEWT_VAL(MCU_WATCHDOG_DISABLE_ON_INIT)
 GPREG->SET_FREEZE_REG |= GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Msk;
+#endif
 
 #if MYNEWT_VAL_CHOICE(MCU_LPCLK_SOURCE, RCX)
 g_hal_watchdog_reload_val = expire_msecs / 21;
@@ -40,7 +43,7 @@ hal_watchdog_init(uint32_t expire_msecs)
 /* wait */
 }
 SYS_WDOG->WATCHDOG_REG = g_hal_watchdog_reload_val;
-
+
 return 0;
 }
 
diff --git a/hw/mcu/dialog/da1469x/syscfg.yml b/hw/mcu/dialog/da1469x/syscfg.yml
index 2fecdc0cd..fe4e45b6e 100644
--- a/hw/mcu/dialog/da1469x/syscfg.yml
+++ b/hw/mcu/dialog/da1469x/syscfg.yml
@@ -454,6 +454,11 @@ syscfg.defs:
 restrictions:
 - '!GPADC_BATTERY'
 
+MCU_WATCHDOG_DISABLE_ON_INIT:
+description: >
+  'Disable watchdog on init'
+value: 1
+
 syscfg.vals:
 OS_TICKS_PER_SEC: 128
 



[GitHub] [mynewt-core] agross-korg merged pull request #2885: da1469x: Add option to not disable watchdog on init

2022-10-12 Thread GitBox


agross-korg merged PR #2885:
URL: https://github.com/apache/mynewt-core/pull/2885


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[mynewt-core] 01/02: da146x: hal_flash: Fix rdid issue on Gigadevice

2022-10-12 Thread agross
This is an automated email from the ASF dual-hosted git repository.

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

commit 382446f9932a9bfe8c230e340a267f0e8a239390
Author: Andy Gross 
AuthorDate: Mon Sep 26 18:13:16 2022 -0500

da146x: hal_flash: Fix rdid issue on Gigadevice

This patch moves the set manual mode and adds a busy status check before
executing the read rdid qspi command.  On gigadevice flash devices, the read
rdid would fail intermittently due to the device not being ready for the
command.

Signed-off-by: Andy Gross 
---
 hw/mcu/dialog/da1469x/src/hal_flash.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/mcu/dialog/da1469x/src/hal_flash.c 
b/hw/mcu/dialog/da1469x/src/hal_flash.c
index 7d5c69832..6004e2594 100644
--- a/hw/mcu/dialog/da1469x/src/hal_flash.c
+++ b/hw/mcu/dialog/da1469x/src/hal_flash.c
@@ -430,6 +430,9 @@ qspi_read_rdid(const struct hal_flash *dev)
 int i;
 uint32_t result;
 
+da1469x_qspi_mode_manual(dev);
+da1469x_qspi_wait_busy(dev);
+
 /* Issue a read rdid command (0x9F) and get 24 bit response */
 QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Msk;
 da1469x_qspi_write8(dev, 0x9f);
@@ -454,7 +457,6 @@ da1469x_hff_mcu_custom_init(const struct hal_flash *dev)
 uint32_t primask;
 
 __HAL_DISABLE_INTERRUPTS(primask);
-da1469x_qspi_mode_manual(dev);
 
 /* detect flash device and use correct configuration */
 config = qspi_read_rdid(dev);



[mynewt-core] 02/02: da146x: hal_flash: Add RDID accessor helper function

2022-10-12 Thread agross
This is an automated email from the ASF dual-hosted git repository.

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

commit d28a5944fcb88993387ae3471d0690a5247f0df2
Author: Andy Gross 
AuthorDate: Mon Sep 26 18:17:55 2022 -0500

da146x: hal_flash: Add RDID accessor helper function

This patch adds a helper function that provides access to the RDID 
information
of the flash device.  During flash init, the flash device is queried and the
RDID structure is identified.  This information can be used by other 
software
to make decisions about special actions taken with specific flash devices.

Signed-off-by: Andy Gross 
---
 hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h |  2 ++
 hw/mcu/dialog/da1469x/src/hal_flash.c   | 21 ++---
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h 
b/hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h
index 26c5f3c4c..78e167528 100755
--- a/hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h
+++ b/hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h
@@ -85,6 +85,8 @@ struct qspi_flash_config {
 extern const struct qspi_flash_config rdids[];
 extern const int qspi_flash_config_array_size;
 
+const struct qspi_flash_config *da1469x_qspi_get_config(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/hw/mcu/dialog/da1469x/src/hal_flash.c 
b/hw/mcu/dialog/da1469x/src/hal_flash.c
index 6004e2594..0ee84923b 100644
--- a/hw/mcu/dialog/da1469x/src/hal_flash.c
+++ b/hw/mcu/dialog/da1469x/src/hal_flash.c
@@ -31,9 +31,11 @@
 union da1469x_qspi_data_reg {
 uint32_t d32;
 uint16_t d16;
-uint8_t  d8;
+uint8_t d8;
 };
 
+static const struct qspi_flash_config *rdid_detected = NULL;
+
 static int da1469x_hff_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
 static int da1469x_hff_write(const struct hal_flash *dev, uint32_t address,
@@ -61,6 +63,12 @@ const struct hal_flash da1469x_flash_dev = {
 .hf_erased_val = 0xff,
 };
 
+const struct qspi_flash_config *
+da1469x_qspi_get_config(void)
+{
+return rdid_detected;
+}
+
 CODE_QSPI_INLINE static uint8_t
 da1469x_qspi_read8(const struct hal_flash *dev)
 {
@@ -453,20 +461,19 @@ qspi_read_rdid(const struct hal_flash *dev)
 static sec_text_ram_core void
 da1469x_hff_mcu_custom_init(const struct hal_flash *dev)
 {
-const struct qspi_flash_config *config = NULL;
 uint32_t primask;
 
 __HAL_DISABLE_INTERRUPTS(primask);
 
 /* detect flash device and use correct configuration */
-config = qspi_read_rdid(dev);
-assert(config);
+rdid_detected = qspi_read_rdid(dev);
+assert(rdid_detected);
 
-QSPIC->QSPIC_BURSTCMDA_REG = config->cmda;
-QSPIC->QSPIC_BURSTCMDB_REG = config->cmdb;
+QSPIC->QSPIC_BURSTCMDA_REG = rdid_detected->cmda;
+QSPIC->QSPIC_BURSTCMDB_REG = rdid_detected->cmdb;
 
 /* provision attached QSPI device for proper quad operation */
-qspi_qe_enable(dev, >qe);
+qspi_qe_enable(dev, _detected->qe);
 
 /*
  * Set auto mode, read pipe delay to 0x7, read pipe enable



[mynewt-core] branch master updated (f3e417741 -> d28a5944f)

2022-10-12 Thread agross
This is an automated email from the ASF dual-hosted git repository.

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


from f3e417741 fs/littlefs: Fix glue
 new 382446f99 da146x: hal_flash: Fix rdid issue on Gigadevice
 new d28a5944f da146x: hal_flash: Add RDID accessor helper function

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h |  2 ++
 hw/mcu/dialog/da1469x/src/hal_flash.c   | 25 +
 2 files changed, 19 insertions(+), 8 deletions(-)



[GitHub] [mynewt-core] agross-korg merged pull request #2884: Flash autoconfigure updates

2022-10-12 Thread GitBox


agross-korg merged PR #2884:
URL: https://github.com/apache/mynewt-core/pull/2884


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] andrzej-kaczmarek opened a new pull request, #2901: hw/mcu/nrf5340: Enable cache by default

2022-10-12 Thread GitBox


andrzej-kaczmarek opened a new pull request, #2901:
URL: https://github.com/apache/mynewt-core/pull/2901

   Does not really make sense to have it disabled by default since we are 
running from flash.


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[mynewt-nimble] branch master updated: nimble/ll: Add API to read random data from controller

2022-10-12 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 e7006a8e nimble/ll: Add API to read random data from controller
e7006a8e is described below

commit e7006a8e780fa8aed8ba5a2cfe3bd824ea87e8fd
Author: Andrzej Kaczmarek 
AuthorDate: Tue Oct 11 14:22:52 2022 +0200

nimble/ll: Add API to read random data from controller

This may be useful to get some random if MCU does not support trng, e.g.
as on nRF5340 app core.
---
 apps/bttester/src/gap.c   |  2 +-
 nimble/host/include/host/ble_hs_hci.h | 15 +++
 nimble/host/mesh/src/glue.c   |  2 +-
 nimble/host/src/ble_hs_hci_priv.h |  1 -
 nimble/host/src/ble_hs_hci_util.c |  2 +-
 nimble/host/src/ble_hs_id.c   |  2 +-
 nimble/host/src/ble_sm.c  | 10 +-
 nimble/host/src/ble_sm_alg.c  |  2 +-
 nimble/host/src/ble_sm_sc.c   |  2 +-
 9 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/apps/bttester/src/gap.c b/apps/bttester/src/gap.c
index 24ef4ab3..aee9591c 100644
--- a/apps/bttester/src/gap.c
+++ b/apps/bttester/src/gap.c
@@ -837,7 +837,7 @@ static void auth_passkey_display(uint16_t conn_handle, 
unsigned int passkey)
return;
}
 
-   rc = ble_hs_hci_util_rand(, sizeof(pk.passkey));
+   rc = ble_hs_hci_rand(, sizeof(pk.passkey));
assert(rc == 0);
/* Max value is 99 */
pk.passkey %= 100;
diff --git a/nimble/host/include/host/ble_hs_hci.h 
b/nimble/host/include/host/ble_hs_hci.h
index e10b8e62..739eea92 100644
--- a/nimble/host/include/host/ble_hs_hci.h
+++ b/nimble/host/include/host/ble_hs_hci.h
@@ -87,6 +87,21 @@ int ble_hs_hci_read_chan_map(uint16_t conn_handle, uint8_t 
*out_chan_map);
  */
 int ble_hs_hci_set_chan_class(const uint8_t *chan_map);
 
+/**
+ * Reads random data into buffer from controller.
+ * This allows to use BLE controller as a source of true random data.
+ *
+ * @param dst   Destination buffer.
+ * @param len   Destination buffer length.
+ *
+ * @return  0 on success;
+ *  A BLE host HCI return code if the controller
+ *  rejected the request;
+ *  A BLE host core return code on unexpected
+ *  error.
+ */
+int ble_hs_hci_rand(void *dst, int len);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/nimble/host/mesh/src/glue.c b/nimble/host/mesh/src/glue.c
index c00af947..f6f57f05 100644
--- a/nimble/host/mesh/src/glue.c
+++ b/nimble/host/mesh/src/glue.c
@@ -588,7 +588,7 @@ int
 bt_rand(void *buf, size_t len)
 {
 int rc;
-rc = ble_hs_hci_util_rand(buf, len);
+rc = ble_hs_hci_rand(buf, len);
 if (rc != 0) {
 return -1;
 }
diff --git a/nimble/host/src/ble_hs_hci_priv.h 
b/nimble/host/src/ble_hs_hci_priv.h
index 9ff4c6f0..356f3a53 100644
--- a/nimble/host/src/ble_hs_hci_priv.h
+++ b/nimble/host/src/ble_hs_hci_priv.h
@@ -98,7 +98,6 @@ void ble_hs_hci_set_phony_ack_cb(ble_hs_hci_phony_ack_fn *cb);
 #endif
 
 int ble_hs_hci_util_read_adv_tx_pwr(int8_t *out_pwr);
-int ble_hs_hci_util_rand(void *dst, int len);
 int ble_hs_hci_util_read_rssi(uint16_t conn_handle, int8_t *out_rssi);
 int ble_hs_hci_util_set_random_addr(const uint8_t *addr);
 int ble_hs_hci_util_set_data_len(uint16_t conn_handle, uint16_t tx_octets,
diff --git a/nimble/host/src/ble_hs_hci_util.c 
b/nimble/host/src/ble_hs_hci_util.c
index 14e55d52..11d0a77e 100644
--- a/nimble/host/src/ble_hs_hci_util.c
+++ b/nimble/host/src/ble_hs_hci_util.c
@@ -58,7 +58,7 @@ ble_hs_hci_util_read_adv_tx_pwr(int8_t *out_tx_pwr)
 }
 
 int
-ble_hs_hci_util_rand(void *dst, int len)
+ble_hs_hci_rand(void *dst, int len)
 {
 struct ble_hci_le_rand_rp rsp;
 uint8_t *u8ptr;
diff --git a/nimble/host/src/ble_hs_id.c b/nimble/host/src/ble_hs_id.c
index bd50e201..2dd21aa7 100644
--- a/nimble/host/src/ble_hs_id.c
+++ b/nimble/host/src/ble_hs_id.c
@@ -41,7 +41,7 @@ ble_hs_id_gen_rnd(int nrpa, ble_addr_t *out_addr)
 
 out_addr->type = BLE_ADDR_RANDOM;
 
-rc = ble_hs_hci_util_rand(out_addr->val, 6);
+rc = ble_hs_hci_rand(out_addr->val, 6);
 if (rc != 0) {
 return rc;
 }
diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c
index 5188effe..6d781bd5 100644
--- a/nimble/host/src/ble_sm.c
+++ b/nimble/host/src/ble_sm.c
@@ -261,7 +261,7 @@ ble_sm_gen_pair_rand(uint8_t *pair_rand)
 }
 #endif
 
-rc = ble_hs_hci_util_rand(pair_rand, 16);
+rc = ble_hs_hci_rand(pair_rand, 16);
 if (rc != 0) {
 return rc;
 }
@@ -282,7 +282,7 @@ ble_sm_gen_ediv(struct ble_sm_master_id *master_id)
 }
 #endif
 
-rc = ble_hs_hci_util_rand(_id->ediv, sizeof master_id->ediv);
+rc = ble_hs_hci_rand(_id->ediv, 

[GitHub] [mynewt-nimble] andrzej-kaczmarek merged pull request #1397: nimble/ll: Add API to read random data from controller

2022-10-12 Thread GitBox


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


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[mynewt-core] 01/02: fs/littlefs: Update to v2.5.0

2022-10-12 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-core.git

commit fc91540a45ce84a13ac171345418b29f18ccf9c5
Author: Andrzej Kaczmarek 
AuthorDate: Tue Oct 11 22:51:37 2022 +0200

fs/littlefs: Update to v2.5.0
---
 fs/littlefs/LICENSE.md   |   25 +
 fs/littlefs/README.md|2 +-
 fs/littlefs/SPEC.md  |   14 +-
 fs/littlefs/src/lfs.c| 1299 ++
 fs/littlefs/{include/littlefs => src}/lfs.h  |   46 +-
 fs/littlefs/src/lfs_util.c   |3 +-
 fs/littlefs/{include/littlefs => src}/lfs_util.h |1 +
 fs/littlefs/src/mynewt_glue.c|4 +-
 8 files changed, 908 insertions(+), 486 deletions(-)

diff --git a/fs/littlefs/LICENSE.md b/fs/littlefs/LICENSE.md
new file mode 100644
index 0..e6c3a7bac
--- /dev/null
+++ b/fs/littlefs/LICENSE.md
@@ -0,0 +1,25 @@
+Copyright (c) 2022, The littlefs authors.  
+Copyright (c) 2017, Arm Limited. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
modification,
+are permitted provided that the following conditions are met:
+
+-  Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+-  Redistributions in binary form must reproduce the above copyright notice, 
this
+   list of conditions and the following disclaimer in the documentation and/or
+   other materials provided with the distribution.
+-  Neither the name of ARM nor the names of its contributors may be used to
+   endorse or promote products derived from this software without specific 
prior
+   written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/fs/littlefs/README.md b/fs/littlefs/README.md
index a30d43d3b..584ada39d 100644
--- a/fs/littlefs/README.md
+++ b/fs/littlefs/README.md
@@ -192,7 +192,7 @@ More details on how littlefs works can be found in 
[DESIGN.md](DESIGN.md) and
 ## Testing
 
 The littlefs comes with a test suite designed to run on a PC using the
-[emulated block device](emubd/lfs_emubd.h) found in the emubd directory.
+[emulated block device](bd/lfs_testbd.h) found in the `bd` directory.
 The tests assume a Linux environment and can be started with make:
 
 ``` bash
diff --git a/fs/littlefs/SPEC.md b/fs/littlefs/SPEC.md
index cc602c1cf..3663ea544 100644
--- a/fs/littlefs/SPEC.md
+++ b/fs/littlefs/SPEC.md
@@ -233,19 +233,19 @@ Metadata tag fields:
into a 3-bit abstract type and an 8-bit chunk field. Note that the value
`0x000` is invalid and not assigned a type.
 
-3. **Type1 (3-bits)** - Abstract type of the tag. Groups the tags into
-   8 categories that facilitate bitmasked lookups.
+1. **Type1 (3-bits)** - Abstract type of the tag. Groups the tags into
+   8 categories that facilitate bitmasked lookups.
 
-4. **Chunk (8-bits)** - Chunk field used for various purposes by the different
-   abstract types.  type1+chunk+id form a unique identifier for each tag in the
-   metadata block.
+2. **Chunk (8-bits)** - Chunk field used for various purposes by the 
different
+   abstract types.  type1+chunk+id form a unique identifier for each tag 
in the
+   metadata block.
 
-5. **Id (10-bits)** - File id associated with the tag. Each file in a metadata
+3. **Id (10-bits)** - File id associated with the tag. Each file in a metadata
block gets a unique id which is used to associate tags with that file. The
special value `0x3ff` is used for any tags that are not associated with a
file, such as directory and global metadata.
 
-6. **Length (10-bits)** - Length of the data in bytes. The special value
+4. **Length (10-bits)** - Length of the data in bytes. The special value
`0x3ff` indicates that this tag has been deleted.
 
 ## Metadata types
diff --git a/fs/littlefs/src/lfs.c b/fs/littlefs/src/lfs.c
index c517c004b..117595e04 100644
--- a/fs/littlefs/src/lfs.c
+++ b/fs/littlefs/src/lfs.c
@@ -1,16 +1,33 @@
 /*
  * The little filesystem
  *
+ * Copyright (c) 2022, The littlefs authors.
  * Copyright (c) 2017, Arm Limited. All rights 

[mynewt-core] 02/02: fs/littlefs: Fix glue

2022-10-12 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-core.git

commit f3e417741a1834e1ae78d5912470c68889e261c1
Author: Andrzej Kaczmarek 
AuthorDate: Tue Oct 11 22:52:32 2022 +0200

fs/littlefs: Fix glue

read_buffer and prog_buffer have to be cache_size
cache_size has to be factor of block size (assume block size 4096)
lookahead_size has to be multiple of 8

and move checks for block size and block count to restrictions
---
 fs/littlefs/src/mynewt_glue.c | 26 --
 fs/littlefs/syscfg.yml|  8 ++--
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/fs/littlefs/src/mynewt_glue.c b/fs/littlefs/src/mynewt_glue.c
index df11deb13..75755118d 100644
--- a/fs/littlefs/src/mynewt_glue.c
+++ b/fs/littlefs/src/mynewt_glue.c
@@ -32,10 +32,6 @@
 #include 
 #include 
 
-#if ((MYNEWT_VAL(LITTLEFS_BLOCK_SIZE) < 0) || 
(MYNEWT_VAL(LITTLEFS_BLOCK_COUNT) < 0))
-#error "Must configure LITTLEFS_BLOCK_SIZE and LITTLEFS_BLOCK_COUNT syscfgs"
-#endif
-
 static int littlefs_open(const char *path, uint8_t access_flags,
  struct fs_file **out_file);
 static int littlefs_close(struct fs_file *fs_file);
@@ -222,12 +218,14 @@ flash_sync(const struct lfs_config *c)
 static lfs_t *g_lfs = NULL;
 static bool g_lfs_alloc_done = false;
 
-#define READ_SIZE (MYNEWT_VAL(MCU_FLASH_MIN_WRITE_SIZE) * 2)
-static uint8_t read_buffer[READ_SIZE];
-#define WRITE_SIZE (MYNEWT_VAL(MCU_FLASH_MIN_WRITE_SIZE) * 2)
-static uint8_t prog_buffer[WRITE_SIZE];
-#define CACHE_SIZE 8
-static uint8_t __attribute__((aligned(4))) lookahead_buffer[CACHE_SIZE];
+#define READ_SIZE   MYNEWT_VAL(MCU_FLASH_MIN_WRITE_SIZE)
+#define PROG_SIZE   MYNEWT_VAL(MCU_FLASH_MIN_WRITE_SIZE)
+#define CACHE_SIZE  16
+#define LOOKAHEAD_SIZE  16
+
+static uint8_t read_buffer[CACHE_SIZE];
+static uint8_t prog_buffer[CACHE_SIZE];
+static uint8_t __attribute__((aligned(4))) lookahead_buffer[LOOKAHEAD_SIZE];
 static struct lfs_config g_lfs_cfg = {
 .context = NULL,
 
@@ -238,12 +236,12 @@ static struct lfs_config g_lfs_cfg = {
 
 /* block device configuration */
 .read_size = READ_SIZE,
-.prog_size = WRITE_SIZE,
+.prog_size = PROG_SIZE,
 .block_size = MYNEWT_VAL(LITTLEFS_BLOCK_SIZE),
 .block_count = MYNEWT_VAL(LITTLEFS_BLOCK_COUNT),
 .block_cycles = 500,
-.cache_size = 16,
-.lookahead_size = CACHE_SIZE,
+.cache_size = CACHE_SIZE,
+.lookahead_size = LOOKAHEAD_SIZE,
 .read_buffer = read_buffer,
 .prog_buffer = prog_buffer,
 .lookahead_buffer = lookahead_buffer,
@@ -470,7 +468,7 @@ littlefs_read(struct fs_file *fs_file, uint32_t len, void 
*out_data,
 lfs = ((struct littlefs_file *) fs_file)->lfs;
 
 littlefs_lock();
-size = lfs_file_read(lfs, file, out_data, *out_len);
+size = lfs_file_read(lfs, file, out_data, len);
 littlefs_unlock();
 if (size < 0) {
 return littlefs_to_vfs_error((int)size);
diff --git a/fs/littlefs/syscfg.yml b/fs/littlefs/syscfg.yml
index 4dbbad042..8ffc9cc2a 100644
--- a/fs/littlefs/syscfg.yml
+++ b/fs/littlefs/syscfg.yml
@@ -34,7 +34,7 @@ syscfg.defs:
 description: >
 Size of the sectors used to store a littlefs partition. All sectors
 must have the same size.
-value: -1
+value: 0
 
 LITTLEFS_MIGRATE_V1:
 description: >
@@ -49,7 +49,7 @@ syscfg.defs:
 LITTLEFS_BLOCK_COUNT:
 description: >
 Number of blocks/sectors use by this partition.
-value: -1
+value: 0
 
 LITTLEFS_DISABLE_SYSINIT:
 description: >
@@ -60,3 +60,7 @@ syscfg.defs:
 description: >
 Sysinit stage for littlefs functionality.
 value: 200
+
+syscfg.restrictions:
+- LITTLEFS_BLOCK_SIZE > 0
+- LITTLEFS_BLOCK_COUNT > 0



[mynewt-core] branch master updated (50e5c174b -> f3e417741)

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

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


from 50e5c174b mcu/stm32f7: Move __vector_tbl_reloc__ to DTCM
 new fc91540a4 fs/littlefs: Update to v2.5.0
 new f3e417741 fs/littlefs: Fix glue

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 fs/littlefs/LICENSE.md   |   25 +
 fs/littlefs/README.md|2 +-
 fs/littlefs/SPEC.md  |   14 +-
 fs/littlefs/src/lfs.c| 1299 ++
 fs/littlefs/{include/littlefs => src}/lfs.h  |   46 +-
 fs/littlefs/src/lfs_util.c   |3 +-
 fs/littlefs/{include/littlefs => src}/lfs_util.h |1 +
 fs/littlefs/src/mynewt_glue.c|   30 +-
 fs/littlefs/syscfg.yml   |8 +-
 9 files changed, 926 insertions(+), 502 deletions(-)
 create mode 100644 fs/littlefs/LICENSE.md
 rename fs/littlefs/{include/littlefs => src}/lfs.h (94%)
 rename fs/littlefs/{include/littlefs => src}/lfs_util.h (99%)



[GitHub] [mynewt-core] andrzej-kaczmarek merged pull request #2900: fs/littlefs: Update to v2.5.0 and some fixes

2022-10-12 Thread GitBox


andrzej-kaczmarek merged PR #2900:
URL: https://github.com/apache/mynewt-core/pull/2900


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2899: mcu/nrf5340: Add secure functions package

2022-10-12 Thread GitBox


apache-mynewt-bot commented on PR #2899:
URL: https://github.com/apache/mynewt-core/pull/2899#issuecomment-1276136713

   
   
   
   ## 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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] kasjer commented on a diff in pull request #2899: mcu/nrf5340: Add secure functions package

2022-10-12 Thread GitBox


kasjer commented on code in PR #2899:
URL: https://github.com/apache/mynewt-core/pull/2899#discussion_r993231397


##
hw/mcu/nordic/nrf5340/syscfg.yml:
##
@@ -126,6 +126,13 @@ syscfg.defs:
 Application code to runs in secure mode.
 This settings must have same value for bootloader and application 
build.
 value: 1
+MCU_NET_GPIO:

Review Comment:
   Thanks, old MCU_GPIO_NET reused. Old code from startup that used it is now 
removed.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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



[GitHub] [mynewt-core] sjanc commented on a diff in pull request #2899: mcu/nrf5340: Add secure functions package

2022-10-12 Thread GitBox


sjanc commented on code in PR #2899:
URL: https://github.com/apache/mynewt-core/pull/2899#discussion_r993058446


##
hw/mcu/nordic/nrf5340/syscfg.yml:
##
@@ -126,6 +126,13 @@ syscfg.defs:
 Application code to runs in secure mode.
 This settings must have same value for bootloader and application 
build.
 value: 1
+MCU_NET_GPIO:

Review Comment:
   hmm there is already MCU_GPIO_NET



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

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