diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 069f36714d93a..e034b2e8aaaf4 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -35,6 +35,8 @@ jobs: test-platform: # Base Environments + - SKR_Pico + - DUE - DUE_archim - esp32 diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index d8fdd9894387b..6969fbf8dea27 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -455,6 +455,7 @@ // #define BOARD_RP2040 6200 // Generic RP2040 Test board +#define BOARD_BTT_SKR_PICO 6201 // BigTreeTech SKR Pico 1.x // // Custom board diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 18eebd454faa9..756bbe3d403c9 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -749,6 +749,8 @@ #elif MB(RP2040) #include "rp2040/pins_RP2040.h" // RP2040 env:RP2040 +#elif MB(BTT_SKR_PICO) + #include "rp2040/pins_BTT_SKR_Pico.h" // RP2040 env:SKR_Pico env:SKR_Pico_UART // // Custom board (with custom PIO env) diff --git a/Marlin/src/pins/rp2040/env_validate.h b/Marlin/src/pins/rp2040/env_validate.h new file mode 100644 index 0000000000000..1c92ffce96848 --- /dev/null +++ b/Marlin/src/pins/rp2040/env_validate.h @@ -0,0 +1,26 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if NOT_TARGET(__PLAT_RP2040__) + #error "Oops! Make sure to build with environment 'RP2040'." +#endif diff --git a/Marlin/src/pins/rp2040/pins_BTT_SKR_Pico.h b/Marlin/src/pins/rp2040/pins_BTT_SKR_Pico.h new file mode 100644 index 0000000000000..9e84b942316a4 --- /dev/null +++ b/Marlin/src/pins/rp2040/pins_BTT_SKR_Pico.h @@ -0,0 +1,157 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * BigTreeTech SKR Pico + * https://github.com/bigtreetech/SKR-Pico + */ + +#include "env_validate.h" + +#define BOARD_INFO_NAME "BTT SKR Pico" +#define DEFAULT_MACHINE_NAME "BIQU 3D Printer" + +#define USBCON + +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x2000 // 8KB +#endif + +// +// Servos +// +#define SERVO0_PIN 29 + +// +// Limit Switches +// +#define X_DIAG_PIN 4 +#define Y_DIAG_PIN 3 +#define Z_DIAG_PIN 25 // probe:z_virtual_endstop + +#define X_STOP_PIN X_DIAG_PIN +#define Y_STOP_PIN Y_DIAG_PIN +#define Z_STOP_PIN Z_DIAG_PIN + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 16 // E0-STOP +#endif + +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 22 +#endif + +// +// Steppers +// +#define X_STEP_PIN 11 +#define X_DIR_PIN 10 +#define X_ENABLE_PIN 12 + +#define Y_STEP_PIN 6 +#define Y_DIR_PIN 5 +#define Y_ENABLE_PIN 7 + +#define Z_STEP_PIN 19 +#define Z_DIR_PIN 28 +#define Z_ENABLE_PIN 2 + +#define E0_STEP_PIN 14 +#define E0_DIR_PIN 13 +#define E0_ENABLE_PIN 15 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 27 // Analog Input +#define TEMP_BED_PIN 26 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 23 +#define HEATER_BED_PIN 21 + +#define FAN_PIN 17 +#define FAN1_PIN 18 + +#if HAS_CUTTER + #define SPINDLE_LASER_ENA_PIN 0 + #define SPINDLE_LASER_PWM_PIN 1 +#else + #define FAN2_PIN 20 +#endif + +// +// Misc. Functions +// +#define NEOPIXEL_PIN 24 + +/** + * TMC2208/TMC2209 stepper drivers + */ +#if HAS_TMC_UART + /** + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL MSerial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + /** + * Software serial + */ + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN 8 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN 9 + #endif + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN 8 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN 9 + #endif + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN 8 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN 9 + #endif + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN 8 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN 9 + #endif +#endif diff --git a/Marlin/src/pins/rp2040/pins_RP2040.h b/Marlin/src/pins/rp2040/pins_RP2040.h index 889915612f28e..48c291df9225f 100644 --- a/Marlin/src/pins/rp2040/pins_RP2040.h +++ b/Marlin/src/pins/rp2040/pins_RP2040.h @@ -21,37 +21,10 @@ */ #pragma once -/** - * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments - * - * Applies to the following boards: - * - * RAMPS_14_EFB (Hotend, Fan, Bed) - * RAMPS_14_EEB (Hotend0, Hotend1, Bed) - * RAMPS_14_EFF (Hotend, Fan0, Fan1) - * RAMPS_14_EEF (Hotend0, Hotend1, Fan) - * RAMPS_14_SF (Spindle, Controller Fan) - * - * RAMPS_13_EFB (Hotend, Fan, Bed) - * RAMPS_13_EEB (Hotend0, Hotend1, Bed) - * RAMPS_13_EFF (Hotend, Fan0, Fan1) - * RAMPS_13_EEF (Hotend0, Hotend1, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - * Other pins_MYBOARD.h files may override these defaults - * - * Differences between - * RAMPS_13 | RAMPS_14 - * 7 | 11 - */ +#include "env_validate.h" -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "RP2040 Test" -#endif - -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME "RP2040 Test" -#endif +#define BOARD_INFO_NAME "RP2040 Test" +#define DEFAULT_MACHINE_NAME "RP2040 Test" #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE 0x1000 // 4KB @@ -66,13 +39,13 @@ // // Limit Switches // -#define X_MIN_PIN 13 -#define Y_MIN_PIN 3 -#define Z_MIN_PIN 2 +#define X_STOP_PIN 13 +#define Y_STOP_PIN 3 +#define Z_STOP_PIN 2 // // Steppers - +// #define X_STEP_PIN 29 #define X_DIR_PIN 29 #define X_ENABLE_PIN 29 @@ -130,7 +103,7 @@ // // Heaters / Fans - +// #define HEATER_0_PIN 24 // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") diff --git a/buildroot/tests/SKR_Pico b/buildroot/tests/SKR_Pico new file mode 100755 index 0000000000000..f0c3438cae45a --- /dev/null +++ b/buildroot/tests/SKR_Pico @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for BTT SKR Pico +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BTT_SKR_PICO +exec_test $1 $2 "Default Configuration" "$3" + +# clean up +restore_configs diff --git a/buildroot/tests/at90usb1286_cdc b/buildroot/tests/at90usb1286_cdc index 01d752db8b4c4..7dcf8d541ab5a 100755 --- a/buildroot/tests/at90usb1286_cdc +++ b/buildroot/tests/at90usb1286_cdc @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Build tests for AT90USB1286 ARMED +# Build tests for AT90USB1286 (CDC) # # exit on first failure diff --git a/buildroot/tests/at90usb1286_dfu b/buildroot/tests/at90usb1286_dfu index 75672a6a51507..a753097694c43 100755 --- a/buildroot/tests/at90usb1286_dfu +++ b/buildroot/tests/at90usb1286_dfu @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Build tests for AT90USB1286 ARMED +# Build tests for AT90USB1286 (DFU) # # exit on first failure diff --git a/ini/raspberrypi.ini b/ini/raspberrypi.ini index 852c5a4f69ffa..e674f1f47ab82 100644 --- a/ini/raspberrypi.ini +++ b/ini/raspberrypi.ini @@ -16,3 +16,12 @@ lib_ignore = WiFi build_flags = ${common.build_flags} -D__PLAT_RP2040__ -Wno-expansion-to-defined #debug_tool = jlink #upload_protocol = jlink + +# +# BigTreeTech SKR Pico 1.x +# +[env:SKR_Pico] +extends = env:RP2040 + +[env:SKR_Pico_UART] +extends = env:SKR_Pico