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

Support PIO pins >31 #9897

Open
dhalbert opened this issue Dec 18, 2024 · 1 comment · May be fixed by #9901
Open

Support PIO pins >31 #9897

dhalbert opened this issue Dec 18, 2024 · 1 comment · May be fixed by #9901
Labels
Milestone

Comments

@dhalbert
Copy link
Collaborator

rp2pio does not yet support GPIO numbers >31 and has some RP2040-specific includes. Generalize it for RP2350.

@dhalbert dhalbert added this to the 9.2.x milestone Dec 18, 2024
@dhalbert dhalbert assigned dhalbert and unassigned dhalbert Dec 18, 2024
@jepler
Copy link
Member

jepler commented Dec 18, 2024

I fear this turns out to be a bit wrinkly. I have a jumble of thoughts:

  • GPIO base is per PIO, not per SM. So, we have a new problem when allocating SMs, that we have to know whether we want the high or low bank and whether a PIO has any other SMs associated with it. (pico-sdk solves this by requiring the PIO base register be set before calling pio_sm_set_config and erroring if it clearly doesn't match)
  • There's an inherent ambiguity: On rp2040 & rp2350A, having a pin base of 20 and a count of 20 addresses pins 20..31 & 0..7 (wrap around arithmetic). on 2350b, should this address 20..39 or the same pins as on 2040?
    • on 2350b, the answer is that only the base pin is checked an so the effect depends on the pio base register setting
    • but if we want to make the bank selection implicit, we have to choose whether we want to favor compatible wrap-around (unlikely) or high bank use (likely)
  • we check the wait gpio instruction for matching an otherwise used pin number, but this also depends on the bank setting.

@jepler jepler linked a pull request Dec 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants