Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rp2/rp2_pio: Fix PIO support for pin wrapping and RP2350B upper-bank pins.#18343

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
AJMansfield wants to merge2 commits intomicropython:master
base:master
Choose a base branch
Loading
fromAJMansfield:rp2-pio64

Conversation

@AJMansfield
Copy link
Contributor

@AJMansfieldAJMansfield commentedOct 29, 2025
edited
Loading

Summary

The existing public pico-sdk API methods forpio_sm_set_pins_with_mask/pio_sm_set_pindirs_with_mask, including the 64-bit variants, do not allow PIO "pin wrapping", i.e. using[30, 31, 0, 1] or[46, 47, 16, 17] as contiguous pin ranges for a PIO program, despite the documented support for this in the underlying hardware.

This patch exposes the internal method that the existing 32- and 64-bit versions of these functions call to in order to skip the way the wrappers "helpfully" perform truncated bit-shifts on their arguments, and uses it to also resolve the outstanding issue with using upper-bank RP2350B pins for PIO.

Resolves:#16199
Closes:#16985

Testing

This still needs to be tested with real RP2350B hardware, not just the more common RP2350A --- as this is a key area where these two chips are different. At the moment I do not have suitable hardware to test on.

Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
@github-actions
Copy link

Code size report:

Reference:  lib/stm32lib: Update N6, U5 & WB. [673524f]Comparison: rp2/rp2_pio: Initialize wrapped and upper-bank pin ranges. [merge of fe4a966]  mpy-cross:    +0 +0.000%    bare-arm:    +0 +0.000% minimal x86:    +0 +0.000%    unix x64:    +0 +0.000% standard      stm32:    +0 +0.000% PYBV10     mimxrt:    +0 +0.000% TEENSY40        rp2:   +16 +0.002% RPI_PICO_W       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS  qemu rv32:    +0 +0.000% VIRT_RV32

@AJMansfield
Copy link
ContributorAuthor

@Gadgetoid@sfe-SparkFro@maholli Are any of you able to test if this resolves the issue?

@sfe-SparkFro
Copy link
Contributor

Thanks!

Didrp2.PIO.gpio_base get removed at some point?My previous test code leveraged that. Will see about making a new test tomorrow, if no one else has by then.

@AJMansfield
Copy link
ContributorAuthor

Didrp2.PIO.gpio_base get removed at some point?My previous test code leveraged that. Will see about making a new test tomorrow, if no one else has by then.

It should be just as it was, only with upper-range GPIO pins now fully functional.

@sfe-SparkFro
Copy link
Contributor

Doh, my mistake! Was building for the Pico 2, which is not the RP2350B, sogpio_base gets#ifdef'd out 🤦

Can confirm that this works with the RP2350B!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

PIO does not work on RP2350B with GPIO pin >=32

3 participants

@AJMansfield@sfe-SparkFro@dpgeorge

[8]ページ先頭

©2009-2025 Movatter.jp