Skip to content

feat(rp2040): add support for JackW01 and BTT SKR Pico boards - #298

Merged
ClutchplateDude merged 2 commits into
OpenAstroTech:developfrom
EricSchubert:RP2040-Support
Oct 11, 2026
Merged

ClutchplateDude merged 2 commits into
OpenAstroTech:developfrom
EricSchubert:RP2040-Support

Conversation

@EricSchubert

Copy link
Copy Markdown
Contributor

Supersedes #280, which had to be closed after a force-push broke its
shared history with develop (see #280 for the full review discussion
with @julianneswinoga — all her feedback is addressed in this branch).

Adds RP2040 support for two boards:

  • JackW01 Pi Pico printer carrier board
  • BTT SKR Pico v1.0

All review comments from #280 are addressed:

  • Restored INFO_DISPLAY_UPSIDE_DOWN/INFO_DISPLAY_MIRRORED defines and
    the OAE validation branch that were accidentally dropped
  • Removed references to unimplemented boards (bare Pico, RP2350)
  • Fixed invalid @Version library specs in platformio.ini (should be
    #version for git-hosted deps)
  • Reverted an unrelated Mount.cpp/Mount.hpp refactor that had been
    bundled into the port, keeping only the toff(1)->toff(4) change
    actually needed for TMC2209 StealthChop on RP2040

Verified: rp2040_jackw01 and rp2040_skr_pico build and flash cleanly;
SKR Pico hardware responds correctly to Meade protocol commands.

@ClutchplateDude

Copy link
Copy Markdown
Member

Hey Eric,
thanks for your contribution, sorry that we are only now getting around to looking at this, and thanks for carrying over all of julianne's feedback from #280.
The platform work itself is in good shape: the RP2040 alarm-timer implementation in InterruptCallback.cpp, the flash-backed EEPROM path in EPROMStore.cpp, the board pin files, and the [common_rp2xxx] platformio setup (the Philhower core is the right call for UART remapping) are all cleanly done and easy to review. That's the hard part, and it's done.

Unfortunately I have to ask for one more pass, because the branch as it stands would silently revert several released features - that's the real blocker, not the merge conflicts.

The problem

The branch is based on V1.13.19, but it isn't a superset of it: in the shared files, the older versions from your fork won, so the diff deletes things develop shipped in V1.13.12–V1.13.19. None of these deletions show up as merge conflicts - they would merge cleanly and quietly.
Specifically, the branch removes:

  • OAE v1 board support entirely - [env:oaeboardv1] from platformio.ini, boards/ESP32_ESP32DEV/pins_OAE_V1.hpp, all OAE ifdefs in Configuration_adv.hpp, and the OAE variant of the SSD1306 driver.
  • The test menu (TEST_VERIFY_MODE, ~850 lines across src/testmenu.* plus its f_serial.hpp integration).
  • matrix_build_parallel.py (added in V1.13.12 to speed up CI matrix builds).
  • AZ/ALT steps-per-degree EEPROM storage - those functions are still called from Mount.cpp, so this one is also a compile break.
  • Various Meade doc improvements, homing log lines, and the Changelog gets rewound to the V1.13.11 era.

My guess is the fork started life from a pre-V1.13.12 tree, and when the V1.13.19 content came in, whole files were taken from the old side - an easy trap, especially after the #280 history break. No worries, but it does need fixing before this can land.

Suggested path

A plain rebase will be painful because develop's Meade-parser rewrite (#291), the core refactor (#293), and the coordinate-handling fixes (#300–#305) touch exactly the files this PR modifies.
I'd instead start fresh:

  1. Create a new branch off current develop (and push it to this PR — same fork branch is fine).
  2. Copy over the RP2040-only additions:
    • boards/RP2040_JACKW01/, boards/RP2040_SKR_PICO/, boards/RP2040_PICO/ pin files
    • Configuration_local_examples/Configuration_local_rp2040_skr_pico.hpp
    • [common_rp2xxx] plus the two rp2040_* envs in platformio.ini - keeping [env:oaeboardv1] exactly as it is on develop
    • the ARDUINO_ARCH_RP2040 sections in InterruptCallback.cpp and EPROMStore.cpp
    • the board IDs in Constants.hpp, the ARDUINO_ARCH_RP2040 guards in the shared sources, and the new boards in matrix_build.py / README
  3. Re-apply the #elif defined(ARDUINO_ARCH_RP2040) guards against the current file contents rather than the old ones - most should only be a few lines each.
  4. Please leave Version.h and Changelog.md untouched - release-please maintains them now, and edits there will conflict on every future rebase.

One change to discuss separately

The toff(1) → toff(4) change in Mount.cpp isn't behind an RP2040 guard, so it changes TMC2209 chopper timing on AVR and ESP32 as well. If it's required for StealthChop on RP2040, please wrap it in #if defined(ARDUINO_ARCH_RP2040) for now. If you believe toff(4) is correct everywhere (the datasheet does recommend ≥3 for slow decay), that's worth its own PR where it can be tested per-platform.

Two smaller notes:

  • The red clang-format check from August was infrastructure, not your code - the workflow used pull_request_target and refused to check out the fork. That's fixed on develop, so CI will run for real on your next push.
  • Since develop's stepper and Meade code has moved under you since your hardware verification, a quick smoke test on the SKR Pico after the rebase would be great.

The rough shape to aim for: additive only - every hunk in the diff should either add RP2040 code or be a guard around it. If it deletes or rewrites something that already exists on develop, it probably shouldn't be in this PR.

Happy to help with the specifics if anything here is unclear - RP2040 support is very much wanted, it just needs to land as a pure addition on top of current develop. And if you'd prefer, I can also cherry-pick the platform pieces into a clean branch on my side so you only have to review and verify on hardware.

The previous RP2040-Support branch was based on V1.13.19 and was not a
superset of develop: in shared files the old content won, silently
reverting OAE board support, the test menu, CI tooling, and other
features develop shipped since, with no merge conflicts to flag it.

This starts fresh from current develop (through the Meade parser
rewrite and coordinate-handling fixes) and re-applies only the
RP2040-specific hunks as guarded additions:

- New board pin files (JackW01, SKR Pico) and example local config,
  carried over unchanged.
- Board IDs, config dispatch, and validation branches added
  additively for ARDUINO_ARCH_RP2040 alongside existing platforms.
- RP2040 alarm-timer (InterruptCallback.cpp) and flash-backed EEPROM
  (EPROMStore.cpp) implementations, each in their own guarded branch.
- platformio.ini: new common_rp2xxx/rp2040_* environments only;
  env:oaeboardv1 and all other environments left untouched. RP2040
  envs exclude SSD1306_128x64_Display.cpp via src_filter since no
  RP2040 board supports that display and the file unconditionally
  pulls in a library outside the minimal RP2040 toolchain.
- b_setup.hpp/c_buttons.hpp: USB CDC DTR fix, GPS/UART1 pin
  remapping, fan PWM, and shared-EN-pin handling, all gated behind
  ARDUINO_ARCH_RP2040; the previously unguarded toff(1)->toff(4) and
  UART baud (57600->115200) changes are now RP2040-only, preserving
  prior platform behavior elsewhere.
- Added defaulted copy-assignment operators to the DayTime/
  Declination/Latitude/Longitude coordinate types (both the core::
  classes and the Latitude/Longitude Arduino overlays), needed to
  silence a deprecated-copy warning promoted to an error on the
  RP2040 toolchain; verified harmless on all other platforms via the
  native test suite.

Every file not touched here was checked to be byte-identical to
develop. rp2040_jackw01 and rp2040_skr_pico build clean; ramps builds
clean; esp32/oaeboardv1/mksgenl* fail identically with and without
this change (pre-existing, unrelated to this port); all 333 native
unit tests pass. Smoke-tested on SKR Pico hardware.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@EricSchubert

Copy link
Copy Markdown
Contributor Author

@ClutchplateDude, I believe I've managed to create a new branch with my SKR Pico support built on the latest main branch. The PR should be updated with those changes. Let me know if anything was missed or broken.

@ClutchplateDude ClutchplateDude changed the title Add RP2040 Support for JackW01 and BTT SKR Pico boards feat(rp2040): add support for JackW01 and BTT SKR Pico boards Oct 11, 2026
CI fails forked PRs that need formatting changes (the auto-fix commit
only runs for branches in the main repository), so apply the project
clang-format directly: brace placement in the CDC console wait, a
trailing-comment column, nested #if indentation, and #define column
alignment in the example configuration. No code changes.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@ClutchplateDude
ClutchplateDude merged commit 2f77d61 into OpenAstroTech:develop Oct 11, 2026
8 checks passed
ClutchplateDude added a commit that referenced this pull request Oct 11, 2026
Develop now carries the RP2040 port via the rebuilt #298. Take our side
where this branch holds the verified deltas (5 kHz stepping and timer
semantics, TMC hold-current fix, RP2040 hardware info, SSD1306 info
display, CI matrix entries, single-write logging), and develop's side
for the ConfigurationValidation DIAG advisories and the .gitignore
ordering.

Co-Authored-By: Claude Code <noreply@anthropic.com>
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