Re: [I] how to support ptp [nuttx]

2023-10-31 Thread via GitHub


xiaotailang commented on issue #10887:
URL: https://github.com/apache/nuttx/issues/10887#issuecomment-1788447784

   Thank you very much for the assistance you've provided


-- 
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...@nuttx.apache.org

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



Re: [PR] Add missing variables and change to be more intuitive to use [nuttx-apps]

2023-10-31 Thread via GitHub


GC-20-20 commented on code in PR #2171:
URL: https://github.com/apache/nuttx-apps/pull/2171#discussion_r1378414801


##
examples/serialrx/serialrx_main.c:
##
@@ -118,8 +118,7 @@ int main(int argc, FAR char *argv[])
   while (cnt < bytecount)
 {
 #ifdef CONFIG_EXAMPLES_SERIALRX_BUFFERED
-  size_t n = fread(buf, 1, 26, f);

Review Comment:
   Okay, I see what you mean.I'd still like to ask, but would these small 
changes be a waste of your time.After all, it doesn't change the logic of the 
code



-- 
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...@nuttx.apache.org

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



Re: [PR] Add missing variables and change to be more intuitive to use [nuttx-apps]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on code in PR #2171:
URL: https://github.com/apache/nuttx-apps/pull/2171#discussion_r1378410290


##
examples/serialrx/serialrx_main.c:
##
@@ -118,8 +118,7 @@ int main(int argc, FAR char *argv[])
   while (cnt < bytecount)
 {
 #ifdef CONFIG_EXAMPLES_SERIALRX_BUFFERED
-  size_t n = fread(buf, 1, 26, f);

Review Comment:
   Ok, but after you finish the investigation is better to remove the temp 
change. If you think the temp change is worth to upstream, please split to the 
different patch. It's important to ensure one patch fix one problem, so the 
reviewer could understand your change quickly.



-- 
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...@nuttx.apache.org

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



Re: [PR] Add missing variables and change to be more intuitive to use [nuttx-apps]

2023-10-31 Thread via GitHub


GC-20-20 commented on code in PR #2171:
URL: https://github.com/apache/nuttx-apps/pull/2171#discussion_r1378380224


##
examples/serialrx/serialrx_main.c:
##
@@ -118,8 +118,7 @@ int main(int argc, FAR char *argv[])
   while (cnt < bytecount)
 {
 #ifdef CONFIG_EXAMPLES_SERIALRX_BUFFERED
-  size_t n = fread(buf, 1, 26, f);

Review Comment:
   I'm very sorry, this change is really optional, this 26 I double-checked a 
few times without finding any clues, then I changed it to a simple number. 
Maybe it helps.



-- 
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...@nuttx.apache.org

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



Re: [PR] Add missing variables and change to be more intuitive to use [nuttx-apps]

2023-10-31 Thread via GitHub


GC-20-20 commented on code in PR #2171:
URL: https://github.com/apache/nuttx-apps/pull/2171#discussion_r1378378099


##
examples/serialrx/Kconfig:
##
@@ -39,22 +39,22 @@ config EXAMPLES_SERIALRX_DEVPATH
 
 choice
prompt "Output method"
-   default EXAMPLES_SERIALRX_PRINTHYPHEN
+   default EXAMPLES_SERIALRX_PRINTSTR

Review Comment:
   When I opened this application for the first time, it was very confusing for 
me to not have read the source code of the program and not have any display 
after using another serial port to send data, after all, there is no 
explanation in the HELP. So I would like to change the default value to 
EXAMPLES_SERIALRX_PRINTSTR so that later learners can be more intuitively clear 
that the previous operation is correct.



-- 
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...@nuttx.apache.org

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



Re: [PR] Add missing variables and change to be more intuitive to use [nuttx-apps]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on code in PR #2171:
URL: https://github.com/apache/nuttx-apps/pull/2171#discussion_r1378373428


##
examples/serialrx/Kconfig:
##
@@ -39,22 +39,22 @@ config EXAMPLES_SERIALRX_DEVPATH
 
 choice
prompt "Output method"
-   default EXAMPLES_SERIALRX_PRINTHYPHEN
+   default EXAMPLES_SERIALRX_PRINTSTR
 
-config EXAMPLES_SERIALRX_PRINTHYPHEN

Review Comment:
   why change the order, let's keep as before



##
examples/serialrx/serialrx_main.c:
##
@@ -118,8 +118,7 @@ int main(int argc, FAR char *argv[])
   while (cnt < bytecount)
 {
 #ifdef CONFIG_EXAMPLES_SERIALRX_BUFFERED
-  size_t n = fread(buf, 1, 26, f);

Review Comment:
   why make the follow change



##
examples/serialrx/Kconfig:
##
@@ -39,22 +39,22 @@ config EXAMPLES_SERIALRX_DEVPATH
 
 choice
prompt "Output method"
-   default EXAMPLES_SERIALRX_PRINTHYPHEN
+   default EXAMPLES_SERIALRX_PRINTSTR

Review Comment:
   why change the default setting



-- 
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...@nuttx.apache.org

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



[PR] Add missing variables and change to be more intuitive to use [nuttx-apps]

2023-10-31 Thread via GitHub


GC-20-20 opened a new pull request, #2171:
URL: https://github.com/apache/nuttx-apps/pull/2171

   ## Summary
   Add missing variables and change to be more intuitive to use
   ## Impact
   Variables that do cause compilation to fail
   ## Testing
   local test
   


-- 
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...@nuttx.apache.org

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



Re: [PR] arch/sim: Provide a dummy g_reg_offs for arm64 [nuttx]

2023-10-31 Thread via GitHub


masayuki2009 commented on PR #11091:
URL: https://github.com/apache/nuttx/pull/11091#issuecomment-1788360589

   g_reg_offs was introduced in https://github.com/apache/nuttx/pull/9859
   


-- 
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...@nuttx.apache.org

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



(nuttx) 02/02: usrsock_rpmsg_server: Keep msg order in recursive call

2023-10-31 Thread xiaoxiang
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 90a8e2e4220856b337d67fa2e5c36d46f928aa24
Author: Zhe Weng 
AuthorDate: Tue Aug 29 22:12:23 2023 +0800

usrsock_rpmsg_server: Keep msg order in recursive call

In `drivers/rptun/rptun.c`, we have a `rptun_is_recursive` function,
which lets rptun thread run recursively. Then the `usrsock_rpmsg_ept_cb`
may be called inside `usrsock_rpmsg_ept_cb`, which can cause some
unexpected behavior, so we add a queue to keep the order of incoming
messages to reduce the complexity.

Signed-off-by: Zhe Weng 
---
 drivers/usrsock/usrsock_rpmsg_server.c | 98 +++---
 1 file changed, 90 insertions(+), 8 deletions(-)

diff --git a/drivers/usrsock/usrsock_rpmsg_server.c 
b/drivers/usrsock/usrsock_rpmsg_server.c
index 218a80aaf9..9020ec8201 100644
--- a/drivers/usrsock/usrsock_rpmsg_server.c
+++ b/drivers/usrsock/usrsock_rpmsg_server.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #ifdef CONFIG_NETDEV_WIRELESS_IOCTL
@@ -53,11 +54,31 @@ struct usrsock_rpmsg_s
   struct pollfd pfds[CONFIG_NET_USRSOCK_RPMSG_SERVER_NSOCKS];
 };
 
+/* Saving rpmsg requests to keep message order. */
+
+struct usrsock_rpmsg_req_s
+{
+  sq_entry_t flink;
+  FAR void  *data;
+  size_t len;
+  uint32_t   src;
+};
+
 struct usrsock_rpmsg_ept_s
 {
   struct rpmsg_endpoint ept;
+
+  /* For sendto/recvfrom */
+
   struct iovec  iov[CONFIG_NET_USRSOCK_RPMSG_SERVER_NIOVEC];
   ssize_t   remain;
+
+  /* For keeping msg order, normally nIOVec is the max request we can get */
+
+  bool   inuse;
+  sq_queue_t req_free;
+  sq_queue_t req_pending;
+  struct usrsock_rpmsg_req_s reqs[CONFIG_NET_USRSOCK_RPMSG_SERVER_NIOVEC];
 };
 
 /
@@ -989,6 +1010,7 @@ static void usrsock_rpmsg_ns_bind(FAR struct rpmsg_device 
*rdev,
   FAR struct usrsock_rpmsg_s *priv = priv_;
   FAR struct usrsock_rpmsg_ept_s *uept;
   int ret;
+  int i;
 
   uept = kmm_zalloc(sizeof(*uept));
   if (!uept)
@@ -997,6 +1019,10 @@ static void usrsock_rpmsg_ns_bind(FAR struct rpmsg_device 
*rdev,
 }
 
   uept->ept.priv = priv;
+  for (i = 0; i < CONFIG_NET_USRSOCK_RPMSG_SERVER_NIOVEC; i++)
+{
+  sq_addlast(>reqs[i].flink, >req_free);
+}
 
   ret = rpmsg_create_ept(>ept, rdev, USRSOCK_RPMSG_EPT_NAME,
  RPMSG_ADDR_ANY, dest,
@@ -1042,28 +1068,84 @@ static void usrsock_rpmsg_ns_unbind(FAR struct 
rpmsg_endpoint *ept)
   kmm_free(ept);
 }
 
-static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
-FAR void *data, size_t len, uint32_t src,
-FAR void *priv_)
+static int usrsock_rpmsg_ept_do_cb(FAR struct usrsock_rpmsg_ept_s *uept,
+   FAR void *data, size_t len, uint32_t src,
+   FAR struct usrsock_rpmsg_s *priv)
 {
   FAR struct usrsock_request_common_s *common = data;
-  FAR struct usrsock_rpmsg_ept_s *uept =
-(FAR struct usrsock_rpmsg_ept_s *)ept;
-  FAR struct usrsock_rpmsg_s *priv = priv_;
 
   if (uept->remain > 0)
 {
-  return usrsock_rpmsg_sendto_handler(ept, data, len, src, priv);
+  return usrsock_rpmsg_sendto_handler(>ept, data, len, src, priv);
 }
   else if (common->reqid >= 0 && common->reqid <= USRSOCK_REQUEST__MAX)
 {
-  return g_usrsock_rpmsg_handler[common->reqid](ept, data, len,
+  return g_usrsock_rpmsg_handler[common->reqid](>ept, data, len,
 src, priv);
 }
 
   return -EINVAL;
 }
 
+static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
+FAR void *data, size_t len, uint32_t src,
+FAR void *priv_)
+{
+  FAR struct usrsock_rpmsg_s *priv = priv_;
+  FAR struct usrsock_rpmsg_ept_s *uept =
+(FAR struct usrsock_rpmsg_ept_s *)ept;
+  FAR struct usrsock_rpmsg_req_s *req;
+  int ret;
+
+  /* This callback is called from only one thread per ept, so don't need any
+   * lock for `inuse` state.
+   */
+
+  if (uept->inuse)
+{
+  /* Avoid recursive call. */
+
+  req = (FAR struct usrsock_rpmsg_req_s *)sq_remfirst(>req_free);
+  if (req == NULL)
+{
+  return -ENOMEM;
+}
+
+  req->data = data;
+  req->len  = len;
+  req->src  = src;
+  sq_addlast(>flink, >req_pending);
+
+  rpmsg_hold_rx_buffer(ept, data);
+  return OK;
+}
+
+  uept->inuse = true;
+  ret = usrsock_rpmsg_ept_do_cb(uept, data, len, src, priv);
+
+  /* Pop pending requests to proceed. */
+
+  while ((req = (FAR struct usrsock_rpmsg_req_s *)
+ sq_remfirst(>req_pending)) != NULL)
+

(nuttx) branch master updated (c7d0b32e4f -> 90a8e2e422)

2023-10-31 Thread xiaoxiang
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from c7d0b32e4f simwifi: Support that get the connected Chinese essid.
 new 52fddb1f12 usrsock_rpmsg_server: Save iov and remain per endpoint
 new 90a8e2e422 usrsock_rpmsg_server: Keep msg order in recursive call

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:
 drivers/usrsock/usrsock_rpmsg_server.c | 169 +
 1 file changed, 130 insertions(+), 39 deletions(-)



(nuttx) 01/02: usrsock_rpmsg_server: Save iov and remain per endpoint

2023-10-31 Thread xiaoxiang
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 52fddb1f121dbbbae5a15a74019ec5581411923e
Author: Zhe Weng 
AuthorDate: Mon Sep 11 11:57:53 2023 +0800

usrsock_rpmsg_server: Save iov and remain per endpoint

Then we may support multiple endpoints with sendto working correctly.

Signed-off-by: Zhe Weng 
---
 drivers/usrsock/usrsock_rpmsg_server.c | 75 +++---
 1 file changed, 42 insertions(+), 33 deletions(-)

diff --git a/drivers/usrsock/usrsock_rpmsg_server.c 
b/drivers/usrsock/usrsock_rpmsg_server.c
index e97faaca5c..218a80aaf9 100644
--- a/drivers/usrsock/usrsock_rpmsg_server.c
+++ b/drivers/usrsock/usrsock_rpmsg_server.c
@@ -48,13 +48,18 @@
 struct usrsock_rpmsg_s
 {
   rmutex_t  mutex;
-  ssize_t   remain;
-  struct iovec  iov[CONFIG_NET_USRSOCK_RPMSG_SERVER_NIOVEC];
   struct socket socks[CONFIG_NET_USRSOCK_RPMSG_SERVER_NSOCKS];
   FAR struct rpmsg_endpoint *epts[CONFIG_NET_USRSOCK_RPMSG_SERVER_NSOCKS];
   struct pollfd pfds[CONFIG_NET_USRSOCK_RPMSG_SERVER_NSOCKS];
 };
 
+struct usrsock_rpmsg_ept_s
+{
+  struct rpmsg_endpoint ept;
+  struct iovec  iov[CONFIG_NET_USRSOCK_RPMSG_SERVER_NIOVEC];
+  ssize_t   remain;
+};
+
 /
  * Private Function Prototypes
  /
@@ -380,37 +385,39 @@ static int usrsock_rpmsg_sendto_handler(FAR struct 
rpmsg_endpoint *ept,
 uint32_t src, FAR void *priv_)
 {
   FAR struct usrsock_request_sendto_s *req;
+  FAR struct usrsock_rpmsg_ept_s *uept =
+(FAR struct usrsock_rpmsg_ept_s *)ept;
   FAR struct usrsock_rpmsg_s *priv = priv_;
   uint16_t events = 0;
   ssize_t ret = -EBADF;
   int retr;
   int i;
 
-  if (priv->remain > 0)
+  if (uept->remain > 0)
 {
   size_t hlen;
   struct msghdr msg =
   {
   };
 
-  priv->remain -= len;
+  uept->remain -= len;
 
-  if (!priv->iov[0].iov_base)
+  if (!uept->iov[0].iov_base)
 {
   /* Maybe error occurred previously, skip processing. */
 
   return 0;
 }
 
-  req = priv->iov[0].iov_base;
+  req = uept->iov[0].iov_base;
   hlen = sizeof(*req) + req->addrlen;
 
   for (i = 0; i < CONFIG_NET_USRSOCK_RPMSG_SERVER_NIOVEC; i++)
 {
-  if (!priv->iov[i].iov_base)
+  if (!uept->iov[i].iov_base)
 {
-  priv->iov[i].iov_base = data;
-  priv->iov[i].iov_len = len;
+  uept->iov[i].iov_base = data;
+  uept->iov[i].iov_len = len;
   rpmsg_hold_rx_buffer(ept, data);
   break;
 }
@@ -418,7 +425,7 @@ static int usrsock_rpmsg_sendto_handler(FAR struct 
rpmsg_endpoint *ept,
 
   /* Partial packet ? continue to fetch */
 
-  if (priv->remain > 0)
+  if (uept->remain > 0)
 {
   /* We've used the last I/O vector, cannot continue. */
 
@@ -431,7 +438,7 @@ static int usrsock_rpmsg_sendto_handler(FAR struct 
rpmsg_endpoint *ept,
 
   return 0;
 }
-  else if (priv->remain < 0)
+  else if (uept->remain < 0)
 {
   ret = -EINVAL;
   goto out;
@@ -439,20 +446,20 @@ static int usrsock_rpmsg_sendto_handler(FAR struct 
rpmsg_endpoint *ept,
 
   /* Skip the sendto header from I/O vector */
 
-  priv->iov[0].iov_base = (FAR char *)priv->iov[0].iov_base + hlen;
-  priv->iov[0].iov_len -= hlen;
+  uept->iov[0].iov_base = (FAR char *)uept->iov[0].iov_base + hlen;
+  uept->iov[0].iov_len -= hlen;
 
   msg.msg_name = req->addrlen ? (FAR void *)(req + 1) : NULL;
   msg.msg_namelen = req->addrlen;
-  msg.msg_iov = priv->iov;
+  msg.msg_iov = uept->iov;
   msg.msg_iovlen = i + 1;
 
   ret = psock_sendmsg(>socks[req->usockid], , req->flags);
 
   /* Recover the I/O vector */
 
-  priv->iov[0].iov_base = (FAR char *)priv->iov[0].iov_base - hlen;
-  priv->iov[0].iov_len += hlen;
+  uept->iov[0].iov_base = (FAR char *)uept->iov[0].iov_base - hlen;
+  uept->iov[0].iov_len += hlen;
 }
   else
 {
@@ -461,12 +468,12 @@ static int usrsock_rpmsg_sendto_handler(FAR struct 
rpmsg_endpoint *ept,
   if (req->usockid >= 0 &&
   req->usockid < CONFIG_NET_USRSOCK_RPMSG_SERVER_NSOCKS)
 {
-  priv->remain = sizeof(*req) + req->addrlen + req->buflen - len;
-  if (priv->remain > 0)
+  uept->remain = sizeof(*req) + req->addrlen + req->buflen - len;
+  if (uept->remain > 0)
 {
 #if CONFIG_NET_USRSOCK_RPMSG_SERVER_NIOVEC >= 2
-  priv->iov[0].iov_base = data;
-  priv->iov[0].iov_len = len;
+  

Re: [PR] usrsock_rpmsg_server: Keep msg order in recursive call [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 merged PR #11103:
URL: https://github.com/apache/nuttx/pull/11103


-- 
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...@nuttx.apache.org

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



Re: [PR] usrsock_rpmsg_server: Keep msg order in recursive call [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on code in PR #11103:
URL: https://github.com/apache/nuttx/pull/11103#discussion_r1378326012


##
drivers/usrsock/usrsock_rpmsg_server.c:
##
@@ -1042,28 +1068,84 @@ static void usrsock_rpmsg_ns_unbind(FAR struct 
rpmsg_endpoint *ept)
   kmm_free(ept);
 }
 
-static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
-FAR void *data, size_t len, uint32_t src,
-FAR void *priv_)
+static int usrsock_rpmsg_ept_do_cb(FAR struct usrsock_rpmsg_ept_s *uept,
+   FAR void *data, size_t len, uint32_t src,
+   FAR struct usrsock_rpmsg_s *priv)
 {
   FAR struct usrsock_request_common_s *common = data;
-  FAR struct usrsock_rpmsg_ept_s *uept =
-(FAR struct usrsock_rpmsg_ept_s *)ept;
-  FAR struct usrsock_rpmsg_s *priv = priv_;
 
   if (uept->remain > 0)
 {
-  return usrsock_rpmsg_sendto_handler(ept, data, len, src, priv);
+  return usrsock_rpmsg_sendto_handler(>ept, data, len, src, priv);
 }
   else if (common->reqid >= 0 && common->reqid <= USRSOCK_REQUEST__MAX)
 {
-  return g_usrsock_rpmsg_handler[common->reqid](ept, data, len,
+  return g_usrsock_rpmsg_handler[common->reqid](>ept, data, len,
 src, priv);
 }
 
   return -EINVAL;
 }
 
+static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
+FAR void *data, size_t len, uint32_t src,
+FAR void *priv_)
+{
+  FAR struct usrsock_rpmsg_s *priv = priv_;
+  FAR struct usrsock_rpmsg_ept_s *uept =
+(FAR struct usrsock_rpmsg_ept_s *)ept;
+  FAR struct usrsock_rpmsg_req_s *req;
+  int ret;
+
+  /* This callback is called from only one thread per ept, so don't need any
+   * lock for `inuse` state.
+   */
+
+  if (uept->inuse)
+{
+  /* Avoid recursive call. */
+
+  req = (FAR struct usrsock_rpmsg_req_s *)sq_remfirst(>req_free);
+  if (req == NULL)
+{
+  return -ENOMEM;
+}
+
+  req->data = data;
+  req->len  = len;
+  req->src  = src;
+  sq_addlast(>flink, >req_pending);

Review Comment:
   Ok, you are right.



-- 
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...@nuttx.apache.org

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



Re: [PR] usrsock_rpmsg_server: Keep msg order in recursive call [nuttx]

2023-10-31 Thread via GitHub


wengzhe commented on code in PR #11103:
URL: https://github.com/apache/nuttx/pull/11103#discussion_r1378320648


##
drivers/usrsock/usrsock_rpmsg_server.c:
##
@@ -1042,28 +1068,84 @@ static void usrsock_rpmsg_ns_unbind(FAR struct 
rpmsg_endpoint *ept)
   kmm_free(ept);
 }
 
-static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
-FAR void *data, size_t len, uint32_t src,
-FAR void *priv_)
+static int usrsock_rpmsg_ept_do_cb(FAR struct usrsock_rpmsg_ept_s *uept,
+   FAR void *data, size_t len, uint32_t src,
+   FAR struct usrsock_rpmsg_s *priv)
 {
   FAR struct usrsock_request_common_s *common = data;
-  FAR struct usrsock_rpmsg_ept_s *uept =
-(FAR struct usrsock_rpmsg_ept_s *)ept;
-  FAR struct usrsock_rpmsg_s *priv = priv_;
 
   if (uept->remain > 0)
 {
-  return usrsock_rpmsg_sendto_handler(ept, data, len, src, priv);
+  return usrsock_rpmsg_sendto_handler(>ept, data, len, src, priv);
 }
   else if (common->reqid >= 0 && common->reqid <= USRSOCK_REQUEST__MAX)
 {
-  return g_usrsock_rpmsg_handler[common->reqid](ept, data, len,
+  return g_usrsock_rpmsg_handler[common->reqid](>ept, data, len,
 src, priv);
 }
 
   return -EINVAL;
 }
 
+static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
+FAR void *data, size_t len, uint32_t src,
+FAR void *priv_)
+{
+  FAR struct usrsock_rpmsg_s *priv = priv_;
+  FAR struct usrsock_rpmsg_ept_s *uept =
+(FAR struct usrsock_rpmsg_ept_s *)ept;
+  FAR struct usrsock_rpmsg_req_s *req;
+  int ret;
+
+  /* This callback is called from only one thread per ept, so don't need any
+   * lock for `inuse` state.
+   */
+
+  if (uept->inuse)
+{
+  /* Avoid recursive call. */
+
+  req = (FAR struct usrsock_rpmsg_req_s *)sq_remfirst(>req_free);
+  if (req == NULL)
+{
+  return -ENOMEM;
+}
+
+  req->data = data;
+  req->len  = len;
+  req->src  = src;
+  sq_addlast(>flink, >req_pending);

Review Comment:
   `sq_addlast` doesn't need any search, it just adds the node after the `tail` 
in `sq_queue_t`.
   
https://github.com/apache/nuttx/blob/c7d0b32e4f022eaa6071d6cc16983768e183bb4c/include/nuttx/queue.h#L102-L118



-- 
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...@nuttx.apache.org

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



Re: [PR] usrsock_rpmsg_server: Keep msg order in recursive call [nuttx]

2023-10-31 Thread via GitHub


wengzhe commented on code in PR #11103:
URL: https://github.com/apache/nuttx/pull/11103#discussion_r1378320648


##
drivers/usrsock/usrsock_rpmsg_server.c:
##
@@ -1042,28 +1068,84 @@ static void usrsock_rpmsg_ns_unbind(FAR struct 
rpmsg_endpoint *ept)
   kmm_free(ept);
 }
 
-static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
-FAR void *data, size_t len, uint32_t src,
-FAR void *priv_)
+static int usrsock_rpmsg_ept_do_cb(FAR struct usrsock_rpmsg_ept_s *uept,
+   FAR void *data, size_t len, uint32_t src,
+   FAR struct usrsock_rpmsg_s *priv)
 {
   FAR struct usrsock_request_common_s *common = data;
-  FAR struct usrsock_rpmsg_ept_s *uept =
-(FAR struct usrsock_rpmsg_ept_s *)ept;
-  FAR struct usrsock_rpmsg_s *priv = priv_;
 
   if (uept->remain > 0)
 {
-  return usrsock_rpmsg_sendto_handler(ept, data, len, src, priv);
+  return usrsock_rpmsg_sendto_handler(>ept, data, len, src, priv);
 }
   else if (common->reqid >= 0 && common->reqid <= USRSOCK_REQUEST__MAX)
 {
-  return g_usrsock_rpmsg_handler[common->reqid](ept, data, len,
+  return g_usrsock_rpmsg_handler[common->reqid](>ept, data, len,
 src, priv);
 }
 
   return -EINVAL;
 }
 
+static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
+FAR void *data, size_t len, uint32_t src,
+FAR void *priv_)
+{
+  FAR struct usrsock_rpmsg_s *priv = priv_;
+  FAR struct usrsock_rpmsg_ept_s *uept =
+(FAR struct usrsock_rpmsg_ept_s *)ept;
+  FAR struct usrsock_rpmsg_req_s *req;
+  int ret;
+
+  /* This callback is called from only one thread per ept, so don't need any
+   * lock for `inuse` state.
+   */
+
+  if (uept->inuse)
+{
+  /* Avoid recursive call. */
+
+  req = (FAR struct usrsock_rpmsg_req_s *)sq_remfirst(>req_free);
+  if (req == NULL)
+{
+  return -ENOMEM;
+}
+
+  req->data = data;
+  req->len  = len;
+  req->src  = src;
+  sq_addlast(>flink, >req_pending);

Review Comment:
   `sq_addlast` doesn't need any search, it just adds the node after the `tail` 
in `sq_queue_t`.



-- 
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...@nuttx.apache.org

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



Re: [PR] Add supoort for hpm6360evk [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on PR #9761:
URL: https://github.com/apache/nuttx/pull/9761#issuecomment-1788279955

   > HPMicro's repo has added support for nuttx: 
[HPMicro](https://github.com/hpmicro/nuttx/tree/nuttx_with_hpmsdk/arch/risc-v/src/hpmicro)
 But they use their own SDK, not nuttx-style direct reading and writing of 
registers, so is this merge request necessary?
   
   I amn't sure whether HPMicro plan to upstream their work to mainline.


-- 
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...@nuttx.apache.org

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



Re: [PR] Usrsock socket fallback with ENETDOWN [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on code in PR #11107:
URL: https://github.com/apache/nuttx/pull/11107#discussion_r1378308214


##
net/socket/socket.c:
##
@@ -104,9 +104,11 @@ int psock_socket(int domain, int type, int protocol,
 
   /* When usrsock daemon returns -ENOSYS or -ENOTSUP, it means to use
* kernel's network stack, so fallback to kernel socket.
+   * When -ENETDOWN is returned, it means the usrsock daemon was never
+   * launched or is no longer running, so fallback to kernel socket.
*/
 
-  if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP))
+  if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP && ret != -ENETDOWN))

Review Comment:
   Ok, but usrsock test fail with this patch, please fix it.



-- 
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...@nuttx.apache.org

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



(nuttx) branch master updated: simwifi: Support that get the connected Chinese essid.

2023-10-31 Thread xiaoxiang
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new c7d0b32e4f simwifi: Support that get the connected Chinese essid.
c7d0b32e4f is described below

commit c7d0b32e4f022eaa6071d6cc16983768e183bb4c
Author: liqinhui 
AuthorDate: Tue Oct 24 18:51:08 2023 +0800

simwifi: Support that get the connected Chinese essid.

The Chinese essid obtained by wpa_cli is encoded. So, we directly use
the essid saved in wifidev.

Signed-off-by: liqinhui 
---
 arch/sim/src/sim/sim_wifidriver.c | 18 --
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/arch/sim/src/sim/sim_wifidriver.c 
b/arch/sim/src/sim/sim_wifidriver.c
index 1f68755eed..87841d8946 100644
--- a/arch/sim/src/sim/sim_wifidriver.c
+++ b/arch/sim/src/sim/sim_wifidriver.c
@@ -643,21 +643,11 @@ static bool get_wpa_state(struct sim_netdev_s *wifidev)
   return false;
 }
 
-static int get_wpa_ssid(struct sim_netdev_s *wifidev, struct iw_point *essid)
+static void get_wpa_ssid(struct sim_netdev_s *wifidev,
+ struct iw_point *essid)
 {
-  int ret;
-  char rbuf[BUF_LEN];
-
-  ret = get_cmd(wifidev, rbuf, BUF_LEN, "%s",
-"status | grep ^ssid | awk -F'=' '{print $2}'");
-
-  if (ret > 0 && ret <= essid->length)
-{
-  strlcpy(essid->pointer, rbuf, ret);
-  essid->length = ret - 1;
-}
-
-  return ret;
+  essid->length = strlen(wifidev->ssid);
+  strlcpy(essid->pointer, wifidev->ssid, essid->length + 1);
 }
 
 static int get_wpa_freq(struct sim_netdev_s *wifidev)



Re: [PR] simwifi: Support that get the connected Chinese essid. [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 merged PR #11104:
URL: https://github.com/apache/nuttx/pull/11104


-- 
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...@nuttx.apache.org

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



(nuttx) branch master updated: sched: explicitly select the cpuload clock source configuration

2023-10-31 Thread xiaoxiang
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new d0a5489ac5 sched: explicitly select the cpuload clock source 
configuration
d0a5489ac5 is described below

commit d0a5489ac596c161f909c29564c810c4215c8558
Author: yinshengkai 
AuthorDate: Thu Oct 26 21:03:16 2023 +0800

sched: explicitly select the cpuload clock source configuration

Different configurations require different dependencies.
Explicitly select dependencies to avoid automatically selecting 
inappropriate configurations.

Signed-off-by: yinshengkai 
---
 .../imxrt1050-evk/configs/libcxxtest/defconfig |  2 +-
 .../imxrt1060-evk/configs/libcxxtest/defconfig |  2 +-
 .../imxrt1064-evk/configs/libcxxtest/defconfig |  2 +-
 .../imxrt/teensy-4.x/configs/pikron-bb/defconfig   |  1 -
 .../arm/lpc17xx_40xx/lx_cpu/configs/nsh/defconfig  |  2 +-
 boards/arm/sam34/sam4s-xplained-pro/Kconfig|  2 +-
 .../stm32/stm32butterfly2/configs/nsh/defconfig|  2 +-
 .../stm32/stm32butterfly2/configs/nshnet/defconfig |  2 +-
 .../stm32butterfly2/configs/nshusbdev/defconfig|  2 +-
 .../stm32butterfly2/configs/nshusbhost/defconfig   |  2 +-
 .../stm32h7/nucleo-h743zi2/configs/jumbo/defconfig |  2 +-
 .../risc-v/bl602/bl602evb/configs/timer/defconfig  |  2 +-
 crypto/random_pool.c   |  4 ++--
 fs/procfs/Kconfig  |  2 +-
 fs/procfs/fs_procfs.c  |  3 ++-
 fs/procfs/fs_procfscpuload.c   |  3 ++-
 fs/procfs/fs_procfsproc.c  | 16 +++---
 include/nuttx/clock.h  |  4 ++--
 include/nuttx/sched.h  |  2 +-
 sched/Kconfig  | 25 +++---
 sched/misc/assert.c| 10 -
 sched/sched/CMakeLists.txt |  2 +-
 sched/sched/Make.defs  |  2 +-
 sched/sched/sched.h|  2 +-
 sched/sched/sched_cpuload.c|  4 
 sched/sched/sched_cpuload_oneshot.c|  4 
 sched/sched/sched_cpuload_period.c |  4 
 sched/sched/sched_releasetcb.c |  2 +-
 sched/sched/sched_sysinfo.c|  4 ++--
 29 files changed, 52 insertions(+), 64 deletions(-)

diff --git a/boards/arm/imxrt/imxrt1050-evk/configs/libcxxtest/defconfig 
b/boards/arm/imxrt/imxrt1050-evk/configs/libcxxtest/defconfig
index d6751fb604..e3af05261f 100644
--- a/boards/arm/imxrt/imxrt1050-evk/configs/libcxxtest/defconfig
+++ b/boards/arm/imxrt/imxrt1050-evk/configs/libcxxtest/defconfig
@@ -32,7 +32,7 @@ CONFIG_NSH_LINELEN=64
 CONFIG_NSH_READLINE=y
 CONFIG_RAM_SIZE=536870912
 CONFIG_RAM_START=0x2020
-CONFIG_SCHED_CPULOAD=y
+CONFIG_SCHED_CPULOAD_SYSCLK=y
 CONFIG_START_DAY=14
 CONFIG_START_MONTH=3
 CONFIG_SYSTEM_NSH=y
diff --git a/boards/arm/imxrt/imxrt1060-evk/configs/libcxxtest/defconfig 
b/boards/arm/imxrt/imxrt1060-evk/configs/libcxxtest/defconfig
index dc26dcfd87..5c38fafdcb 100644
--- a/boards/arm/imxrt/imxrt1060-evk/configs/libcxxtest/defconfig
+++ b/boards/arm/imxrt/imxrt1060-evk/configs/libcxxtest/defconfig
@@ -32,7 +32,7 @@ CONFIG_NSH_LINELEN=64
 CONFIG_NSH_READLINE=y
 CONFIG_RAM_SIZE=1048576
 CONFIG_RAM_START=0x2020
-CONFIG_SCHED_CPULOAD=y
+CONFIG_SCHED_CPULOAD_SYSCLK=y
 CONFIG_START_DAY=14
 CONFIG_START_MONTH=3
 CONFIG_SYSTEM_NSH=y
diff --git a/boards/arm/imxrt/imxrt1064-evk/configs/libcxxtest/defconfig 
b/boards/arm/imxrt/imxrt1064-evk/configs/libcxxtest/defconfig
index 817a01d802..9ac593e74a 100644
--- a/boards/arm/imxrt/imxrt1064-evk/configs/libcxxtest/defconfig
+++ b/boards/arm/imxrt/imxrt1064-evk/configs/libcxxtest/defconfig
@@ -32,7 +32,7 @@ CONFIG_NSH_LINELEN=64
 CONFIG_NSH_READLINE=y
 CONFIG_RAM_SIZE=1048576
 CONFIG_RAM_START=0x2020
-CONFIG_SCHED_CPULOAD=y
+CONFIG_SCHED_CPULOAD_SYSCLK=y
 CONFIG_START_DAY=14
 CONFIG_START_MONTH=3
 CONFIG_SYSTEM_NSH=y
diff --git a/boards/arm/imxrt/teensy-4.x/configs/pikron-bb/defconfig 
b/boards/arm/imxrt/teensy-4.x/configs/pikron-bb/defconfig
index 230c687f4d..9eeb882f7b 100644
--- a/boards/arm/imxrt/teensy-4.x/configs/pikron-bb/defconfig
+++ b/boards/arm/imxrt/teensy-4.x/configs/pikron-bb/defconfig
@@ -143,7 +143,6 @@ CONFIG_RAM_SIZE=1048576
 CONFIG_RAM_START=0x2020
 CONFIG_READLINE_CMD_HISTORY=y
 CONFIG_RR_INTERVAL=10
-CONFIG_SCHED_CPULOAD=y
 CONFIG_SCHED_LPWORK=y
 CONFIG_SCHED_TICKLESS=y
 CONFIG_SCHED_TICKLESS_ALARM=y
diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/configs/nsh/defconfig 
b/boards/arm/lpc17xx_40xx/lx_cpu/configs/nsh/defconfig
index 900db1cfb1..0d23ad5f66 100644
--- a/boards/arm/lpc17xx_40xx/lx_cpu/configs/nsh/defconfig
+++ 

Re: [PR] sched: explicitly select the cpuload clock source configuration [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 merged PR #11102:
URL: https://github.com/apache/nuttx/pull/11102


-- 
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...@nuttx.apache.org

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



(nuttx) branch master updated: s32k3xxx:serial ensure the cache is updated if the DMA has updated again

2023-10-31 Thread xiaoxiang
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new e0c883f487 s32k3xxx:serial ensure the cache is updated if the DMA has 
updated again
e0c883f487 is described below

commit e0c883f487718f9439a5e88b3208bacad744f78f
Author: David Sidrane 
AuthorDate: Wed Oct 25 03:59:54 2023 -0700

s32k3xxx:serial ensure the cache is updated if the DMA has updated again
---
 arch/arm/src/s32k3xx/s32k3xx_serial.c | 20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/arm/src/s32k3xx/s32k3xx_serial.c 
b/arch/arm/src/s32k3xx/s32k3xx_serial.c
index 3ef3dccb1b..d14e739775 100644
--- a/arch/arm/src/s32k3xx/s32k3xx_serial.c
+++ b/arch/arm/src/s32k3xx/s32k3xx_serial.c
@@ -2814,6 +2814,7 @@ static inline void s32k3xx_serialout(struct 
s32k3xx_uart_s *priv,
 static int s32k3xx_dma_nextrx(struct s32k3xx_uart_s *priv)
 {
   int dmaresidual = s32k3xx_dmach_getcount(priv->rxdma);
+  DEBUGASSERT(dmaresidual <= RXDMA_BUFFER_SIZE);
 
   return (RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE;
 }
@@ -3780,13 +3781,25 @@ static bool s32k3xx_rxflowcontrol(struct uart_dev_s 
*dev,
 static int s32k3xx_dma_receive(struct uart_dev_s *dev, unsigned int *status)
 {
   struct s32k3xx_uart_s *priv = (struct s32k3xx_uart_s *)dev;
-  uint32_t nextrx = s32k3xx_dma_nextrx(priv);
-  int c = 0;
+  static uint32_t last_nextrx = -1;
+  uint32_t nextrx = s32k3xx_dma_nextrx(priv);
+  int c   = 0;
 
   /* Check if more data is available */
 
   if (nextrx != priv->rxdmanext)
 {
+  /* Now we must ensure the cache is updated if the DMA has
+   * updated again.
+   */
+
+  if (last_nextrx != nextrx)
+{
+  up_invalidate_dcache((uintptr_t)priv->rxfifo,
+   (uintptr_t)priv->rxfifo + RXDMA_BUFFER_SIZE);
+  last_nextrx = nextrx;
+}
+
   /* Now read from the DMA buffer */
 
   c = priv->rxfifo[priv->rxdmanext];
@@ -4155,9 +4168,6 @@ static void s32k3xx_dma_rxcallback(DMACH_HANDLE handle, 
void *arg, bool done,
   struct s32k3xx_uart_s *priv = (struct s32k3xx_uart_s *)arg;
   uint32_t sr;
 
-  up_invalidate_dcache((uintptr_t)priv->rxfifo,
-   (uintptr_t)priv->rxfifo + RXDMA_BUFFER_SIZE);
-
   if (priv->rxenable && s32k3xx_dma_rxavailable(>dev))
 {
   uart_recvchars(>dev);



Re: [PR] s32k3xx: serial ensure the cache is updated if the DMA has updated again [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 merged PR #11106:
URL: https://github.com/apache/nuttx/pull/11106


-- 
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...@nuttx.apache.org

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



Re: [PR] nsh: explicitly select the cpuload clock source configuration [nuttx-apps]

2023-10-31 Thread via GitHub


xiaoxiang781216 merged PR #2170:
URL: https://github.com/apache/nuttx-apps/pull/2170


-- 
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...@nuttx.apache.org

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



(nuttx-apps) branch master updated: nsh: rename CONFIG_SCHED_CPULOAD to CONFIG_SCHED_CPULOAD_NONE

2023-10-31 Thread xiaoxiang
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
 new 647db6393 nsh: rename CONFIG_SCHED_CPULOAD to CONFIG_SCHED_CPULOAD_NONE
647db6393 is described below

commit 647db6393d59dbeab3c12ab5d692585fa608148e
Author: yinshengkai 
AuthorDate: Tue Oct 31 11:38:23 2023 +0800

nsh: rename CONFIG_SCHED_CPULOAD to CONFIG_SCHED_CPULOAD_NONE

Explicitly select dependencies to avoid automatically selecting 
inappropriate configurations.

Signed-off-by: yinshengkai 
---
 nshlib/nsh.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nshlib/nsh.h b/nshlib/nsh.h
index a198e6c87..ec5262b30 100644
--- a/nshlib/nsh.h
+++ b/nshlib/nsh.h
@@ -491,7 +491,7 @@
 
 #define NSH_HAVE_CPULOAD  1
 #if !defined(CONFIG_FS_PROCFS) || defined(CONFIG_FS_PROCFS_EXCLUDE_CPULOAD) || 
\
-!defined(CONFIG_SCHED_CPULOAD) || defined(CONFIG_NSH_DISABLE_PS)
+defined(CONFIG_SCHED_CPULOAD_NONE) || defined(CONFIG_NSH_DISABLE_PS)
 #  undef NSH_HAVE_CPULOAD
 #endif
 



Re: [PR] feature: spinlock benchmark [nuttx-apps]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on code in PR #2168:
URL: https://github.com/apache/nuttx-apps/pull/2168#discussion_r1378304129


##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,102 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#define TEST_NUM CONFIG_SPINLOCK_MULTITHREAD
+#define THREAD_NUM CONFIG_SPINLOCK_MULTITHREAD
+
+/
+ * Private Data

Review Comment:
   Type



##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,102 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#define TEST_NUM CONFIG_SPINLOCK_MULTITHREAD
+#define THREAD_NUM CONFIG_SPINLOCK_MULTITHREAD
+
+/
+ * Private Data
+ /
+
+struct thread_parmeter_s
+{
+  int *g_result;

Review Comment:
   ```suggestion
 int *result;
   ```



##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,102 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+

(nuttx-website) branch asf-site updated: Publishing web: 36ddd7c60a8230335eda886c909bc938739114a2 docs: 0bc897df15afac24da27feacfb666b9c51cdc669

2023-10-31 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/nuttx-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
 new 72bd765f Publishing web: 36ddd7c60a8230335eda886c909bc938739114a2 
docs: 0bc897df15afac24da27feacfb666b9c51cdc669
72bd765f is described below

commit 72bd765f16520a00427e0481fd7e6ceb8f4fa019
Author: Alin Jerpelea 
AuthorDate: Wed Nov 1 00:17:10 2023 +

Publishing web: 36ddd7c60a8230335eda886c909bc938739114a2 docs: 
0bc897df15afac24da27feacfb666b9c51cdc669
---
 content/docs/10.0.0/index.html | 2 +-
 content/docs/10.0.0/searchindex.js | 2 +-
 content/docs/10.0.1/index.html | 2 +-
 content/docs/10.0.1/searchindex.js | 2 +-
 content/docs/10.1.0/index.html | 2 +-
 content/docs/10.1.0/searchindex.js | 2 +-
 content/docs/10.2.0/index.html | 2 +-
 content/docs/10.2.0/searchindex.js | 2 +-
 content/docs/10.3.0/index.html | 2 +-
 content/docs/10.3.0/searchindex.js | 2 +-
 content/docs/11.0.0/index.html | 2 +-
 content/docs/11.0.0/searchindex.js | 2 +-
 content/docs/12.0.0/index.html | 2 +-
 content/docs/12.0.0/searchindex.js | 2 +-
 content/docs/12.1.0/index.html | 2 +-
 content/docs/12.1.0/searchindex.js | 2 +-
 content/docs/12.2.0/index.html | 2 +-
 content/docs/12.2.0/searchindex.js | 2 +-
 content/docs/12.2.1/index.html | 2 +-
 content/docs/12.2.1/searchindex.js | 2 +-
 content/docs/12.3.0/index.html | 2 +-
 content/docs/12.3.0/searchindex.js | 2 +-
 content/docs/latest/index.html | 2 +-
 content/docs/latest/searchindex.js | 2 +-
 content/feed.xml   | 4 ++--
 25 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/content/docs/10.0.0/index.html b/content/docs/10.0.0/index.html
index 0896549f..76fdc98c 100644
--- a/content/docs/10.0.0/index.html
+++ b/content/docs/10.0.0/index.html
@@ -131,7 +131,7 @@ by following these 
 NuttX Documentation
 NuttX is a real-time operating system (RTOS) with an emphasis on standards 
compliance and small footprint. Scalable from 8-bit to 32-bit microcontroller 
environments, the primary governing standards in NuttX are Posix and ANSI 
standards. Additional standard APIs from Unix and other common RTOS’s (such as 
VxWorks) are adopted for functionality not available under these standards, or 
for functionality that is not appropriate for deeply-embedded environments 
(such as fork()).
-Last Updated: 31 October 23 at 00:10
+Last Updated: 01 November 23 at 00:10
 
 Table of 
Contents
 
diff --git a/content/docs/10.0.0/searchindex.js 
b/content/docs/10.0.0/searchindex.js
index 27df0b1f..6ec1f45e 100644
--- a/content/docs/10.0.0/searchindex.js
+++ b/content/docs/10.0.0/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"docnames": ["applications/index", "boards/index", 
"components/binfmt", "components/drivers/block/index", 
"components/drivers/character/analog", "components/drivers/character/can", 
"components/drivers/character/index", "components/drivers/character/keypad", 
"components/drivers/character/pwm", "components/drivers/character/quadrature", 
"components/drivers/character/rtc", "components/drivers/character/serial", 
"components/drivers/character/timer", "components/drivers/chara [...]
\ No newline at end of file
+Search.setIndex({"docnames": ["applications/index", "boards/index", 
"components/binfmt", "components/drivers/block/index", 
"components/drivers/character/analog", "components/drivers/character/can", 
"components/drivers/character/index", "components/drivers/character/keypad", 
"components/drivers/character/pwm", "components/drivers/character/quadrature", 
"components/drivers/character/rtc", "components/drivers/character/serial", 
"components/drivers/character/timer", "components/drivers/chara [...]
\ No newline at end of file
diff --git a/content/docs/10.0.1/index.html b/content/docs/10.0.1/index.html
index a12f494f..c3fc2b9b 100644
--- a/content/docs/10.0.1/index.html
+++ b/content/docs/10.0.1/index.html
@@ -153,7 +153,7 @@ by following these 
 NuttX Documentation
 NuttX is a real-time operating system (RTOS) with an emphasis on standards 
compliance and small footprint. Scalable from 8-bit to 32-bit microcontroller 
environments, the primary governing standards in NuttX are Posix and ANSI 
standards. Additional standard APIs from Unix and other common RTOS’s (such as 
VxWorks) are adopted for functionality not available under these standards, or 
for functionality that is not appropriate for deeply-embedded environments 
(such as fork()).
-Last Updated: 31 October 23 at 00:10
+Last Updated: 01 November 23 at 00:11
 
 Table of 
Contents
 
diff --git a/content/docs/10.0.1/searchindex.js 
b/content/docs/10.0.1/searchindex.js
index eb495ee5..f02c57bf 100644
--- a/content/docs/10.0.1/searchindex.js
+++ b/content/docs/10.0.1/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"docnames": ["applications/index", "boards/index", 

Re: [I] Difficulty in configuring NuttX to enable many features at once [nuttx]

2023-10-31 Thread via GitHub


robertlipe commented on issue #11105:
URL: https://github.com/apache/nuttx/issues/11105#issuecomment-1788117555

   For easily reproducible builds, use kconfig-tweak in a script to turn the 
flags you want off and on without ever manually touching menuconfig.
   
   
https://nuttx.apache.org/docs/latest/quickstart/configuring.html#fast-configuration-changes
   
   You can find examples of scripts doing this in Lup's (excellent) writings on 
Nuttx:
   
   https://lupyuen.github.io/articles/auto#configure-build


-- 
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...@nuttx.apache.org

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



Re: [PR] Usrsock socket fallback with ENETDOWN [nuttx]

2023-10-31 Thread via GitHub


dlizewski commented on code in PR #11107:
URL: https://github.com/apache/nuttx/pull/11107#discussion_r1377994323


##
net/socket/socket.c:
##
@@ -104,9 +104,11 @@ int psock_socket(int domain, int type, int protocol,
 
   /* When usrsock daemon returns -ENOSYS or -ENOTSUP, it means to use
* kernel's network stack, so fallback to kernel socket.
+   * When -ENETDOWN is returned, it means the usrsock daemon was never
+   * launched or is no longer running, so fallback to kernel socket.
*/
 
-  if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP))
+  if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP && ret != -ENETDOWN))

Review Comment:
   As far as I can see, -ENETDOWN is only returned from usrsock_sockif_setup() 
if either:
   a. the application side doesn't have the dev node open. In which case 
usrsockdev_is_opened() returns false in usrsock_request().
 
usrsock_sockif_setup()->usrsock_socket()->do_socket_request()->usrsock_do_request()->usrsock_request
 returns() -> returns -ENETDOWN
   
   b. The USRSOCK_EVENT_ABORT event is sent to the callback "socket_event" 
registered in usrsock_socket().
   The USRSOCK_EVENT_ABORT is only set in usrsock_abort() which is called when 
the application closes the /dev/usrsock devnode. Both cases should fallback to 
kernel provided sockets.
   
   
   Is there another case of -ENETDOWN that I did not see?



-- 
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...@nuttx.apache.org

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



Re: [PR] usrsock_rpmsg_server: Keep msg order in recursive call [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on code in PR #11103:
URL: https://github.com/apache/nuttx/pull/11103#discussion_r1377943335


##
drivers/usrsock/usrsock_rpmsg_server.c:
##
@@ -997,6 +1019,10 @@ static void usrsock_rpmsg_ns_bind(FAR struct rpmsg_device 
*rdev,
 }
 
   uept->ept.priv = priv;
+  for (i = 0; i < CONFIG_NET_USRSOCK_RPMSG_SERVER_NIOVEC; i++)
+{
+  sq_addlast(>reqs[i].flink, >req_free);

Review Comment:
   sq_addfirst



##
drivers/usrsock/usrsock_rpmsg_server.c:
##
@@ -1042,28 +1068,84 @@ static void usrsock_rpmsg_ns_unbind(FAR struct 
rpmsg_endpoint *ept)
   kmm_free(ept);
 }
 
-static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
-FAR void *data, size_t len, uint32_t src,
-FAR void *priv_)
+static int usrsock_rpmsg_ept_do_cb(FAR struct usrsock_rpmsg_ept_s *uept,
+   FAR void *data, size_t len, uint32_t src,
+   FAR struct usrsock_rpmsg_s *priv)
 {
   FAR struct usrsock_request_common_s *common = data;
-  FAR struct usrsock_rpmsg_ept_s *uept =
-(FAR struct usrsock_rpmsg_ept_s *)ept;
-  FAR struct usrsock_rpmsg_s *priv = priv_;
 
   if (uept->remain > 0)
 {
-  return usrsock_rpmsg_sendto_handler(ept, data, len, src, priv);
+  return usrsock_rpmsg_sendto_handler(>ept, data, len, src, priv);
 }
   else if (common->reqid >= 0 && common->reqid <= USRSOCK_REQUEST__MAX)
 {
-  return g_usrsock_rpmsg_handler[common->reqid](ept, data, len,
+  return g_usrsock_rpmsg_handler[common->reqid](>ept, data, len,
 src, priv);
 }
 
   return -EINVAL;
 }
 
+static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
+FAR void *data, size_t len, uint32_t src,
+FAR void *priv_)
+{
+  FAR struct usrsock_rpmsg_s *priv = priv_;
+  FAR struct usrsock_rpmsg_ept_s *uept =
+(FAR struct usrsock_rpmsg_ept_s *)ept;
+  FAR struct usrsock_rpmsg_req_s *req;
+  int ret;
+
+  /* This callback is called from only one thread per ept, so don't need any
+   * lock for `inuse` state.
+   */
+
+  if (uept->inuse)
+{
+  /* Avoid recursive call. */
+
+  req = (FAR struct usrsock_rpmsg_req_s *)sq_remfirst(>req_free);
+  if (req == NULL)
+{
+  return -ENOMEM;
+}
+
+  req->data = data;
+  req->len  = len;
+  req->src  = src;
+  sq_addlast(>flink, >req_pending);
+
+  rpmsg_hold_rx_buffer(ept, data);
+  return OK;
+}
+
+  uept->inuse = true;
+  ret = usrsock_rpmsg_ept_do_cb(uept, data, len, src, priv);
+
+  /* Pop pending requests to proceed. */
+
+  while ((req = (FAR struct usrsock_rpmsg_req_s *)
+ sq_remfirst(>req_pending)) != NULL)
+{
+  data = req->data;
+  len  = req->len;
+  src  = req->src;
+  sq_addlast(>flink, >req_free);

Review Comment:
   sq_addfirst



-- 
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...@nuttx.apache.org

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



Re: [PR] usrsock_rpmsg_server: Keep msg order in recursive call [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on code in PR #11103:
URL: https://github.com/apache/nuttx/pull/11103#discussion_r1377942272


##
drivers/usrsock/usrsock_rpmsg_server.c:
##
@@ -1042,28 +1068,84 @@ static void usrsock_rpmsg_ns_unbind(FAR struct 
rpmsg_endpoint *ept)
   kmm_free(ept);
 }
 
-static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
-FAR void *data, size_t len, uint32_t src,
-FAR void *priv_)
+static int usrsock_rpmsg_ept_do_cb(FAR struct usrsock_rpmsg_ept_s *uept,
+   FAR void *data, size_t len, uint32_t src,
+   FAR struct usrsock_rpmsg_s *priv)
 {
   FAR struct usrsock_request_common_s *common = data;
-  FAR struct usrsock_rpmsg_ept_s *uept =
-(FAR struct usrsock_rpmsg_ept_s *)ept;
-  FAR struct usrsock_rpmsg_s *priv = priv_;
 
   if (uept->remain > 0)
 {
-  return usrsock_rpmsg_sendto_handler(ept, data, len, src, priv);
+  return usrsock_rpmsg_sendto_handler(>ept, data, len, src, priv);
 }
   else if (common->reqid >= 0 && common->reqid <= USRSOCK_REQUEST__MAX)
 {
-  return g_usrsock_rpmsg_handler[common->reqid](ept, data, len,
+  return g_usrsock_rpmsg_handler[common->reqid](>ept, data, len,
 src, priv);
 }
 
   return -EINVAL;
 }
 
+static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
+FAR void *data, size_t len, uint32_t src,
+FAR void *priv_)
+{
+  FAR struct usrsock_rpmsg_s *priv = priv_;
+  FAR struct usrsock_rpmsg_ept_s *uept =
+(FAR struct usrsock_rpmsg_ept_s *)ept;
+  FAR struct usrsock_rpmsg_req_s *req;
+  int ret;
+
+  /* This callback is called from only one thread per ept, so don't need any
+   * lock for `inuse` state.
+   */
+
+  if (uept->inuse)
+{
+  /* Avoid recursive call. */
+
+  req = (FAR struct usrsock_rpmsg_req_s *)sq_remfirst(>req_free);
+  if (req == NULL)
+{
+  return -ENOMEM;
+}
+
+  req->data = data;
+  req->len  = len;
+  req->src  = src;
+  sq_addlast(>flink, >req_pending);

Review Comment:
   should we use double link to avoid the search?



-- 
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...@nuttx.apache.org

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



Re: [PR] Usrsock socket fallback with ENETDOWN [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on code in PR #11107:
URL: https://github.com/apache/nuttx/pull/11107#discussion_r1377938070


##
net/socket/socket.c:
##
@@ -104,9 +104,11 @@ int psock_socket(int domain, int type, int protocol,
 
   /* When usrsock daemon returns -ENOSYS or -ENOTSUP, it means to use
* kernel's network stack, so fallback to kernel socket.
+   * When -ENETDOWN is returned, it means the usrsock daemon was never
+   * launched or is no longer running, so fallback to kernel socket.
*/
 
-  if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP))
+  if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP && ret != -ENETDOWN))

Review Comment:
   since -ENETDOWN return in other case, should we change the errror code to 
-ENOSYS/-ENOTSUP if the server doesn't launch yet?



-- 
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...@nuttx.apache.org

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



[PR] Fallback with ENETDOWN [nuttx]

2023-10-31 Thread via GitHub


dlizewski opened a new pull request, #11107:
URL: https://github.com/apache/nuttx/pull/11107

   ## Summary
   #9647 added the ability to do runtime selection of usrsock and fallback to 
kernel provided sockets, but the problem is that it currently requires the 
application side usrsock daemon to be running in order to respond with -ENOSYS 
or -ENOTSUP.
   
   There is already code in usrsock that checks if there is an application side 
daemon listening and returns -ENETDOWN if nothing is listening.
   Specifically in "usrsock_request" in drivers/usrsock/usrsock_dev.c
   
   Enabling fallback to kernel socket with -ENETDOWN allows the application to 
not launch the usrsock daemon when not needed. Otherwise my application needs 
to keep the daemon running for the sole purpose of saying it's off wasting 
resources.
   
   This was likely the original intention of original author based on the 
comment in "usrsock_sockif_setup" which says:
   
   ```
/* Let the user socket logic handle the setup...
  *
  * A return value of zero means that the operation was
  * successfully handled by usrsock.  A negative value means that
  * an error occurred.  The special error value -ENETDOWN means
  * that usrsock daemon is not running.  The caller should attempt
  * to open socket with kernel networking stack in this case.
  */
  ```
   
   
   ## Impact
   
   ## Testing
   
   


-- 
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...@nuttx.apache.org

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



[PR] s32k3xx: serial ensure the cache is updated if the DMA has updated again [nuttx]

2023-10-31 Thread via GitHub


PetervdPerk-NXP opened a new pull request, #11106:
URL: https://github.com/apache/nuttx/pull/11106

   ## Summary
   LPUART had data corruptions at high rate data, this was caused by a cache 
coherency issue.
   This patch ensures the cache is updated if the DMA has updated again 
   
   ## Impact
   S32K3XX
   
   ## Testing
   PX4 & MR-CANHUBK344
   


-- 
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...@nuttx.apache.org

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



Re: [I] Low priority tasks interrupt high priority threads [nuttx]

2023-10-31 Thread via GitHub


zouboan commented on issue #6012:
URL: https://github.com/apache/nuttx/issues/6012#issuecomment-1787465862

   Nice! Let me have a test.


-- 
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...@nuttx.apache.org

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



(nuttx) branch master updated: FIX: s32kxxx flexcan doesn't set srr bit for extended frames

2023-10-31 Thread acassis
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 0bc897df15 FIX: s32kxxx flexcan doesn't set srr bit for extended frames
0bc897df15 is described below

commit 0bc897df15afac24da27feacfb666b9c51cdc669
Author: Gabriel de Sousa 
AuthorDate: Mon Oct 30 19:27:38 2023 -0400

FIX: s32kxxx flexcan doesn't set srr bit for extended frames
---
 arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 2 ++
 arch/arm/src/s32k3xx/s32k3xx_flexcan.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c 
b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 7bc9a7c59c..714b94d0a1 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -695,6 +695,7 @@ static int s32k1xx_transmit(struct s32k1xx_driver_s *priv)
   if (frame->can_id & CAN_EFF_FLAG)
 {
   cs.ide = 1;
+  cs.srr = 1;
   mb->id.ext = frame->can_id & MASKEXTID;
 }
   else
@@ -718,6 +719,7 @@ static int s32k1xx_transmit(struct s32k1xx_driver_s *priv)
   if (frame->can_id & CAN_EFF_FLAG)
 {
   cs.ide = 1;
+  cs.srr = 1;
   mb->id.ext = frame->can_id & MASKEXTID;
 }
   else
diff --git a/arch/arm/src/s32k3xx/s32k3xx_flexcan.c 
b/arch/arm/src/s32k3xx/s32k3xx_flexcan.c
index acb289a9ad..0e9fb46eed 100644
--- a/arch/arm/src/s32k3xx/s32k3xx_flexcan.c
+++ b/arch/arm/src/s32k3xx/s32k3xx_flexcan.c
@@ -857,6 +857,7 @@ static int s32k3xx_transmit(struct s32k3xx_driver_s *priv)
   if (frame->can_id & CAN_EFF_FLAG)
 {
   cs.ide = 1;
+  cs.srr = 1;
   mb->id.ext = frame->can_id & MASKEXTID;
 }
   else
@@ -880,6 +881,7 @@ static int s32k3xx_transmit(struct s32k3xx_driver_s *priv)
   if (frame->can_id & CAN_EFF_FLAG)
 {
   cs.ide = 1;
+  cs.srr = 1;
   mb->id.ext = frame->can_id & MASKEXTID;
 }
   else



Re: [PR] FIX: s32kxxx flexcan doesn't set srr bit for extended frames [nuttx]

2023-10-31 Thread via GitHub


acassis merged PR #11099:
URL: https://github.com/apache/nuttx/pull/11099


-- 
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...@nuttx.apache.org

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



Re: [PR] tools/configure.c and tools/sethost.sh Add CONFIG_EXPERIMENTAL for configure windows native [nuttx]

2023-10-31 Thread via GitHub


xiaoxiang781216 commented on PR #11098:
URL: https://github.com/apache/nuttx/pull/11098#issuecomment-1787133177

   Ok, but why not remove EXPERIMENTAL from WINDOWS_NATIVE directly? Since it 
works fine with your environment and initial contributor's.


-- 
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...@nuttx.apache.org

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



Re: [I] Low priority tasks interrupt high priority threads [nuttx]

2023-10-31 Thread via GitHub


raiden00pl commented on issue #6012:
URL: https://github.com/apache/nuttx/issues/6012#issuecomment-1787118246

   Can we use rwlock_t from https://github.com/apache/nuttx/pull/10776 to solve 
this issue ? 
   atomic_int is C11 feature I think, so probably it won't be available on all 
supported platforms.
   
   I was testing rwlock_t from https://github.com/apache/nuttx/pull/9739 before 
but it was too slow. 
   This new approach is faster and appears to solve the problem for FOC.


-- 
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...@nuttx.apache.org

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



Re: [PR] feature: spinlock benchmark [nuttx-apps]

2023-10-31 Thread via GitHub


TaiJuWu commented on code in PR #2168:
URL: https://github.com/apache/nuttx-apps/pull/2168#discussion_r1377445193


##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,89 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#define TEST_NUM CONFIG_SPINLOCK_MULTITHREAD
+#define THREAD_NUM CONFIG_SPINLOCK_MULTITHREAD
+
+/
+ * Private Data
+ /
+
+static spinlock_t lock = SP_UNLOCKED;
+
+static pthread_t g_thread[THREAD_NUM];
+
+static int g_result = 0;
+
+static FAR void thread_spinlock(FAR void *parameter)
+{
+  for (int i = 0; i < TEST_NUM; i++)
+{
+  spin_lock();

Review Comment:
   > So this test will be enabled for FLAT build only?
   
   Yes. I modified Kconfig and set this feature depend on BUILD_FLAT.



-- 
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...@nuttx.apache.org

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



Re: [PR] feature: spinlock benchmark [nuttx-apps]

2023-10-31 Thread via GitHub


TaiJuWu commented on code in PR #2168:
URL: https://github.com/apache/nuttx-apps/pull/2168#discussion_r1377453282


##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,89 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#define TEST_NUM CONFIG_SPINLOCK_MULTITHREAD
+#define THREAD_NUM CONFIG_SPINLOCK_MULTITHREAD
+
+/
+ * Private Data
+ /
+
+static spinlock_t lock = SP_UNLOCKED;
+
+static pthread_t g_thread[THREAD_NUM];
+
+static int g_result = 0;

Review Comment:
   Done.



-- 
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...@nuttx.apache.org

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



Re: [PR] feature: spinlock benchmark [nuttx-apps]

2023-10-31 Thread via GitHub


TaiJuWu commented on code in PR #2168:
URL: https://github.com/apache/nuttx-apps/pull/2168#discussion_r1377445193


##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,89 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#define TEST_NUM CONFIG_SPINLOCK_MULTITHREAD
+#define THREAD_NUM CONFIG_SPINLOCK_MULTITHREAD
+
+/
+ * Private Data
+ /
+
+static spinlock_t lock = SP_UNLOCKED;
+
+static pthread_t g_thread[THREAD_NUM];
+
+static int g_result = 0;
+
+static FAR void thread_spinlock(FAR void *parameter)
+{
+  for (int i = 0; i < TEST_NUM; i++)
+{
+  spin_lock();

Review Comment:
   > So this test will be enabled for FLAT build only?
   
   Yes.



-- 
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...@nuttx.apache.org

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



Re: [PR] feature: spinlock benchmark [nuttx-apps]

2023-10-31 Thread via GitHub


TaiJuWu commented on code in PR #2168:
URL: https://github.com/apache/nuttx-apps/pull/2168#discussion_r1377436157


##
benchmarks/spinlock_bench/Makefile:
##
@@ -0,0 +1,52 @@
+
+# apps/benchmarks/coremark/Makefile
+#
+# 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.
+#
+
+
+include $(APPDIR)/Make.defs
+
+# spinlock_bench application
+
+
+# Targets
+
+
+clean::

Review Comment:
   After checking, it can be deleted.



-- 
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...@nuttx.apache.org

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



Re: [PR] feature: spinlock benchmark [nuttx-apps]

2023-10-31 Thread via GitHub


pkarashchenko commented on code in PR #2168:
URL: https://github.com/apache/nuttx-apps/pull/2168#discussion_r1377435583


##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,89 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#define TEST_NUM CONFIG_SPINLOCK_MULTITHREAD
+#define THREAD_NUM CONFIG_SPINLOCK_MULTITHREAD
+
+/
+ * Private Data
+ /
+
+static spinlock_t lock = SP_UNLOCKED;
+
+static pthread_t g_thread[THREAD_NUM];
+
+static int g_result = 0;
+
+static FAR void thread_spinlock(FAR void *parameter)
+{
+  for (int i = 0; i < TEST_NUM; i++)
+{
+  spin_lock();

Review Comment:
   So this test will be enabled for FLAT build only?



-- 
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...@nuttx.apache.org

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



Re: [PR] feature: spinlock benchmark [nuttx-apps]

2023-10-31 Thread via GitHub


pkarashchenko commented on code in PR #2168:
URL: https://github.com/apache/nuttx-apps/pull/2168#discussion_r1377435035


##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,89 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#define TEST_NUM CONFIG_SPINLOCK_MULTITHREAD
+#define THREAD_NUM CONFIG_SPINLOCK_MULTITHREAD
+
+/
+ * Private Data
+ /
+
+static spinlock_t lock = SP_UNLOCKED;
+
+static pthread_t g_thread[THREAD_NUM];
+
+static int g_result = 0;
+
+static FAR void thread_spinlock(FAR void *parameter)
+{
+  for (int i = 0; i < TEST_NUM; i++)
+{
+  spin_lock();

Review Comment:
   Ok.



-- 
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...@nuttx.apache.org

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



Re: [PR] feature: spinlock benchmark [nuttx-apps]

2023-10-31 Thread via GitHub


TaiJuWu commented on code in PR #2168:
URL: https://github.com/apache/nuttx-apps/pull/2168#discussion_r1377428588


##
benchmarks/spinlock_bench/spinlock_bench.c:
##
@@ -0,0 +1,89 @@
+/
+ * apps/benchmarks/spinlock_bench/spinlock_bench.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#define TEST_NUM CONFIG_SPINLOCK_MULTITHREAD
+#define THREAD_NUM CONFIG_SPINLOCK_MULTITHREAD
+
+/
+ * Private Data
+ /
+
+static spinlock_t lock = SP_UNLOCKED;
+
+static pthread_t g_thread[THREAD_NUM];
+
+static int g_result = 0;
+
+static FAR void thread_spinlock(FAR void *parameter)
+{
+  for (int i = 0; i < TEST_NUM; i++)
+{
+  spin_lock();

Review Comment:
   The implement of pthread_spin_lock is different with kernel spinlock.
   My initial idea is testing kernel spinlock.



-- 
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...@nuttx.apache.org

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



Re: [PR] tools/configure.c and tools/sethost.sh Add CONFIG_EXPERIMENTAL for configure windows native [nuttx]

2023-10-31 Thread via GitHub


simbit18 commented on PR #11098:
URL: https://github.com/apache/nuttx/pull/11098#issuecomment-1786901574

   > @simbit18 but why not enable CONFIG_EXPERIMENTAL from defconfig?
   
   Because the Windows native configuration depends on 
   CONFIG_EXPERIMENTAL.
   If CONFIG_EXPERIMENTAL is not enable, the default Windows Build Environment 
is set to Cygwin.
   https://github.com/apache/nuttx/blob/master/Kconfig#L159


-- 
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...@nuttx.apache.org

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



Re: [PR] nsh: explicitly select the cpuload clock source configuration [nuttx-apps]

2023-10-31 Thread via GitHub


Gary-Hobson commented on PR #2170:
URL: https://github.com/apache/nuttx-apps/pull/2170#issuecomment-1786876579

   > @Gary-Hobson 'git commit -sm "This is the message title
   > 
   > this is my message describing the change present in this commit" '
   
   Thank you, now I understand


-- 
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...@nuttx.apache.org

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



Re: [PR] nsh: explicitly select the cpuload clock source configuration [nuttx-apps]

2023-10-31 Thread via GitHub


jerpelea commented on PR #2170:
URL: https://github.com/apache/nuttx-apps/pull/2170#issuecomment-1786865449

   @Gary-Hobson 'git commit -sm "This is the message title
   
   this is my message describing the change present in this commit"
   '


-- 
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...@nuttx.apache.org

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



Re: [PR] Add supoort for hpm6360evk [nuttx]

2023-10-31 Thread via GitHub


freakishness commented on PR #9761:
URL: https://github.com/apache/nuttx/pull/9761#issuecomment-1786864216

   HPMicro's repo  has added support for nuttx:
   
[HPMicro](https://github.com/hpmicro/nuttx/tree/nuttx_with_hpmsdk/arch/risc-v/src/hpmicro)
   But they use their own SDK, not nuttx-style direct reading and writing of 
registers, so is this merge request necessary?


-- 
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...@nuttx.apache.org

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



Re: [PR] nsh: explicitly select the cpuload clock source configuration [nuttx-apps]

2023-10-31 Thread via GitHub


Gary-Hobson commented on PR #2170:
URL: https://github.com/apache/nuttx-apps/pull/2170#issuecomment-1786861323

   > please add commit message
   
   Sorry, I don't quite understand where the commit message refers.
   git commit message (existing before) or github PR message (added)?


-- 
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...@nuttx.apache.org

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



Re: [PR] Add memory tracing event support [nuttx]

2023-10-31 Thread via GitHub


Gary-Hobson closed pull request #10839: Add memory tracing event support
URL: https://github.com/apache/nuttx/pull/10839


-- 
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...@nuttx.apache.org

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



Re: [PR] arch/arm/samv7: Initial support of SocketLIN master interface [nuttx]

2023-10-31 Thread via GitHub


pkarashchenko commented on PR #11002:
URL: https://github.com/apache/nuttx/pull/11002#issuecomment-1786823944

   @acassis I'm a bit in a time pressure right now. I plan to add SocketLIN 
slave as well as a part of this PR before Nov 27. I will include documentation 
as well.


-- 
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...@nuttx.apache.org

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



[I] Difficulty in configuring NuttX to enable many features at once [nuttx]

2023-10-31 Thread via GitHub


cwt opened a new issue, #11105:
URL: https://github.com/apache/nuttx/issues/11105

   I found that the configuration system for NuttX is separated. For example, 
there are esp32s3-devkit:blewifi, esp32s3-devkit:psram_octal, 
esp32s3-devkit:smp, esp32s3-devkit:spiflash, etc. There is no official way to 
enable all of them at once. I struggled for several days to enable one of them 
as my baseline and then used make menuconfig to enable other features, which 
ended up in failure. Finally, I had to use the following commands:
   
   ```console
   $ mkdir boards/xtensa/esp32s3/esp32s3-devkit/configs/cwt
   $ cat boards/xtensa/esp32s3/esp32s3-devkit/configs/blewifi/defconfig \
  boards/xtensa/esp32s3/esp32s3-devkit/configs/psram_octal/defconfig \
  boards/xtensa/esp32s3/esp32s3-devkit/configs/smp/defconfig \
  boards/xtensa/esp32s3/esp32s3-devkit/configs/spiflash/defconfig \
  | grep -v "^#" | sort | uniq > 
boards/xtensa/esp32s3/esp32s3-devkit/configs/cwt/defconfig
   $ vim boards/xtensa/esp32s3/esp32s3-devkit/configs/cwt/defconfig  # to 
remove some unwanted or conflicted options
   $ ./tools/configure.sh esp32s3-devkit:cwt
   $ make menuconfig  # to fine-tune the options and make changes for MTD 
offset and size
   ```
   
   Is there any easier way to do this?


-- 
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...@nuttx.apache.org.apache.org

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



(nuttx) 02/04: boards: cxd56xx: Add cxd5610 gnss driver

2023-10-31 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit f49fa466b6b78dd8e8daa89b144041871a0b169a
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Sat Oct 28 19:20:40 2023 +0900

boards: cxd56xx: Add cxd5610 gnss driver

Add cxd5610 gnss driver as board-specific sensor driver.
---
 boards/arm/cxd56xx/drivers/sensors/Kconfig|   51 +
 boards/arm/cxd56xx/drivers/sensors/Make.defs  |4 +
 boards/arm/cxd56xx/drivers/sensors/cxd5610_gnss.c | 2266 +
 include/nuttx/sensors/cxd5610_gnss.h  |   98 +
 4 files changed, 2419 insertions(+)

diff --git a/boards/arm/cxd56xx/drivers/sensors/Kconfig 
b/boards/arm/cxd56xx/drivers/sensors/Kconfig
index 17909755cf..1523a62a8d 100644
--- a/boards/arm/cxd56xx/drivers/sensors/Kconfig
+++ b/boards/arm/cxd56xx/drivers/sensors/Kconfig
@@ -203,3 +203,54 @@ config RPR0521RS_PROXIMITY_INTERRUPT
 
 endif # SENSORS_RPR0521RS_SCU
 endif # SCU_SENSORS
+
+config SENSORS_CXD5610_GNSS
+   bool "Sony CXD5610 GNSS"
+   default n
+   ---help---
+   Enable driver for CXD5610 GNSS device.
+
+if SENSORS_CXD5610_GNSS
+
+config SENSORS_CXD5610_GNSS_SNDBUF_SIZE
+   int "CXD5610 GNSS send buffer size"
+   default 64
+
+config SENSORS_CXD5610_GNSS_RCVBUF_SIZE
+   int "CXD5610 GNSS receive buffer size"
+   default 64
+
+config SENSORS_CXD5610_GNSS_NOTIFYBUF_SIZE
+   int "CXD5610 GNSS notify buffer size"
+   default 1536
+
+config SENSORS_CXD5610_GNSS_NPOLLWAITERS
+   int "CXD5610 GNSS max poll waiters"
+   default 4
+
+config SENSORS_CXD5610_GNSS_NSIGNALRECEIVERS
+   int "CXD5610 GNSS max signal receivers"
+   default 4
+
+config SENSORS_CXD5610_GNSS_RX_THREAD_PRIORITY
+   int "CXD5610 GNSS receive thread priority"
+   default 120
+
+config SENSORS_CXD5610_GNSS_RX_THREAD_STACKSIZE
+   int "CXD5610 GNSS receive thread stack size"
+   default 1024
+
+config SENSORS_CXD5610_GNSS_UNALIGNED_ACCESS
+   bool "Unaligned access"
+   default y
+   depends on !ENDIAN_BIG
+   ---help---
+   Support unaligned word and half-word access on little endian.
+
+config SENSORS_CXD5610_GNSS_READ_COMPAT
+   bool "Compatible with CXD5602 GNSS"
+   default y
+   ---help---
+   Support compatible with CXD5602 GNSS
+
+endif # SENSORS_CXD5610_GNSS
diff --git a/boards/arm/cxd56xx/drivers/sensors/Make.defs 
b/boards/arm/cxd56xx/drivers/sensors/Make.defs
index cad7d3cf97..c39dd385ea 100644
--- a/boards/arm/cxd56xx/drivers/sensors/Make.defs
+++ b/boards/arm/cxd56xx/drivers/sensors/Make.defs
@@ -62,6 +62,10 @@ ifeq ($(CONFIG_SENSORS_RPR0521RS_SCU),y)
   CSRCS += rpr0521rs_scu.c
 endif
 
+ifeq ($(CONFIG_SENSORS_CXD5610_GNSS),y)
+  CSRCS += cxd5610_gnss.c
+endif
+
 DEPPATH += --dep-path platform$(DELIM)sensors
 VPATH += :platform$(DELIM)sensors
 CFLAGS += 
${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)platform$(DELIM)sensors
diff --git a/boards/arm/cxd56xx/drivers/sensors/cxd5610_gnss.c 
b/boards/arm/cxd56xx/drivers/sensors/cxd5610_gnss.c
new file mode 100644
index 00..9f3d901c6c
--- /dev/null
+++ b/boards/arm/cxd56xx/drivers/sensors/cxd5610_gnss.c
@@ -0,0 +1,2266 @@
+/
+ * boards/arm/cxd56xx/drivers/sensors/cxd5610_gnss.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/
+ * Pre-processor Definitions
+ /
+
+#ifndef MIN
+#  define MIN(a,b)  (((a) < (b)) ? (a) : (b))
+#endif  /* 

(nuttx) 04/04: boards: cxd56xx: Register cxd5610 gnss driver

2023-10-31 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 2f1b4a49ceae9b5ba47dc53351898e905d8912c4
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Sat Oct 28 20:19:35 2023 +0900

boards: cxd56xx: Register cxd5610 gnss driver

Register device file for cxd5610 gnss driver.
---
 boards/arm/cxd56xx/spresense/include/board.h | 1 +
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c | 8 
 2 files changed, 9 insertions(+)

diff --git a/boards/arm/cxd56xx/spresense/include/board.h 
b/boards/arm/cxd56xx/spresense/include/board.h
index 76e196faf2..e518e1f8c7 100644
--- a/boards/arm/cxd56xx/spresense/include/board.h
+++ b/boards/arm/cxd56xx/spresense/include/board.h
@@ -66,6 +66,7 @@
 #include "cxd56_rpr0521rs.h"
 #include "cxd56_scd41.h"
 #include "cxd56_sensors.h"
+#include "cxd56_gnss_addon.h"
 
 #ifdef CONFIG_VIDEO_ISX012
 #  include "cxd56_isx012.h"
diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c 
b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
index f09ba02af2..f377935c48 100644
--- a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
+++ b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
@@ -493,6 +493,14 @@ int cxd56_bringup(void)
 }
 #endif
 
+#if defined(CONFIG_CXD56_GNSS_ADDON) && 
!defined(CONFIG_CXD56_GNSS_ADDON_LATE_INITIALIZE)
+  ret = board_gnss_addon_initialize("/dev/gps2", 0);
+  if (ret < 0)
+{
+  _err("ERROR: Failed to initialize gnss addon.\n");
+}
+#endif
+
 #ifdef CONFIG_CXD56_GEOFENCE
   ret = cxd56_geofenceinitialize("/dev/geofence");
   if (ret < 0)



(nuttx) branch master updated (c1db9732c5 -> 2f1b4a49ce)

2023-10-31 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from c1db9732c5 libs/libc/spawn: Add minimal implementation for 
posix_spawnattr_destory.
 new ed5785ad06 arch: cxd56xx: Update gnss header files
 new f49fa466b6 boards: cxd56xx: Add cxd5610 gnss driver
 new 0ee2bb51b8 boards: cxd56xx: Add cxd5610 gnss lowerhalf driver
 new 2f1b4a49ce boards: cxd56xx: Register cxd5610 gnss driver

The 4 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:
 arch/arm/include/cxd56xx/gnss.h|   38 +-
 arch/arm/include/cxd56xx/gnss_type.h   |  112 +-
 boards/arm/cxd56xx/common/CMakeLists.txt   |4 +
 boards/arm/cxd56xx/common/src/Make.defs|4 +
 boards/arm/cxd56xx/common/src/cxd56_gnss_addon.c   |  163 ++
 boards/arm/cxd56xx/drivers/sensors/Kconfig |   51 +
 boards/arm/cxd56xx/drivers/sensors/Make.defs   |4 +
 boards/arm/cxd56xx/drivers/sensors/cxd5610_gnss.c  | 2266 
 boards/arm/cxd56xx/spresense/Kconfig   |   18 +
 boards/arm/cxd56xx/spresense/include/board.h   |1 +
 .../{cxd56_emmcdev.h => cxd56_gnss_addon.h}|   17 +-
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c   |8 +
 .../{leds/apa102.h => sensors/cxd5610_gnss.h}  |   70 +-
 13 files changed, 2711 insertions(+), 45 deletions(-)
 create mode 100644 boards/arm/cxd56xx/common/src/cxd56_gnss_addon.c
 create mode 100644 boards/arm/cxd56xx/drivers/sensors/cxd5610_gnss.c
 copy boards/arm/cxd56xx/spresense/include/{cxd56_emmcdev.h => 
cxd56_gnss_addon.h} (80%)
 copy include/nuttx/{leds/apa102.h => sensors/cxd5610_gnss.h} (59%)



(nuttx) 03/04: boards: cxd56xx: Add cxd5610 gnss lowerhalf driver

2023-10-31 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0ee2bb51b840e32460ec9e0b5fde2111eddf1462
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Sat Oct 28 20:17:37 2023 +0900

boards: cxd56xx: Add cxd5610 gnss lowerhalf driver

Add cxd5610 gnss lowerhalf driver with i2c interface.
---
 boards/arm/cxd56xx/common/CMakeLists.txt   |   4 +
 boards/arm/cxd56xx/common/src/Make.defs|   4 +
 boards/arm/cxd56xx/common/src/cxd56_gnss_addon.c   | 163 +
 boards/arm/cxd56xx/spresense/Kconfig   |  18 +++
 .../cxd56xx/spresense/include/cxd56_gnss_addon.h   |  71 +
 5 files changed, 260 insertions(+)

diff --git a/boards/arm/cxd56xx/common/CMakeLists.txt 
b/boards/arm/cxd56xx/common/CMakeLists.txt
index 4ed42aa228..65bbb9e36c 100644
--- a/boards/arm/cxd56xx/common/CMakeLists.txt
+++ b/boards/arm/cxd56xx/common/CMakeLists.txt
@@ -179,5 +179,9 @@ if(CONFIG_ARCH_BOARD_COMMON)
 list(APPEND SRCS src/cxd56_usbdevserialstr.c)
   endif()
 
+  if(CONFIG_CXD56_GNSS_ADDON)
+list(APPEND SRCS src/cxd56_gnss_addon.c)
+  endif()
+
   target_sources(board PRIVATE ${SRCS})
 endif()
diff --git a/boards/arm/cxd56xx/common/src/Make.defs 
b/boards/arm/cxd56xx/common/src/Make.defs
index f118b89607..cfa132ed09 100644
--- a/boards/arm/cxd56xx/common/src/Make.defs
+++ b/boards/arm/cxd56xx/common/src/Make.defs
@@ -184,6 +184,10 @@ ifeq ($(CONFIG_PM),y)
   CSRCS += cxd56_pm.c
 endif
 
+ifeq ($(CONFIG_CXD56_GNSS_ADDON),y)
+  CSRCS += cxd56_gnss_addon.c
+endif
+
 DEPPATH += --dep-path src
 VPATH += :src
 CFLAGS += 
${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src
diff --git a/boards/arm/cxd56xx/common/src/cxd56_gnss_addon.c 
b/boards/arm/cxd56xx/common/src/cxd56_gnss_addon.c
new file mode 100644
index 00..4820ae9ea5
--- /dev/null
+++ b/boards/arm/cxd56xx/common/src/cxd56_gnss_addon.c
@@ -0,0 +1,163 @@
+/
+ * boards/arm/cxd56xx/common/src/cxd56_gnss_addon.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "cxd56_i2c.h"
+
+/
+ * Pre-processor Definitions
+ /
+
+/* I2C interface */
+
+#define CXD5610_I2C_ADDR  0x24
+#define CXD5610_I2C_FREQ  40
+#define CXD5610_INT_PIN   PIN_SEN_IRQ_IN
+
+/
+ * Private Function Prototypes
+ /
+
+static int cxd5610_gnss_i2csend(struct cxd5610_gnss_lowerhalf_s *lower,
+uint8_t *buffer, int buflen);
+static int cxd5610_gnss_i2crecv(struct cxd5610_gnss_lowerhalf_s *lower,
+uint8_t *buffer, int buflen);
+static int cxd5610_gnss_enableint(struct cxd5610_gnss_lowerhalf_s *lower,
+  void (*handler)(void));
+static int cxd5610_gnss_disableint(struct cxd5610_gnss_lowerhalf_s *lower);
+
+/
+ * Private Data
+ /
+
+static const struct cxd5610_gnss_lowerops_s g_gnss_addon_ops =
+{
+  cxd5610_gnss_i2csend,
+  cxd5610_gnss_i2crecv,
+  cxd5610_gnss_enableint,
+  cxd5610_gnss_disableint
+};
+
+static struct cxd5610_gnss_lowerhalf_s g_gnss_addon_lowerhalf =
+{
+  _gnss_addon_ops
+};
+
+static struct i2c_master_s *g_i2c;
+
+/
+ * Private 

(nuttx) 01/04: arch: cxd56xx: Update gnss header files

2023-10-31 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit ed5785ad0684ae35196271a40340be2845f782c3
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Sat Oct 28 19:19:38 2023 +0900

arch: cxd56xx: Update gnss header files

- Add some ioctl commands to get version, sleep, wakeup and reset.
- Add new data structures for CXD5610 GNSS Add-on board.
---
 arch/arm/include/cxd56xx/gnss.h  |  38 +++-
 arch/arm/include/cxd56xx/gnss_type.h | 112 ++-
 2 files changed, 148 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/cxd56xx/gnss.h b/arch/arm/include/cxd56xx/gnss.h
index 93ed1969a9..b9bb81ddb0 100644
--- a/arch/arm/include/cxd56xx/gnss.h
+++ b/arch/arm/include/cxd56xx/gnss.h
@@ -547,10 +547,46 @@ extern "C"
 
 #define CXD56_GNSS_IOCTL_GET_1PPS_OUTPUT 53
 
+/**
+ * Get the firmware version
+ *
+ * param[in] arg
+ * string array of CXD56_GNSS_VERSION_MAXLEN
+ */
+
+#define CXD56_GNSS_IOCTL_GET_VERSION 54
+
+/**
+ * Sleep the firmware
+ *
+ * param[in] arg
+ * CXD56_GNSS_SLEEP(0) or CXD56_GNSS_DEEPSLEEP(1)
+ */
+
+#define CXD56_GNSS_IOCTL_SLEEP 55
+
+/**
+ * Wake up the firmware
+ *
+ * param arg
+ * Parameter is Unnecessary. Set Zero.
+ */
+
+#define CXD56_GNSS_IOCTL_WAKEUP 56
+
+/**
+ * Reset the firmware
+ *
+ * param arg
+ * Parameter is Unnecessary. Set Zero.
+ */
+
+#define CXD56_GNSS_IOCTL_RESET 57
+
 /* check macros for GNSS commands */
 
 #define CXD56_GNSS_IOCTL_INVAL 0
-#define CXD56_GNSS_IOCTL_MAX   54
+#define CXD56_GNSS_IOCTL_MAX   58
 
 /* Same value to GD Start mode CXD56_GNSS_STMOD_ for fw_gd_start */
 
diff --git a/arch/arm/include/cxd56xx/gnss_type.h 
b/arch/arm/include/cxd56xx/gnss_type.h
index 48b62638af..871fdaf773 100644
--- a/arch/arm/include/cxd56xx/gnss_type.h
+++ b/arch/arm/include/cxd56xx/gnss_type.h
@@ -45,7 +45,8 @@ extern "C"
 
 /* Max number of satellites */
 
-#define CXD56_GNSS_MAX_SV_NUM 32
+#define CXD56_GNSS_MAX_SV_NUM 32/* for cxd56_gnss_positiondata_s */
+#define CXD56_GNSS_MAX_SV2_NUM 150  /* for cxd56_gnss_positiondata2_s */
 
 /* GNSS satellite system */
 
@@ -59,6 +60,23 @@ extern "C"
 #define CXD56_GNSS_SAT_BEIDOU  (1U << 6) /* BeiDou */
 #define CXD56_GNSS_SAT_GALILEO (1U << 7) /* Galileo */
 
+/* GNSS satellite signal type */
+
+#define CXD56_GNSS_SIGNAL_GPS_L1CA  (0)   /* GPS L1CA */
+#define CXD56_GNSS_SIGNAL_GPS_L5(1)   /* GPS L5 */
+#define CXD56_GNSS_SIGNAL_GLN_L1OF  (2)   /* GLONASS L1OF */
+#define CXD56_GNSS_SIGNAL_QZS_L1CA  (3)   /* QZSS L1CA */
+#define CXD56_GNSS_SIGNAL_QZS_L1S   (4)   /* QZSS L1S */
+#define CXD56_GNSS_SIGNAL_QZS_L5(5)   /* QZSS L5 */
+#define CXD56_GNSS_SIGNAL_BDS_B1ID1 (6)   /* BeiDou B1I D1 */
+#define CXD56_GNSS_SIGNAL_BDS_B1ID2 (7)   /* BeiDou B1I D2 */
+#define CXD56_GNSS_SIGNAL_BDS_B1C   (8)   /* BeiDou B1C */
+#define CXD56_GNSS_SIGNAL_BDS_B2A   (9)   /* BeiDou B2a */
+#define CXD56_GNSS_SIGNAL_GAL_E1(10)  /* Galileo E1B, E1C */
+#define CXD56_GNSS_SIGNAL_GAL_E5A   (11)  /* Galileo E5a */
+#define CXD56_GNSS_SIGNAL_NAV_L5(12)  /* NavIC L5 */
+#define CXD56_GNSS_SIGNAL_SBAS_L1   (13)  /* SBAS L1 */
+
 /* GNSS positioning type */
 
 #define CXD56_GNSS_PVT_TYPE_NONE 0 /* Positioning data none */
@@ -194,6 +212,15 @@ extern "C"
 #define CXD56_GNSS_PVT_RECEIVER_ASSIST_AEPPOS (0x08)
 #define CXD56_GNSS_PVT_RECEIVER_ASSIST_AEPVEL (0x10)
 
+/* GNSS firmware version information */
+
+#define CXD56_GNSS_VERSION_MAXLEN   32
+
+/* GNSS sleep parameter */
+
+#define CXD56_GNSS_SLEEP0
+#define CXD56_GNSS_DEEPSLEEP1
+
 /* GNSS positionig data elements */
 
 /*  Day (UTC) */
@@ -990,6 +1017,89 @@ struct cxd56_gnss_status_s
   struct cxd56_pvtlog_date_s   end_date; /* [in] Date (UTC)   4B  */
 };
 
+/* GNSS satellite data v2 */
+
+struct cxd56_gnss_sv2_s
+{
+  uint8_t type;  /* Signal ID
+  * 0: GPS L1CA
+  * 1: GPS L5
+  * 2: GLN L1OF
+  * 3: QZS L1CA
+  * 4: QZS L1S
+  * 5: QZS L5
+  * 6: BDS B1I D1
+  * 7: BDS B1I D2
+  * 8: BDS B1C
+  * 9: BDS B2a
+  * 10: GAL E1B/E1C
+  * 11: GAL E5a
+  * 12: NavIC L5
+  * 13: SBAS L1
+  */
+  uint8_t svid;  /* Satellite id */
+  int16_t azimuth;   /* Azimuth [degree] */
+  uint8_t elevation; /* Elevation [degree] */
+  uint8_t siglevel;  /* CN [dB] */
+  uint8_t stat;  /* Using sv info, bit field; bit0:tracking,
+  * bit1:positioning, bit2:calculating velocity,
+  * bit3:visible satellite
+  */
+};
+
+/* GNSS Receiver data v2 */
+
+struct cxd56_gnss_receiver2_s
+{
+  struct 

Re: [PR] boards: cxd56xx: Add cxd5610 gnss driver [nuttx]

2023-10-31 Thread via GitHub


jerpelea merged PR #11101:
URL: https://github.com/apache/nuttx/pull/11101


-- 
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...@nuttx.apache.org

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



[PR] simwifi: Support that get the connected Chinese essid. [nuttx]

2023-10-31 Thread via GitHub


liqinhuixm opened a new pull request, #11104:
URL: https://github.com/apache/nuttx/pull/11104

   ## Summary
   Because the Chinese essid obtained by wpa_cli is encoded. So, we directly 
use the essid saved in wifidev.
   ## Impact
   N/A
   ## Testing
   When we use the wapi to connect an AP with the Chinese characters, then we 
can use the command `wapi show wlanx` to see that the AP essid is correctly 
displayed.
   


-- 
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...@nuttx.apache.org

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



[PR] usrsock_rpmsg_server: Keep msg order in recursive call [nuttx]

2023-10-31 Thread via GitHub


wengzhe opened a new pull request, #11103:
URL: https://github.com/apache/nuttx/pull/11103

   ## Summary
   In `drivers/rptun/rptun.c`, we have a `rptun_is_recursive` function, which 
lets rptun thread run recursively. Then the `usrsock_rpmsg_ept_cb` may be 
called inside `usrsock_rpmsg_ept_cb`, which can cause some unexpected behavior, 
so we add a queue to keep the order of incoming messages to reduce the 
complexity.
   
   Patches included:
   - usrsock_rpmsg_server: Save iov and remain per endpoint
 - Prepare for keeping msg order, also helps sendto to work correctly on 
multiple endpoints.
   - usrsock_rpmsg_server: Keep msg order in recursive call
   
   ## Impact
   Usrsock rpmsg server only.
   
   ## Testing
   Manually.
   


-- 
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...@nuttx.apache.org

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



Re: [I] how to support ptp [nuttx]

2023-10-31 Thread via GitHub


PetteriAimonen commented on issue #10887:
URL: https://github.com/apache/nuttx/issues/10887#issuecomment-1786517982

   @xiaotailang  For STM32F4x7 it works this way (from reference manual section 
"Rx DMA configuration":
   
   > If IEEE 1588 time stamping is enabled, the DMA writes the time stamp (if 
available) to
   the current descriptor’s RDES2 and RDES3. It then takes the received frame’s 
status
   and writes the status word to the current descriptor’s RDES0, with the OWN 
bit cleared
   and the Last segment bit set.
   
   > If software has
   enabled time stamping through CSR, when a valid time stamp value is not 
available for the
   frame (for example, because the receive FIFO was full before the time stamp 
could be
   written to it), the DMA writes all ones to RDES2 and RDES3. Otherwise (that 
is, if time
   stamping is not enabled), RDES2 and RDES3 remain unchanged.
   
   The RX DMA descriptor is longer if timestamping is enabled and the code must 
be changed to account for that.


-- 
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...@nuttx.apache.org

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