diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 443669bb2..498455e59 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2294,6 +2294,20 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "GRAPHICAL_TFT_UPSCALE must be set to 2 or 3." #endif +/** + * Some boards forbid the use of -1 Native USB + */ +#if ENABLED(BOARD_NO_NATIVE_USB) + #undef BOARD_NO_NATIVE_USB + #if SERIAL_PORT == -1 + #error "SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT to a valid value for your board." + #elif SERIAL_PORT_2 == -1 + #error "SERIAL_PORT_2 is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT_2 to a valid value for your board." + #elif LCD_SERIAL_PORT == -1 + #error "LCD_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set LCD_SERIAL_PORT to a valid value for your board." + #endif +#endif + /** * Serial displays require a dedicated serial port */ diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 1d8f4f684..aa83a0cb0 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** @@ -32,6 +32,8 @@ #define BOARD_INFO_NAME "Chitu3D" #define DEFAULT_MACHINE_NAME "STM32F103RET6" +#define BOARD_NO_NATIVE_USB + // Enable I2C_EEPROM for testing //#define I2C_EEPROM diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index 181872737..b13fde026 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** @@ -32,6 +32,8 @@ #define BOARD_INFO_NAME "Chitu3D V5" #define DEFAULT_MACHINE_NAME "STM32F103ZET6" +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG // diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index 1d6e6b398..a015fb270 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** @@ -32,6 +32,8 @@ #define BOARD_INFO_NAME "Chitu3D" #define DEFAULT_MACHINE_NAME "STM32F103ZET6" +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG // diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index eb910dd84..c6f2dd8b8 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -26,9 +26,7 @@ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#if HOTENDS > 1 || E_STEPPERS > 1 +#elif HOTENDS > 1 || E_STEPPERS > 1 #error "CREALITY supports up to 1 hotends / E-steppers. Comment out this line to continue." #endif @@ -39,6 +37,8 @@ #define DEFAULT_MACHINE_NAME "Ender 3 V2" #endif +#define BOARD_NO_NATIVE_USB + // // EEPROM // diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index bf3389492..5f9107244 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -38,6 +38,8 @@ #define BOARD_INFO_NAME "FLSun HiSpeedV1" #define BOARD_WEBSITE_URL "github.com/Foxies-CSTL" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 9bb2cd371..073d6c736 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -21,12 +21,12 @@ */ #pragma once -#ifndef __STM32F1__ +#if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif #define BOARD_INFO_NAME "FLY_MINI" -#define BOARD_WEBSITE_URL "github.com/FLYmaker" +#define BOARD_WEBSITE_URL "github.com/FLYmaker" #define DISABLE_JTAG // diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index bab6182e4..aebb776b2 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -28,6 +28,8 @@ #define BOARD_INFO_NAME "FYSETC AIO II" #define BOARD_WEBSITE_URL "fysetc.com" +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG #define pins_v2_20190128 // new pins define diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index deca1a054..b8a4ccf77 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -29,11 +29,12 @@ #define BOARD_INFO_NAME "FYSETC Cheetah" #define BOARD_WEBSITE_URL "fysetc.com" -// https://github.com/FYSETC/Cheetah // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index 00c572138..52b857ac0 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "STM32F103VET6" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index b10748e57..85d0be6d6 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "STM32F103VET6" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 00c572138..52b857ac0 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "STM32F103VET6" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index b913530f6..292119ce0 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "M201" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index 0dd8fb69a..f86acf1f2 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -33,8 +33,11 @@ #elif HOTENDS > 1 || E_STEPPERS > 1 #error "JGAurora 32-bit board only supports 1 hotend / E-stepper. Comment out this line to continue." #endif + #define BOARD_INFO_NAME "JGAurora A5S A1 board" +#define BOARD_NO_NATIVE_USB + #ifndef STM32_XL_DENSITY #define STM32_XL_DENSITY #endif diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index c68557070..fd5c57387 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -31,6 +31,8 @@ #define BOARD_INFO_NAME "Longer3D" #define ALFAWISE_UX0 // Common to all Longer3D STM32F1 boards (used for Open drain mosfets) +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // We still want to debug with STLINK... #define DISABLE_JTAG // We free the jtag pins (PA15) but keep STLINK // Release PB4 (STEP_X_PIN) from JTAG NRST role. diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index e6c8098f2..581dd5375 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -35,6 +35,8 @@ #define BOARD_INFO_NAME "MKS Robin" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 2b7417c29..9c0f2deea 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -35,6 +35,8 @@ #define BOARD_INFO_NAME "MKS Robin e3p" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index ffcdc3cfd..2dcd7780a 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -29,6 +29,8 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif +#define BOARD_NO_NATIVE_USB + #define BOARD_WEBSITE_URL "github.com/makerbase-mks" //#define DISABLE_DEBUG diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index ab5350e4d..d7c4aebe3 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -32,6 +32,8 @@ #endif #define BOARD_WEBSITE_URL "github.com/makerbase-mks" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG #define DISABLE_JTAG diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index 4c1299fe0..f8b8a891b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -36,6 +36,8 @@ #endif #define BOARD_WEBSITE_URL "github.com/makerbase-mks" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG #define DISABLE_JTAG diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 8c63f7973..2406c22d5 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "MKS Robin Mini" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index e7e583a6f..3c9b2f5b5 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "MKS Robin Nano" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index e009d34d9..9c1d073da 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -35,6 +35,8 @@ #define BOARD_INFO_NAME "MKS Robin nano V2.0" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 639a8f057..8f1a405e8 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "MKS Robin pro" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index 3ebc4bca5..ef82b71f5 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 8314858d1..2fc34ce29 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -35,6 +35,9 @@ #endif #define BOARD_INFO_NAME "Trigorilla Pro" + +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG // diff --git a/buildroot/tests/mks_robin_lite-tests b/buildroot/tests/mks_robin_lite-tests index 34809641e..d54627e06 100644 --- a/buildroot/tests/mks_robin_lite-tests +++ b/buildroot/tests/mks_robin_lite-tests @@ -8,7 +8,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_MKS_ROBIN_LITE -opt_set SERIAL_PORT -1 +opt_set SERIAL_PORT 1 opt_enable EEPROM_SETTINGS opt_enable SDSUPPORT exec_test $1 $2 "Default Configuration with Fallback SD EEPROM" diff --git a/buildroot/tests/mks_robin_pro-tests b/buildroot/tests/mks_robin_pro-tests index 50ec7b0dd..3cafc6142 100644 --- a/buildroot/tests/mks_robin_pro-tests +++ b/buildroot/tests/mks_robin_pro-tests @@ -8,6 +8,8 @@ set -e use_example_configs Mks/Robin_Pro opt_enable EMERGENCY_PARSER +opt_set SERIAL_PORT 3 +opt_disable SERIAL_PORT_2 opt_set SDCARD_CONNECTION LCD opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130