You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "XuNeo (via GitHub)" <gi...@apache.org> on 2024/07/08 03:52:29 UTC
[PR] drivers: add API for drivers early initialization [nuttx]
XuNeo opened a new pull request, #12641:
URL: https://github.com/apache/nuttx/pull/12641
## Summary
Add `drivers_early_initialize` for drivers not reply on system resource. `note_sysview_initialize` is one of them to allow note to work as early as possible.
## Impact
No.
## Testing
stm32f429i-disco with systemview.
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "XuNeo (via GitHub)" <gi...@apache.org>.
XuNeo commented on code in PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#discussion_r1668095943
##########
sched/init/nx_start.c:
##########
@@ -520,6 +520,8 @@ void nx_start(void)
/* Initialize RTOS Data ***************************************************/
+ drivers_early_initialize();
Review Comment:
I'm not sure if I understand correctly. Currently `drivers_early_initialize` calls `notesnap_register` etc. which do not rely on idle tcb intialization. What's you concern here?
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "patacongo (via GitHub)" <gi...@apache.org>.
patacongo commented on PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#issuecomment-2217506489
> @patacongo explained about some of those difference 10 years ago:
> https://acassis.wordpress.com/2014/09/20/how-to-do-late-board-initialization-on-nuttx/
You might be talking about my initialization documentation here: https://cwiki.apache.org/confluence/display/NUTTX/NuttX+Initialization+Sequence
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #12641:
URL: https://github.com/apache/nuttx/pull/12641
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#issuecomment-2217562136
> > @patacongo explained about some of those difference 10 years ago:
> > https://acassis.wordpress.com/2014/09/20/how-to-do-late-board-initialization-on-nuttx/
>
> You might be talking about my initialization documentation here: https://cwiki.apache.org/confluence/display/NUTTX/NuttX+Initialization+Sequence
Yes, we need first move it to our official documentation site, that is linked in initial page: https://nuttx.apache.org/
BTW, I will open a public discussion at mailing list about it: how to simplify NuttX initialization?
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#discussion_r1668047158
##########
sched/init/nx_start.c:
##########
@@ -520,6 +520,8 @@ void nx_start(void)
/* Initialize RTOS Data ***************************************************/
+ drivers_early_initialize();
Review Comment:
I'm curious how you ensure that all early initialize can be executed before idle tcb initialized.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#discussion_r1669731839
##########
sched/init/nx_start.c:
##########
@@ -534,6 +530,12 @@ void nx_start(void)
g_nx_initstate = OSINIT_TASKLISTS;
+ /* Initialize RTOS Data ***************************************************/
+
+ drivers_early_initialize();
Review Comment:
I still feel a little strange about **drivers_early_initialize()**. Driver early initialization is executed before core resource initialization. Does that mean related early initialization such as uart(*****_earlyserialinit()**) could be placed in this implementation?
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#issuecomment-2214041060
Hmm, maybe we can create a DOC from my other blog post:
https://acassis.wordpress.com/2015/07/01/nuttx-board-initialization-where-can-i-put-my-code-to-be-execute/
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#discussion_r1670734476
##########
sched/init/nx_start.c:
##########
@@ -534,6 +530,12 @@ void nx_start(void)
g_nx_initstate = OSINIT_TASKLISTS;
+ /* Initialize RTOS Data ***************************************************/
+
+ drivers_early_initialize();
Review Comment:
I don't have better solution with current implementation, let's keep moving
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#issuecomment-2214035955
@XuNeo please include Documentation/ about it. Please create some entry here: https://nuttx.apache.org/docs/latest/components/drivers/index.html explaining about early driver initialization.
I think NuttX is very confuse about it driver initialization: you can do it on NSH Arch init; Board Initialization; Early Initialization; Late Initialization; Board CTL and now you added another option! Hehehe
@patacongo explained about some of those difference 10 years ago:
https://acassis.wordpress.com/2014/09/20/how-to-do-late-board-initialization-on-nuttx/
But I think there are more complex now. @xiaoxiang781216 did you get the guy that was suppose to work on NuttX Documentation? Maybe he/she could help us on 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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#discussion_r1668160743
##########
sched/init/nx_start.c:
##########
@@ -520,6 +520,8 @@ void nx_start(void)
/* Initialize RTOS Data ***************************************************/
+ drivers_early_initialize();
Review Comment:
Are you sure you have run the current trace function? There is a potential issue here
```
nx_start
|
->sched_trace_begin
|
->trace_begin
|
->sched_note_begin
|
->sched_note_event
|
->sched_note_event_ip
|
->this_task()
```
this_task will be NULL and unable to record the tcb pid, cpu, and priority correctly. how abort move `sched_trace_begin() ` after idle initialization?
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "XuNeo (via GitHub)" <gi...@apache.org>.
XuNeo commented on code in PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#discussion_r1668548515
##########
sched/init/nx_start.c:
##########
@@ -520,6 +520,8 @@ void nx_start(void)
/* Initialize RTOS Data ***************************************************/
+ drivers_early_initialize();
Review Comment:
That makes sense. I have updated the code. Please help to review again.
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] drivers: add API for drivers early initialization [nuttx]
Posted by "XuNeo (via GitHub)" <gi...@apache.org>.
XuNeo commented on code in PR #12641:
URL: https://github.com/apache/nuttx/pull/12641#discussion_r1670641105
##########
sched/init/nx_start.c:
##########
@@ -534,6 +530,12 @@ void nx_start(void)
g_nx_initstate = OSINIT_TASKLISTS;
+ /* Initialize RTOS Data ***************************************************/
+
+ drivers_early_initialize();
Review Comment:
Compared to existing uart(***_earlyserialinit()), they are similar but uart needs to init earlier.
As you have commented out, the sched note facility does need idle tcb to be ready at least.
The bringup process is too compilicated for me to imagine the perfect solution for my coming issue that segger systemview cannot work earlier than memory heap initialization, making it unable to detect correct heap information. Thus this patch comes.
Feel free to make any adjustment to my code as neccesary.
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org