Skip to content

Add RP2040 Support for JackW01 and BTT SKR Pico boards#280

Open
EricSchubert wants to merge 5 commits intoOpenAstroTech:developfrom
EricSchubert:RP2040-Support
Open

Add RP2040 Support for JackW01 and BTT SKR Pico boards#280
EricSchubert wants to merge 5 commits intoOpenAstroTech:developfrom
EricSchubert:RP2040-Support

Conversation

@EricSchubert
Copy link

@EricSchubert EricSchubert commented Mar 10, 2026

Utilized Claude AI to add hardware support for RP2040-based BigTreeTech SKR Pico v1.0 and open-source JackW01 Pico printer boards. (GitHub for JackW01 here: https://jackw01.github.io/pi-pico-printer-board/ )

NOTE: This also requires modification to TMCStepper2208 library, found on my GitHub page:
https://github.com/EricSchubert/TMCStepper-RP2040_Support

libdeps has been updated in platformio.ini to point to this repo until official TMCStepper code merges the changes.

Add RP2040 support for JackW01 Pi Pico Printer Board and BTT SKR Pico v1.0

Summary

This PR adds firmware support for two RP2040-based boards, both using TMC2209 drivers
via UART and the Earle Philhower RP2040 Arduino core.

Supported boards (both confirmed working on hardware):

  • env:rp2040_jackw01 — JackW01 Pi Pico Printer Board
  • env:rp2040_skr_pico — BigTreeTech SKR Pico v1.0

Changes

New files:

  • boards/RP2040_SKR_PICO/pins_RP2040_SKR_PICO.hpp — GPIO assignments for SKR Pico
  • Configuration_local_examples/Configuration_local_rp2040_skr_pico.hpp — example config for SKR Pico

Modified files:

  • platformio.ini — added rp2040_jackw01 and rp2040_skr_pico environments
  • Constants.hpp — added BOARD_RP2040_SKR_PICO
  • Configuration.hpp — added SKR Pico pins include
  • LocalConfiguration.hpp — added SKR Pico branch
  • ConfigurationValidation.hpp — added RP2040 to GPS whitelist
  • src/Mount.cpp — set toff(4) on all drivers (required for StealthChop on RP2040);
    UART_CONNECTION_TEST_RETRIES = 5

TMC2209 UART patch

The stock TMCStepper library does not support the Philhower RP2040 core's single-wire
half-duplex UART model. A patch to TMC2208Stepper.cpp adds an
_rp2040_sw_uart_write_byte code path. platformio.ini references a patched fork of
TMCStepper via lib_deps — no manual steps required.

OATControl compatibility fix

SerialUSB::write() on the Philhower core gates transmission on host DTR. Most serial
clients (including OATControl's C# SerialPort) default to DtrEnable=false, silently
dropping all firmware responses. Fix: Serial.ignoreFlowControl(true) after
Serial.begin(), guarded by #if defined(ARDUINO_ARCH_RP2040) in src/b_setup.hpp.

Tested on hardware

  • UART communication confirmed on all 4 TMC2209 drivers
  • StealthChop confirmed working
  • RA Hall sensor homing confirmed from both directions
  • OATControl connects and controls mount via direct serial (COM port)
  • GPS (ATGM336H-5N) confirmed working on SKR Pico
  • DEC direction correct on both boards

@openastrotech-bot
Copy link
Contributor

Looks like your PR has code that needs to be changed in order to meet our coding standards!
Here are your options:

  1. Apply the patch that was generated by the job
    1. Click details under the failing clang-format check
    2. Click the Artifacts dropdown in the top right
    3. Download + unzip the clang-format-diff.patch file into the OpenAstroTracker-Firmware repo
    4. Run git apply clang-format-diff.patch to make the changes
    5. Commit and push up the formatted code
  2. Run clang-format locally
    1. Run the command bash -c 'shopt -s nullglob globstar;GLOBIGNORE=./src/libs/TimerInterrupt/*; for i in ./{.,src/**,unit_tests,boards/**}/*.{c,cpp,h,hpp}; do clang-format -i $i; done'
    2. Commit and push up the formatted code

@EricSchubert
Copy link
Author

EricSchubert commented Mar 10, 2026

I'm attaching a file created by Claude AI to explain the any code changes made to support RP2040 and the BTT SKR Pico.
RP2040_PORT_NOTES.md

Comment on lines -76 to -81
#ifndef INFO_DISPLAY_UPSIDE_DOWN
#define INFO_DISPLAY_UPSIDE_DOWN 0
#endif
#ifndef INFO_DISPLAY_MIRRORED
#define INFO_DISPLAY_MIRRORED 0
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Why remove these?

Copy link
Author

Choose a reason for hiding this comment

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

Not sure why these were removed. It was not intentional. Likely Claude removed them because I didn't need a display for my build.

Comment on lines +269 to +272
#elif (BOARD == BOARD_RP2040_JACKW01) || (BOARD == BOARD_RP2350_JACKW01)
#include "boards/RP2040_JACKW01/pins_RP2040_JACKW01.hpp"
#elif (BOARD == BOARD_RP2040_SKR_PICO)
#include "boards/RP2040_SKR_PICO/pins_RP2040_SKR_PICO.hpp"
Copy link
Member

Choose a reason for hiding this comment

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

these files don't exist

Copy link
Author

Choose a reason for hiding this comment

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

The file pins_RP2040_SKR_PICO.hpp does exist in this branch. I can supply the pins_RP2040_JACKW01.hpp file. This was left out by mistake and should have been included.

#endif
#elif (AZ_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART)
#if !defined(AZ_STEP_PIN) || !defined(AZ_DIR_PIN) || !defined(AZ_EN_PIN)
// Required pin assignments missing (ATmega uses SoftwareSerial for this driver)
Copy link
Member

Choose a reason for hiding this comment

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

Don't remove the comment

#endif
#endif

#elif defined(OAE)
Copy link
Member

Choose a reason for hiding this comment

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

Don't remove these

Constants.hpp Outdated
Comment on lines +22 to +29
// RP2040/RP2350 based boards (2000-2999)
// 2001-2099: Generic bare Pico family (user-defined wiring) -- NOT YET SUPPORTED
// 2101-2199: Pico family + JackW01 printer carrier board
// 2201-2299: BTT SKR Pico family
// #define BOARD_RP2040_PICO 2001 // NOT YET SUPPORTED: requires user-defined pin wiring in local config
// #define BOARD_RP2350_PICO2 2002 // NOT YET SUPPORTED: requires user-defined pin wiring in local config
#define BOARD_RP2040_JACKW01 2101 // Raspberry Pi Pico (RP2040) + JackW01 printer board
#define BOARD_RP2350_JACKW01 2102 // Raspberry Pi Pico 2 (RP2350) + JackW01 printer board
Copy link
Member

Choose a reason for hiding this comment

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

Don't add references to boards that don't exist

arduino-libraries/LiquidCrystal @ ^1.0.7
lincomatic/LiquidTWI2@^1.2.7
olikraus/U8g2@^2.28.8
https://github.com/ClutchplateDude/esp8266-oled-ssd1306#4.6.2
Copy link
Member

Choose a reason for hiding this comment

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

Don't change this

platformio.ini Outdated
${common.lib_deps}
jdolinay/avr-debugger @ 1.2
https://github.com/andre-stefanov/avr-interrupt-stepper#0.0.4
https://github.com/andre-stefanov/avr-interrupt-stepper@0.0.4
Copy link
Member

Choose a reason for hiding this comment

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

@EricSchubert
Copy link
Author

@julianneswinoga, I believe all requested changes have been addressed. Ready for re-review.

#endif
#elif (ALT_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART)
#if !defined(ALT_STEP_PIN) || !defined(ALT_DIR_PIN) || !defined(ALT_EN_PIN)
// Required pin assignments missing (ATmega uses SoftwareSerial for this driver)
Copy link
Member

Choose a reason for hiding this comment

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

don't remove this comment

Comment on lines +31 to +45
// slewingStatus()
#define SLEWING_DEC 0b00000010
#define SLEWING_RA 0b00000001
#define SLEWING_BOTH 0b00000011
#define SLEWING_TRACKING 0b00001000
#define NOT_SLEWING 0b00000000

// slewStatus
#define SLEW_MASK_DEC 0b0011
#define SLEW_MASK_NORTH 0b0001
#define SLEW_MASK_SOUTH 0b0010
#define SLEW_MASK_RA 0b1100
#define SLEW_MASK_EAST 0b0100
#define SLEW_MASK_WEST 0b1000
#define SLEW_MASK_ANY 0b1111
Copy link
Member

Choose a reason for hiding this comment

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

Do not change the format of these

Copy link
Member

Choose a reason for hiding this comment

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

There's a lot of changes here not relevant to the pico, please revert.

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.

3 participants