Skip to content
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

Reduce common drivers to support 1180 MCUs #178

Merged
merged 6 commits into from
Dec 3, 2024

Conversation

mciantyre
Copy link
Member

The 1180 has different GPIO and PIT peripherals. There's no SVNS equivalent (or there is and I haven't found it). Lower those modules and their dependent modules into chip, and re-export them for all supporting MCUs.

Once we reduce what's common, we can start to support the 1180. I added a CI job to show a successful build. See imxrt-rs/imxrt-ral#52 for the accompanying imxrt-ral changes.

@teburd
Copy link
Member

teburd commented Nov 22, 2024

Makes sense, I guess questions start coming up with how does the mcux sdk deal with these peripheral block revisions/differences, I guess some ifdef's in C...

@korken89
Copy link

Thank you for starting too look into this @mciantyre !
We've been a little swamped, but will have a look ASAP.

mciantyre and others added 6 commits November 29, 2024 06:44
The moved drivers were common across all supported MCUs. But these
peripherals aren't available on the 1180. Lower these drivers into the
chips category so they can be re-exported as needed.

This change is backwards compatible. End users won't (shouldn't) notice
our changed module structure.

The drivers left behind in common should truly be common with the 1180.
I'll separately introduce imxrt-ral consolidations so we can get a
baseline 1180 build.
Remove 'family' from the layers. Each chip module now brings in the
specific drivers it supports. We move all of these kinds of drivers into
a drivers directory. The configuration module lives inline, within the
chip module.
The family category doesn't make much sense when the 1180 is so
different from the 1170. Rewrite all conditional compiles in terms of
chips.
The hal_led example can turn on the LED. We can't even blink that LED
yet! At least our runtime, build system, and supporting libraries are
working.

Here's how to build and program the example. You'll need a probe-rs
build that supports the 1180.

    cargo build --features=board/imxrt1180evk-cm33 --target=thumbv8m.main-none-eabihf --example=hal_led --release
    probe-rs run --chip=mimxrt1189 target/thumbv8m.main-none-eabihf/release/examples/hal_led
@mciantyre
Copy link
Member Author

No rush to review. We're still playing around with ideas.

I integrated your team's rt1180 branch. We can turn on the 1180EVK's LED using the in-tree example.

cargo build --features=board/imxrt1180evk-cm33 --target=thumbv8m.main-none-eabihf --example=hal_led --release
probe-rs run --chip=mimxrt1189 target/thumbv8m.main-none-eabihf/release/examples/hal_led

@mciantyre mciantyre marked this pull request as ready for review December 3, 2024 11:33
@mciantyre mciantyre merged commit ca25e95 into imxrt-rs:main Dec 3, 2024
36 checks passed
@mciantyre mciantyre deleted the rt1180-common branch December 3, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants