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

Add support for i.MX RT1050 #43

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

hatimbt
Copy link

@hatimbt hatimbt commented Jan 31, 2024

This adds basic support for the i.MX RT1050.

Have not tested all modules on hardware, instead have checked it against the reference manual.

@mciantyre
Copy link
Member

Looks like a good start. As of a6b01f8, a comparison between the 1050 and 1060 using

diff -ur src/imxrt1050 src/imxrt1060

reveals that they're very similar. The important differences:

  • The 1060 has GPIO_SPI_* pad groups that aren't present on the 1050.
  • The 1060 has SAI3 and FlexIO3, neither which are present on the 1050.

Since there's so few differences, it seems we could consolidate the modules and share some code. I pushed some commits to show how that could happen.

This fixes the CI failures. Both the 1050 and 1060 were re-defining type aliases for the same pins, then implementing the same traits on those same pins. Now, there's only one set of type aliases and one implementation of traits. When enabled, the 1060 modules include additional implementations for SAI3 and FlexIO3.

Could you let me know if this setup works in your build?

hatimbt and others added 6 commits November 29, 2024 10:04
- FlexCAN, FlexIO, LPI2C, SAI, USDHC
These three modules are nearly the same between the 1050 and 1060.
There's only some superficial naming differences. Since the 1060 is
established, let's prefer those names (even if the 1050 names are better
in some cases).

I produced this diff by copying the three modules from the 1060
directory. This is an intermediate diff to show that these peripherals
are effectively the same.
Before this commit, a diff of the 1050 and 1060 directories, like

    diff -ur src/imxrt1050 src/imxrt1060

showed that these modules were basically identical. The only
differences:

1. The 1060 has additional GPIO_SPI_* pads that aren't on the 1050.
2. The 1060 has FlexIO3.
3. The 1060 has SAI3.

We can handle these similarities through the module system, instead of
duplicating code. This commit consolidates the common pad definitions
and implementations into their own module. We build with that module
whenever the user enables a 1050 or 1060 feature. By consolidating most
pin implementations here, they'll be available on both MCUs without
duplication.

The 1050 directory re-exports all common pad modules and defines the
top-level `Pads` type. The 1060 does the same, and it also defines those
GPIO_SPI_* modules. This handles difference 1.

The 1060 defines its own flexio and sai modules where it provides its
additional implementations. This handles differences 2 and 3.
Demonstrated with a failing unit test.
@hatimbt
Copy link
Author

hatimbt commented Nov 29, 2024

@mciantyre Works on my builds

@hatimbt
Copy link
Author

hatimbt commented Nov 29, 2024

I have pushed a commit with support for SEMC. Works on my build and is used to drive an external RAM.

@mciantyre
Copy link
Member

I'll need additional time to review the SEMC contributions. If you'd like to move that SEMC commit into a separate PR, we'll be able to merge the 1050 contributions.

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.

2 participants