-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ports/mimxrt: Restructure nxp_sdk to match official mcux-sdk. #16235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Code size report:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #16235 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 169 169
Lines 21864 21864
=======================================
Hits 21545 21545
Misses 319 319 ☔ View full report in Codecov by Sentry. |
679b0a7
to
952383f
Compare
870da96
to
eafe053
Compare
06b15f0
to
8d2ea2d
Compare
Thanks for your ongoing work on this. It will take a few days before I can test it. The wrapper for fsl_lpuart.c looks cool. Did you test that to fire at the right moment? |
I was working in that last year now and can't quite remember what I tested on it. I did test a few things to do with the interrupts and wrappers because I was making a second similar change elsewhere.
Neat! I'd love to consolidate spiflash handing across ports more, at least in terms of definition differences between the chip vendors. That's a much bigger job though... |
Looking at it in detail it gets less clean. The Winbond devices have minor difference, so it cannot be just a Winbond type of definition. So I'm working on making a flash_config per board and reducing the #defines for chip properties set in this definitions. Then everything is at a single place. The only #define that would stay is the one for the flash clock frequency, which may have to be changed at runtime. |
Supported triggers are: IRQ_RXIDLE and IRQ_TXIDLE. When IRQ_RXIDLE is set, the handler will be called 3 character times after the data in burst stopped. When IRQ_TXIDLE is set, the handler will be called immediately after the data has been sent. This commit requires a change to fsl_lpuart.c, because the existing code does not support under-run appropriately. The irq.flags() value is cleared only at an expected event. Do not change it otherwise. Signed-off-by: robert-hh <robert@hammelrath.com>
@andrewleech Did you make any progress in this task? |
Hi @robert-hh other than the new merge conflict to resolve I do think this PR is in pretty good shape. |
That is a trivial conflict about just one #include statement in mpconfigport.h being present or not.
I tried to rebase onto the common master, with a rebase glitch in machine_rtc.c.
Not sure how much of that is still valid. The last bullet is a lot of work, but not for you. |
I made a few tests with that PR, building all boards and running functional tests with
Tested festures:
Result:
|
Thanks for the testing @robert-hh that sounds great! I've just rebased to current master, hopefully it's essentially the same as what you tested (just resolving the conflict by removing the include, no other manual changes). edit: Ok I see the rebase/merge fail in |
The official mcux-sdk follows a slightly different structure to the current nxp_sdk submodule, with many drivers moved to a common location. To ease updating the newer versions of the SDK and/or add new families the nxp_sdk submodule has been updated to follow the structure of mcux-sdk, just trimmed down to families used here to considerably reduce the size. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
These were regenerated by the NXP Config tool for v2.11. The board_init update was needed to ensure CLOCK_SetMode() is run at the appropriate time during startup. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Summary
The official mcux-sdk follows a slightly different structure to the current nxp_sdk submodule with many drivers moved to a common location.
To ease updating to newer versions of the SDK and/or adding new families the nxp_sdk submodule has been updated to follow the structure of mcux-sdk, just trimmed down to families used here to considerably reduce the size.
This PR is an update on #11516
I've retargetted it to an updated nxp_driver submodule pointing directly at my fork; tinyusb are no longer using this repo so I believe it makes sense to move it here. I'd be quite happy for it to be moved from my github to micropython, but that is a separate discussion really.
The initial push of this in 4df2f8d is still based on mcux-sdk 2.11 which is equivalent to the existing version of nxp_driver, however it's been updated to match the official release from
https://github.com/nxp-mcuxpresso/mcux-sdk/archive/refs/tags/MCUX_2.11.0.tar.gz
using the automated update script in hathach/nxp_driver#10Testing
I've built all existing boards to ensure they at least compile using:
I'll be continuing to work with this branch on an mimxrt-1176 so will update with test results here.
Trade-offs and Alternatives
Originally #11516 was switching directly to the official sdk repo. Speaking to @dpgeorge there was a preference to keep using a trimmed down repo considering the dramatic difference in size (official ~1.6GB, trimmed < 100MB).
The changes made by @imi415 to work with the official sdk layout of the repo are solid though and a better path forward than my previous efforts to use symlinks in the trimmed nxp_sdk repo to emulate the original layout, hence using their changes here
The authorship of the commit has been kept as you @imi415 as the vast majority of the changes are still as per your PR. I hope you don't mind me making the minor tweaks for compatibility and squashing it together.