You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/01/27 12:57:50 UTC
[GitHub] [mynewt-nimble] v01d opened a new pull request #906: NuttX fixes
v01d opened a new pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906
This introduces a fix for NuttX callout mechanism. SIGEV_THREAD is not entirely the same as in Linux and requires an own thread to work correctly (see commit message). This also adds random address generation to NuttX example so that it can work out of the box with chips which do not normally have a public address set.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] v01d commented on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
v01d commented on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-769231445
@andrzej-kaczmarek it seems CI is not picking up the job. Is it down?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-773227350
<!-- style-bot -->
## Style check summary
#### No suggestions at this time!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] sjanc merged pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
sjanc merged pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] sjanc merged pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
sjanc merged pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-773227350
<!-- style-bot -->
## Style check summary
#### No suggestions at this time!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] sjanc commented on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
sjanc commented on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-769780433
this is due to travis moving workers from travis-ci.org to travis-ci.com
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-773227350
<!-- style-bot -->
## Style check summary
#### No suggestions at this time!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-773360238
<!-- style-bot -->
## Style check summary
#### No suggestions at this time!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] v01d commented on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
v01d commented on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-773359617
sorry, I missed a small change, I just force pushed. The change I added is this:
```
diff --git a/porting/npl/nuttx/src/os_callout.c b/porting/npl/nuttx/src/os_callout.c
index fe12a8e3..e4580da9 100644
--- a/porting/npl/nuttx/src/os_callout.c
+++ b/porting/npl/nuttx/src/os_callout.c
@@ -28,6 +28,10 @@
#include "nimble/nimble_npl.h"
+#ifndef CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE
+#define CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE 1024
+#endif
+
struct ble_npl_callout *pending_callout = NULL;
bool thread_started = false;
@@ -81,7 +85,10 @@ ble_npl_callout_init(struct ble_npl_callout *c,
struct sigevent event;
if (!thread_started) {
- pthread_create(&callout_thread, NULL, callout_handler, NULL);
+ pthread_attr_t attr;
+ pthread_attr_init(&attr);
+ pthread_attr_setstacksize(&attr, CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE);
+ pthread_create(&callout_thread, &attr, callout_handler, NULL);
thread_started = true;
}
diff --git a/porting/npl/nuttx/src/os_task.c b/porting/npl/nuttx/src/os_task.c
index 2e020236..ab535a36 100644
--- a/porting/npl/nuttx/src/os_task.c
+++ b/porting/npl/nuttx/src/os_task.c
@@ -60,8 +60,10 @@ ble_npl_task_init(struct ble_npl_task *t, const char *name, ble_npl_task_func_t
if (err) return err;
err = pthread_attr_getschedparam (&t->attr, &t->param);
if (err) return err;
+#if CONFIG_RR_INTERVAL > 0
err = pthread_attr_setschedpolicy(&t->attr, SCHED_RR);
if (err) return err;
+#endif
t->param.sched_priority = prio;
err = pthread_attr_setschedparam (&t->attr, &t->param);
if (err) return err;
@@ -69,6 +71,11 @@ ble_npl_task_init(struct ble_npl_task *t, const char *name, ble_npl_task_func_t
t->name = name;
err = pthread_create(&t->handle, &t->attr, func, arg);
+ if (err == ENOMEM)
+ {
+ err = OS_ENOMEM;
+ }
+
return err;
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-773227350
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mynewt-nimble] v01d commented on pull request #906: NuttX fixes
Posted by GitBox <gi...@apache.org>.
v01d commented on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-773359617
sorry, I missed a small change, I just force pushed. The change I added is this:
```
diff --git a/porting/npl/nuttx/src/os_callout.c b/porting/npl/nuttx/src/os_callout.c
index fe12a8e3..e4580da9 100644
--- a/porting/npl/nuttx/src/os_callout.c
+++ b/porting/npl/nuttx/src/os_callout.c
@@ -28,6 +28,10 @@
#include "nimble/nimble_npl.h"
+#ifndef CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE
+#define CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE 1024
+#endif
+
struct ble_npl_callout *pending_callout = NULL;
bool thread_started = false;
@@ -81,7 +85,10 @@ ble_npl_callout_init(struct ble_npl_callout *c,
struct sigevent event;
if (!thread_started) {
- pthread_create(&callout_thread, NULL, callout_handler, NULL);
+ pthread_attr_t attr;
+ pthread_attr_init(&attr);
+ pthread_attr_setstacksize(&attr, CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE);
+ pthread_create(&callout_thread, &attr, callout_handler, NULL);
thread_started = true;
}
diff --git a/porting/npl/nuttx/src/os_task.c b/porting/npl/nuttx/src/os_task.c
index 2e020236..ab535a36 100644
--- a/porting/npl/nuttx/src/os_task.c
+++ b/porting/npl/nuttx/src/os_task.c
@@ -60,8 +60,10 @@ ble_npl_task_init(struct ble_npl_task *t, const char *name, ble_npl_task_func_t
if (err) return err;
err = pthread_attr_getschedparam (&t->attr, &t->param);
if (err) return err;
+#if CONFIG_RR_INTERVAL > 0
err = pthread_attr_setschedpolicy(&t->attr, SCHED_RR);
if (err) return err;
+#endif
t->param.sched_priority = prio;
err = pthread_attr_setschedparam (&t->attr, &t->param);
if (err) return err;
@@ -69,6 +71,11 @@ ble_npl_task_init(struct ble_npl_task *t, const char *name, ble_npl_task_func_t
t->name = name;
err = pthread_create(&t->handle, &t->attr, func, arg);
+ if (err == ENOMEM)
+ {
+ err = OS_ENOMEM;
+ }
+
return err;
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org