Skip to content

lib/pico-sdk: sync rp2040/rp2350 headers to pico-sdk v2.2.0 - #188

Closed
justinh-rahb wants to merge 5 commits into
Arksine:masterfrom
justinh-rahb:copilot/update-pico-sdk-and-bootrom
Closed

justinh-rahb wants to merge 5 commits into
Arksine:masterfrom
justinh-rahb:copilot/update-pico-sdk-and-bootrom

Conversation

@justinh-rahb

Copy link
Copy Markdown
Contributor

Summary

Follow-up to Arksine/katapult#174, where Arksine noted that Klipper resynced its entire imported pico-sdk to v2.2.0 (rather than just the one BOOTROM_WELL_KNOWN_PTR_SIZE fix) and suggested Katapult do the same. This ports that full resync: Klipper3d/klipper#7141.

Why the full resync, not just the one-line fix

Per Klipper's own PR description, only BOOTROM_WELL_KNOWN_PTR_SIZE was strictly required — the rest of #7141 is mostly cosmetic (register descriptions, reset-value comments, \ingroup tags). Bringing it all in anyway keeps the vendored pico-sdk copy in sync with Klipper's, so future upstream patches don't need manual reconciliation against a drifted copy.

Changes

  • lib/pico-sdk/pico/bootrom_constants.h: content moved to the new upstream location lib/pico-sdk/boot/bootrom_constants.h; the old path is kept as a backwards-compatible shim (#include "boot/bootrom_constants.h"). This folds in the BOOTROM_WELL_KNOWN_PTR_SIZE fix that's currently a standalone change in rp2040: add RP2350 A4 stepping support #174.
  • src/rp2040/rp2350_bootrom.c: updated include path to match the new bootrom_constants.h location.
  • rp2350 register/struct headers (clocks, ticks, usb, busctrl, powman, rosc, rvcsr, syscfg, dreq, glitch_detector, intctrl, pio) and cmsis_include headers: corrected reset values and descriptions to match v2.2.0.
  • rp2040 boot_stage2/*, platform_defs.h, intctrl.h, structs/busctrl.h: matching updates from the same upstream resync.
  • lib/README, lib/pico-sdk/pico-sdk.patch: document the updated checkout procedure/revision.

Notes

Once this merges, #174 can drop its standalone bootrom_constants.h change (already discussed with Arksine there) and be rebased on top of this.

justinh-rahb and others added 4 commits August 13, 2026 11:42
* rp2040: add RP2350 A4 stepping and RP2350b support

Port changes from Klipper PRs #7141 and #7146:

- Fix BOOTROM_WELL_KNOWN_PTR_SIZE to constant 2, removing the
  runtime A2 silicon revision check. Required for RP2350 A4 stepping
  (current production) to correctly locate bootrom functions.

- Add void *sio field to gpio_out/gpio_in structs and update all
  GPIO operations to use it, enabling support for the RP2350b's
  48 GPIO pins (GPIOs 32-47 use the SIO hi-bank via a +4 byte
  pointer offset).

- Expand CAN GPIO range to 0-47 for RP2350, keeping 0-29 for RP2040.

* docs: update README to include rp2350 MCU support and flashing instructions

Signed-off-by: Justin Hayes <justinh@rahb.ca>
Signed-off-by: Justin Hayes <justinh@rahb.ca>
This fix will be reintroduced as part of the full pico-sdk v2.2.0
resync in a follow-up PR, per discussion with Arksine, so it should
not live here as a standalone change.

Signed-off-by: Justin Hayes <justinh@rahb.ca>
Ports Klipper's pico-sdk resync (Klipper3d/klipper#7141), which brings
the imported pico-sdk headers up to v2.2.0 to properly support RP2350
A4 stepping and newer variants.

- lib/pico-sdk/pico/bootrom_constants.h: content moved to the new
  upstream location lib/pico-sdk/boot/bootrom_constants.h; the old
  path is kept as a backwards-compatible shim. This includes the
  BOOTROM_WELL_KNOWN_PTR_SIZE fix from PR Arksine#174 (now folded into the
  full resync rather than living as a standalone change).
- src/rp2040/rp2350_bootrom.c: updated include to the new
  boot/bootrom_constants.h location.
- rp2350 register/struct headers (clocks, ticks, usb, busctrl, powman,
  rosc, rvcsr, syscfg, dreq, glitch_detector, intctrl, pio) and
  cmsis_include headers: corrected reset values and descriptions to
  match v2.2.0.
- rp2040 boot_stage2, platform_defs.h, intctrl.h, structs/busctrl.h:
  matching updates from the same upstream resync.
- lib/README, lib/pico-sdk/pico-sdk.patch: document the new checkout
  procedure/revision.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Signed-off-by: Justin Hayes <justinh@rahb.ca>
@justinh-rahb
justinh-rahb force-pushed the copilot/update-pico-sdk-and-bootrom branch from 09d100a to 885997e Compare August 13, 2026 15:43
@justinh-rahb

Copy link
Copy Markdown
Contributor Author

Hello @Arksine I hope you're doing well and not too busy. If there's anything I can do to make my PRs more reviewable please let me know.

@Arksine

Arksine commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Thanks. I picked and pushed the relevant commit locally since VS Code unexpectedly added a merge commit to this PR.

@Arksine Arksine closed this Oct 1, 2026
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

Successfully merging this pull request may close these issues.

2 participants