-
Notifications
You must be signed in to change notification settings - Fork 9
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
Derive SAI blocks for 1176 from SAI1 #45
Conversation
8758be9
to
35e34ce
Compare
When I locally generate the RAL, I don't see any changes to the Rust code. There's a CI job that confirms this, too. If the SVDs were the root cause, I would have expected there to be a change in the Rust source code as of these SVD updates. I'm not sure this will fix the issue. Could you check my notes here? All links are as of the 0.5.3 tag. The 1176 (CM7) has two different SAI modules: imxrt-ral/src/imxrt1176_cm7.rs Lines 4542 to 4629 in bb0088d
The imxrt-ral/src/blocks/imxrt1176_cm4/sai.rs Line 21 in bb0088d
The
|
Here's a few "don't want to deal with this" ideas that would be OK with me. Within the HAL, and when the 1170 feature is active, remap Within the HAL, don't export SAI as a common driver. Pick your favorite MCU families and export it when that feature is active. |
I'd like to fix it, 1176 would be cool to have at some point perhaps. I'll see what I can do to correct the svd with patching methods |
From what I can tell other parts provide a single block that has registers as arrays regardless of whether the instance has the full set of channels. That works for me. I tried patching it but svdtools is I don't think as helpful here as I would like. I'll consider the other options tomorrow. |
9da81f6
to
df44f52
Compare
The svdtools patch now generates ral stuff that looks a lot closer to the other parts as the registerblock gets reused for all instances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging into this. I'll include this in a future breaking release (0.6) of imxrt-ral.
I'm pondering ways to hack something like this within the 0.5 series, but I haven't seen the path yet. If we figured this out, we could release the HAL's SAI driver within imxrt-hal 0.5 series and still fully support the 1170. Of course, we could always release the SAI driver in the HAL's 0.5 series without immediately supporting all MCUs.
It's also OK to update the HAL's dependency on the RAL to realize this change for SAI development.
All SAI instances can derive their register blocks from SAI1. While not every instance has multiple tx/rx lines and fifos the register layout can be reused for all SAI instances. The mcux sdk actually does this by casting the instance address to I2S_Type* which is a common struct with a common register layout.
0dbf7f7
to
a2383c5
Compare
All SAI instances can derive their register blocks from SAI1. While not
every instance has multiple tx/rx lines and fifos the register layout
can be reused for all SAI instances. The mcux sdk actually does this
by casting the instance address to I2S_Type* which is a common struct
with a common register layout.