feat(platforms): upgrade NuttX to 12.12.0#26215
feat(platforms): upgrade NuttX to 12.12.0#26215PetervdPerk-NXP wants to merge 7 commits intomainfrom
Conversation
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 5336 byte (0.25 %)]px4_fmu-v6x [Total VM Diff: 7400 byte (0.36 %)]Updated: 2026-04-01T12:19:51 |
c57843c to
dc431f3
Compare
|
Hi @PetervdPerk-NXP, @AlexKlimaj, This is a very large change (around 5,000 commits in NuttX and many changes in the common code), and to be honest I’m not particularly excited about the approach:
Especially when this then requires patching and reviewing fixes like the following just to get things running: This kind of patching being needed already shows that interfaces don't behave the same anymore and we need to understand this and not start patching until it somehow works. This one was detected, but I am very sure there are a lot more of those "quirks" that will occur less often and only in specific situations. Don’t get me wrong, I like the idea of us staying up to date with NuttX. However, with a migration that appears to be largely AI-driven, it effectively shifts a significant amount of risk and workload onto the reviewers and flight testers. They now need to ensure that no low-level or timing-related issues are introduced that might only show up sporadically in real operation. With that in mind, I’d like to ask a few questions:
|
dc431f3 to
11b08f9
Compare
|
Hi @alexcekay,
Beyond Kconfig symbol churn, the PR is quite modest. My reason to upgrade is primarily to enable i.MX93/i.MX95 hardware, which depends on a more mature RPMsg that we can’t realistically backport from our 2-3 year old NuttX. But they're are various other improvements NuttX brings which makes it worthwhile to upgrade. I sense some hesitation about upgrading. If we intend to stay on the current kernel long‑term, the migration cost will only grow. I’m happy to help push this over the line, as I did myself with the previous kernel bump 2 years ago aswell, but I’d appreciate alignment and some shared ownership. If you’d prefer I step back and focus elsewhere, let me know. |
11b08f9 to
ff41669
Compare
|
Hi @PetervdPerk-NXP, Thanks for explaining your rationale and pushing this topic.
No, as stated: Don’t get me wrong, I like the idea of us staying up to date with NuttX and appreciate
I am hesitant about the risk associated with any larger OS change (and the hours needed to debug the issues afterwards) and thus want to de-risk this and emphasize:
When this has a sort of mature state where strange quirks are not needed anymore or are at least clearly understood I would be happy to assist in reviewing it and do testing with our HW. |
845fc70 to
f6d73d0
Compare
|
ARKV6X is booting and sd card works. Doesn't look like free or ps commands work. |
|
Confirmed ethernet is working on the ARKV6X. |
Good to hear SD card works, I've already removed the
This is a bit weird, maybe procfs doesn't properly mount, does
Awesome thanks for testing. |
|
Im also interested in upgrading Nuttx. Happy to assist in bench testing and flight testing to get this over the line confidently. What I will test on my bench so long. I hope to report back in the next week. |
91f6a29 to
99280e0
Compare
|
@PetervdPerk-NXP , I've been running PX4 on some platforms on top of 12.11 for quite some time. I'll try to post some findings here in case they are helpful. Feel free to cherry pick any of the commits below, if you find them usable! All of the points below are just my opinions, I do recognize that there are different ways to do things! What you are doing is great and I am eagerly waiting for this work to land in PX4. It makes my work on some new SoC:s much easier, and also opens a path to upstream more stuff that depends on the newer NuttX.
|
The high resolution timer support is something that would make a lot of sense to use also in PX4; that is, make a generic wrapper library out of hrt_ functions for the nuttx hrt timer. Implementing and maintaining an arch specific px4 hrt timer is an unnecessary burden (not too big, but still), when the functionality of hrt callback queueing is already there in nuttx. But certainly not in scope of this PR of course... |
3c2545e to
7d35736
Compare
|
Hi Jukka, thanks for the suggestions they make this PR way more manageable.
Indeed that reduces the delta PR of this significantly, I've cherry-picked this commit and cleaned up the changes I did before.
I like your changes better especially handling the descriptors, I've cherry-picked your commit and modified it to work on NuttX 12.12 Edit: undrafting so CI will run this PR. |
|
@PetervdPerk-NXP , @mrpollo We have made the necessary changes to support ESP32 on Nuttx 12.12.0. Would we want to make it a separate PR or part of this one? Currently, CI doesnt run the ESP32 build. |
Hi @henrykotze, If you have write access to the PX4 repo I'm okay with you adding a commit to this PR |
7d35736 to
b3fdae9
Compare
e9303eb to
bface50
Compare
dakejahl
left a comment
There was a problem hiding this comment.
- Check
cdcacm_autostartworks - Check cpu load works
Otherwise looks pretty straight forward! Thanks for the effort @PetervdPerk-NXP
| set(UAVCAN_IMPLEMENT_PLACEMENT_NEW 0) | ||
| else() | ||
| set(UAVCAN_IMPLEMENT_PLACEMENT_NEW 1) | ||
| endif() |
There was a problem hiding this comment.
When TFLM gets enabled, it changes how libcxx works causing a conflict/incompatiblity with other cxx libraries. IMO Ideally TFLM doesn't do this trick/hack anymore.
| #pragma GCC poison getenv setenv putenv | ||
| #endif |
There was a problem hiding this comment.
comment blocks above are out of order, fix while we're here?
| fds->cb(fds); | ||
| } | ||
|
|
||
| #else |
There was a problem hiding this comment.
It implements the change due to this commit
apache/nuttx@e9ccab2
See poll_notify(FAR struct pollfd **afds, int nfds, pollevent_t eventset) changes.
NuttX does some weird stuff setting the void poll_default_cb(FAR struct pollfd *fds) trampoline the eventually calls nxsem_post
| fds->cb(fds); | ||
| } | ||
|
|
||
| #else |
1a164a5 to
89a6b4c
Compare
Update git sha's for NuttX
89a6b4c to
453ed2c
Compare
bootloader: update main prototype for NuttX 12.12.0 platforms/nuttx: Add wrapper for queue.h For some reason the queue.h header was moved, add this wrapper so posix and nuttx builds can both still use #include <queue.h> Fix print_load to be compatible with upstream NuttX Also Change tg_filelist -> tg_fdlist as per new NuttX Co-authored-by: Ville Juven <ville.juven@unikie.com> Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
sitl: fix NuttX 11.12.0 upgrade regressions drivers: uavcan: fix TFLM c library conflict With NuttX 12.12.0 the TFLM c library causes a conflict
boards: Disable MMC_IOC_CMD ioctl NuttX default is Y, but it's not used boards: Fix meminfo/free boards: fix libc float setting boards: Reduce flash usage Using strerr short mode Don't cache DNS entries (also saves some ram)
NuttX 12.12 changed symbols for certain calls or inlined them.
Fix a protected kernel link failure caused by static initialization of a shared uORB::Publication in AM32Settings. Which is problematic for NuttX 12.12.0. The NuttX 12.12 PX4 protected kernel does not provide __dso_handle.
453ed2c to
0678add
Compare
kakutef7 overflows with nuttx 12.12.0 also it doesn't have optical flow drivers anyhow. Thus disable ekf2 optical flow
Continuation of #26198 but now the NuttX repo's are on the PX4 repositories.
Some reasons why to upgrade NuttX
PX4 Test Plan
sd_benchand measure write speedtopwhen the system is armeduorb topwhen the system is armedmavlink status