Add RP2040 Support for JackW01 and BTT SKR Pico boards - #280
Add RP2040 Support for JackW01 and BTT SKR Pico boards#280EricSchubert wants to merge 13 commits into
Conversation
|
Looks like your PR has code that needs to be changed in order to meet our coding standards!
|
|
I'm attaching a file created by Claude AI to explain the any code changes made to support RP2040 and the BTT SKR Pico. |
| #ifndef INFO_DISPLAY_UPSIDE_DOWN | ||
| #define INFO_DISPLAY_UPSIDE_DOWN 0 | ||
| #endif | ||
| #ifndef INFO_DISPLAY_MIRRORED | ||
| #define INFO_DISPLAY_MIRRORED 0 | ||
| #endif |
There was a problem hiding this comment.
Not sure why these were removed. It was not intentional. Likely Claude removed them because I didn't need a display for my build.
| #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" |
There was a problem hiding this comment.
these files don't exist
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Don't remove the comment
| #endif | ||
| #endif | ||
|
|
||
| #elif defined(OAE) |
| // 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 |
There was a problem hiding this comment.
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 |
| ${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 |
There was a problem hiding this comment.
Incorrect library specification: https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_install.html#repository-git-hg-svn
|
@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) |
There was a problem hiding this comment.
don't remove this comment
| // 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 |
There was a problem hiding this comment.
Do not change the format of these
There was a problem hiding this comment.
There's a lot of changes here not relevant to the pico, please revert.
Fixes requested by julianneswinoga on PR OpenAstroTech#280: - Configuration.hpp: restore accidentally-dropped INFO_DISPLAY_UPSIDE_DOWN/ INFO_DISPLAY_MIRRORED defines; drop includes for pins files that don't exist in this branch (bare Pico, RP2350 aliases) - ConfigurationValidation.hpp: restore the OAE validation branch and the "Required pin assignments missing" comments that were dropped or moved to the wrong #if branch - Constants.hpp / LocalConfiguration.hpp / platformio.ini: remove board constants, local-config branches, and platformio.ini env scaffolding for RP2350/bare-Pico boards that aren't implemented - platformio.ini: fix invalid @Version library specs on git-hosted deps (should be #version per PlatformIO docs); scope the arduino-pico deprecated-declarations warning suppression to the two RP2040 envs instead of editing shared Binary.h-style macros - src/Mount.cpp, src/Mount.hpp: revert unrelated refactor unintentionally bundled into the RP2040 port (binary literal rewrite, connectToDriver signature change, dropped guide-pulse DEC limit checks, dropped OAE coordinate shift, wrong EN pin on Focus driver failure, and more), keeping only the toff(1)->toff(4) change needed for StealthChop Verified: rp2040_jackw01 and rp2040_skr_pico build and flash cleanly; ramps (AVR) builds cleanly with the reverted Mount.cpp/Mount.hpp; SKR Pico hardware responds correctly to Meade commands after flashing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
275fe74 to
99a7d1b
Compare
Fixes requested by julianneswinoga on PR OpenAstroTech#280 (see prior commit for detailed breakdown): restore accidentally-dropped defines/comments, remove references to unimplemented boards, fix invalid platformio.ini library specs, and revert the unrelated Mount.cpp/Mount.hpp refactor back to only the toff(1)->toff(4) StealthChop change actually needed for RP2040 support. Verified: rp2040_jackw01 and rp2040_skr_pico build and flash cleanly; SKR Pico hardware responds correctly to Meade commands after flashing.
|
Closing this out in favor of #298. A force-push broke this branch's shared history with @julianneswinoga all your feedback from this thread is addressed in #298. Thanks for the review, and sorry for the churn. |
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 Boardenv:rp2040_skr_pico— BigTreeTech SKR Pico v1.0Changes
New files:
boards/RP2040_SKR_PICO/pins_RP2040_SKR_PICO.hpp— GPIO assignments for SKR PicoConfiguration_local_examples/Configuration_local_rp2040_skr_pico.hpp— example config for SKR PicoModified files:
platformio.ini— addedrp2040_jackw01andrp2040_skr_picoenvironmentsConstants.hpp— addedBOARD_RP2040_SKR_PICOConfiguration.hpp— added SKR Pico pins includeLocalConfiguration.hpp— added SKR Pico branchConfigurationValidation.hpp— added RP2040 to GPS whitelistsrc/Mount.cpp— settoff(4)on all drivers (required for StealthChop on RP2040);UART_CONNECTION_TEST_RETRIES= 5TMC2209 UART patch
The stock
TMCStepperlibrary does not support the Philhower RP2040 core's single-wirehalf-duplex UART model. A patch to
TMC2208Stepper.cppadds an_rp2040_sw_uart_write_bytecode path.platformio.inireferences a patched fork ofTMCStepper via
lib_deps— no manual steps required.OATControl compatibility fix
SerialUSB::write()on the Philhower core gates transmission on host DTR. Most serialclients (including OATControl's C#
SerialPort) default toDtrEnable=false, silentlydropping all firmware responses. Fix:
Serial.ignoreFlowControl(true)afterSerial.begin(), guarded by#if defined(ARDUINO_ARCH_RP2040)insrc/b_setup.hpp.Tested on hardware