!boards: Simplify NuttX initialization#18408
!boards: Simplify NuttX initialization#18408linguini1 wants to merge 18 commits intoapache:masterfrom
Conversation
|
Notes for reviewers on the initial draft:
|
|
@linguini1 this is a great initiative. |
Hi @fdcavalcanti, if you're talking about making the changes, I think all ESP boards should be included in this patch already (xtensa/risc-v). They were actually quite easy since the board_late_init and board_app_init logic were pretty much identical. If you're talking about how to test, the process would be to configure the build system for one of the modified ESP32 configurations (i.e. nsh) and just boot into NuttX, check that things look okay and run Hope I understood correctly, thanks for your help! |
f30db82 to
31a4ad2
Compare
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
|
This is now ready for review |
|
@linguini1 We are ready for branch out |
acassis
left a comment
There was a problem hiding this comment.
Don't merge before the 12.13 be created. I'm opening this change request just to avoid mistakes here.
Alin (same as nuttx-apps), let's follow with your suggested plan: Not big breaking changed to 12.13. |
12.13 branch created |
|
Hi @jerpelea , let's save this one for the 13.x branch on June 1 instead. |
|
@linguini1 great job! I noticed issues so far only on ESP32, but will keep testing: On
The thing in common on those configs is that they all use SMP. Seems the fix is to increase +1 to CONFIG_MM_REGIONS on the configs that have SMP, but I fail to see the reason right now. |
|
Thank you @fdcavalcanti for testing! Do you know if any of those issues were present prior to this patch? I do not have an esp32-devkitc board but I do have the Xiao C3, so I will try to reproduce there as well and see if I can figure out what it may be. |
I did a quick test on master and it is working fine for |
|
Once the March 1 release is finished I'll rebase this onto main and fix those remaining issues. Until then I still have to figure out what's causing issues with ESP32; I thought those would be pretty cut-and-dry since the old |
|
@fdcavalcanti I have tested on the I took a look at the mainline initialization vs this patch, and the Would you be able to perform your test on |
@linguini1 I tried and here is the output.
3 defconfig failures:
I was able to test using QEMU. On SMP I got this error: Which is the issue same we had before. I'm not able to dig deeper right now, but seems you are on the right track. |
|
Thank you @fdcavalcanti ! I guess this never worked in mainline then. I'll take a closer look at those configurations (excepting mcuboot) to see if there's any signs in there. |
Summary
BREAKING CHANGE
This change simplifies the NuttX initialization logic by:
board_app_initialize did so any defconfigs relying on NSH_ARCHINIT will not
break.
This is related to #11321.
Twin PR in NuttX apps should be merged at the same time: apache/nuttx-apps#3405
Impact
Almost every single board/configuration in the NuttX source tree, since many
relied on NSH for initialization.
This is a breaking change that removes the user's ability to use BOARDIOC_INIT
as well. Users are provided with quick-fixes in the commit messages for how to
fix any breakages. BOARDIOC_FINALINIT should be used instead for applications
that truly require full control over the initialization process. For every other
application, BOARD_LATE_INITIALIZE should be enabled to have the NuttX kernel
perform initialization before launching into the app.
Testing
I will be testing on the platforms available to me (simulators and whatever
hardware I own). Testing from community members with hardware across the
architectures affected would be greatly appreciated. If you do want to help with
testing, please provide logs in the PR comments for the affected defconfigs you
tested.
Testing of applications can be seen in the twin PR: apache/nuttx-apps#3405
OS Test logs
sim:nsh: sim-nsh.txtqemu-armv8a:nsh: qemu-armv8a-nsh.txtqemu-armv7a:nsh: qemu-armv7a-nsh.txtrv-virt:nsh: rv-virt-nsh.txtraspberrypi-4b:sd: rpi4b-sd.txt (verify SD filesystem is mounted + ostest)samv71-xult:nsh,samv71-xult:netnsh: See commentesp32c3-xiao:ble: esp32c3-xiao.txt