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

SPI1 don't work with pins p34, p35, p37 #115

Closed
Alexander89 opened this issue Dec 28, 2021 · 3 comments
Closed

SPI1 don't work with pins p34, p35, p37 #115

Alexander89 opened this issue Dec 28, 2021 · 3 comments

Comments

@Alexander89
Copy link
Contributor

Describe the bug

I'm trying to build a SPI1 interface. It appears straightforward at first glance, But the compiler refuses my code with the error:

 spi1_builder.build(pins.p34, pins.p35, pins.p37),
                                        ^^^^^^^^ the trait `teensy4_bsp::imxrt_hal::iomuxc::spi::Pin` is not implemented for `Pad<imxrt106x::bases::B1, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B1>>`
    = help: the following implementations were found:
             <Pad<imxrt106x::bases::AD_B0, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>> as teensy4_bsp::imxrt_hal::iomuxc::spi::Pin>
             <Pad<imxrt106x::bases::AD_B0, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B1>> as teensy4_bsp::imxrt_hal::iomuxc::spi::Pin>
             <Pad<imxrt106x::bases::AD_B0, typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>> as teensy4_bsp::imxrt_hal::iomuxc::spi::Pin>
             <Pad<imxrt106x::bases::AD_B0, typenum::uint::UTerm> as teensy4_bsp::imxrt_hal::iomuxc::spi::Pin>
           and 13 others

I tried all pins 🙈 , but no one is working.

To Reproduce
It is simple to reproduce. Use the SPI example and turn it into the SPI1

Additional context
The pins docs are great at the master branch, but It would be awesome If you could publish the teensy-pins crate (and add pin 48-54 as well). I like to add an SD card to my project later. I hope I'll come up with something generic and contribute to this project.

mciantyre added a commit that referenced this issue Dec 29, 2021
See #115 for context. Seems to build without issue:

  cargo build --all-features --target=thumbv7em-none-eabihf --example=spi

Also using P36 for CS0. Note that the 'spi4' variable name is now
misleading, but this is just a demo.
@mciantyre
Copy link
Owner

Sorry, I'm having trouble reproducing this issue. I took the SPI example, and it seems OK. Given your snippet, it seems that pins 34 and 35 are swapped. Could you confirm that the pins are passed into build as expected? Or, could you share all of your code?

@Alexander89
Copy link
Contributor Author

I'm so sorry, to open this issue and waste your time.

It works in another project. as you said, but something is wrong with my project and I still didn't figure it out. Let's dig deeper.

@mciantyre
Copy link
Owner

No problem! Reach out here, or in discussions, if you have any other questions.

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

No branches or pull requests

2 participants