Skip to content

Conversation

@tari
Copy link
Contributor

@tari tari commented Jul 13, 2025

The rpi_pico pinctrl driver only supported up to 32 GPIOs, while RP2350 has up to 48. This changes the driver to support the additional ones, by allocating one more bit in pinctrl values.

The rpi_pico PWM driver also failed to handle PWM channels 8 through 11, which were added on RP2350. That driver is fixed to support up to the required 12 channels, and the pinctrl macros modified to accurately reflect which PWM channels can be connected to which pin.

soburi
soburi previously approved these changes Jul 13, 2025
Copy link
Contributor

@ajf58 ajf58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (sorry): in the commit message "available on RP2030" is a minor but confusing typo that might be a bit of a pain when searching the commit history in the future.

Other than that this looks great.

@tari
Copy link
Contributor Author

tari commented Jul 30, 2025

in the commit message "available on RP2030" is a minor but confusing typo that might be a bit of a pain when searching the commit history in the future.

I think both instances of that accurately reflect what I meant to write; what wording do you have in mind?

RP2350 has 48 GPIOs, where only the first 30 are broken out to pins on
RP2350A (same as RP2040) and the remaining 18 are only usable on RP2350B.
This change makes the soc pinctrl driver support GPIOs above 31, where
previously it was impossible to configure GPIOs 32 through 47.

Tested on RP2350B, confirming that GPIO44 can be correctly configured for
PWM.

Signed-off-by: Peter Marheine <[email protected]>
@tari
Copy link
Contributor Author

tari commented Jul 30, 2025

in the commit message "available on RP2030" is a minor but confusing typo that might be a bit of a pain when searching the commit history in the future.

I think both instances of that accurately reflect what I meant to write; what wording do you have in mind?

Never mind, I realized it should be RP2040.

ThreeEights
ThreeEights previously approved these changes Jul 30, 2025
@ThreeEights ThreeEights requested review from ajf58 and soburi July 30, 2025 16:56
soburi
soburi previously approved these changes Jul 31, 2025
tari added 2 commits August 5, 2025 14:02
RP2350 adds four more PWM slices from the eight available on RP2040,
which are only broken out to package pins on RP2350B. This change fixes
the driver to support the correct number of slices on RP2350.

Tested by confirming that PWM can correctly be configured on GPIO 44 of
RP2350B.

Signed-off-by: Peter Marheine <[email protected]>
The macros for PWM output on these GPIOs had names that referred to PWM
channels that do no exist on this chip- it only has 12 channels, where
channels 8..11 are exposed on both GPIOs 32..39 and 40..47.

Signed-off-by: Peter Marheine <[email protected]>
@tari tari dismissed stale reviews from soburi and ThreeEights via 823d0a9 August 5, 2025 04:08
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 5, 2025

@soburi
Copy link
Member

soburi commented Aug 21, 2025

@ajf58
It seems to have been fixed so please check again.

@kartben kartben merged commit a0374a1 into zephyrproject-rtos:main Aug 22, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Pinctrl area: PWM Pulse Width Modulation platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants