Browse Source

Sanity-check illegal native USB (#20047)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Jason Smith 3 years ago
parent
commit
a439892d7a
No account linked to committer's email address

+ 14
- 0
Marlin/src/inc/SanityCheck.h View File

2295
 #endif
2295
 #endif
2296
 
2296
 
2297
 /**
2297
 /**
2298
+ * Some boards forbid the use of -1 Native USB
2299
+ */
2300
+#if ENABLED(BOARD_NO_NATIVE_USB)
2301
+  #undef BOARD_NO_NATIVE_USB
2302
+  #if SERIAL_PORT == -1
2303
+    #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."
2304
+  #elif SERIAL_PORT_2 == -1
2305
+    #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."
2306
+  #elif LCD_SERIAL_PORT == -1
2307
+    #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."
2308
+  #endif
2309
+#endif
2310
+
2311
+/**
2298
  * Serial displays require a dedicated serial port
2312
  * Serial displays require a dedicated serial port
2299
  */
2313
  */
2300
 #ifdef LCD_SERIAL_PORT
2314
 #ifdef LCD_SERIAL_PORT

+ 4
- 2
Marlin/src/pins/stm32f1/pins_CHITU3D.h View File

21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
 
23
 
24
-#if NOT_TARGET(__STM32F1__, __STM32F4__)
25
-  #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'"
24
+#if NOT_TARGET(__STM32F1__)
25
+  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
26
 #endif
26
 #endif
27
 
27
 
28
 /**
28
 /**
32
 #define BOARD_INFO_NAME      "Chitu3D"
32
 #define BOARD_INFO_NAME      "Chitu3D"
33
 #define DEFAULT_MACHINE_NAME "STM32F103RET6"
33
 #define DEFAULT_MACHINE_NAME "STM32F103RET6"
34
 
34
 
35
+#define BOARD_NO_NATIVE_USB
36
+
35
 // Enable I2C_EEPROM for testing
37
 // Enable I2C_EEPROM for testing
36
 //#define I2C_EEPROM
38
 //#define I2C_EEPROM
37
 
39
 

+ 4
- 2
Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h View File

21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
 
23
 
24
-#if NOT_TARGET(__STM32F1__, __STM32F4__)
25
-  #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'"
24
+#if NOT_TARGET(__STM32F1__)
25
+  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
26
 #endif
26
 #endif
27
 
27
 
28
 /**
28
 /**
32
 #define BOARD_INFO_NAME      "Chitu3D V5"
32
 #define BOARD_INFO_NAME      "Chitu3D V5"
33
 #define DEFAULT_MACHINE_NAME "STM32F103ZET6"
33
 #define DEFAULT_MACHINE_NAME "STM32F103ZET6"
34
 
34
 
35
+#define BOARD_NO_NATIVE_USB
36
+
35
 #define DISABLE_JTAG
37
 #define DISABLE_JTAG
36
 
38
 
37
 //
39
 //

+ 4
- 2
Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h View File

21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
 
23
 
24
-#if NOT_TARGET(__STM32F1__, __STM32F4__)
25
-  #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'"
24
+#if NOT_TARGET(__STM32F1__)
25
+  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
26
 #endif
26
 #endif
27
 
27
 
28
 /**
28
 /**
32
 #define BOARD_INFO_NAME      "Chitu3D"
32
 #define BOARD_INFO_NAME      "Chitu3D"
33
 #define DEFAULT_MACHINE_NAME "STM32F103ZET6"
33
 #define DEFAULT_MACHINE_NAME "STM32F103ZET6"
34
 
34
 
35
+#define BOARD_NO_NATIVE_USB
36
+
35
 #define DISABLE_JTAG
37
 #define DISABLE_JTAG
36
 
38
 
37
 //
39
 //

+ 3
- 3
Marlin/src/pins/stm32f1/pins_CREALITY_V4.h View File

26
 
26
 
27
 #if NOT_TARGET(__STM32F1__)
27
 #if NOT_TARGET(__STM32F1__)
28
   #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
28
   #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
29
-#endif
30
-
31
-#if HOTENDS > 1 || E_STEPPERS > 1
29
+#elif HOTENDS > 1 || E_STEPPERS > 1
32
   #error "CREALITY supports up to 1 hotends / E-steppers. Comment out this line to continue."
30
   #error "CREALITY supports up to 1 hotends / E-steppers. Comment out this line to continue."
33
 #endif
31
 #endif
34
 
32
 
39
   #define DEFAULT_MACHINE_NAME "Ender 3 V2"
37
   #define DEFAULT_MACHINE_NAME "Ender 3 V2"
40
 #endif
38
 #endif
41
 
39
 
40
+#define BOARD_NO_NATIVE_USB
41
+
42
 //
42
 //
43
 // EEPROM
43
 // EEPROM
44
 //
44
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h View File

38
 #define BOARD_INFO_NAME      "FLSun HiSpeedV1"
38
 #define BOARD_INFO_NAME      "FLSun HiSpeedV1"
39
 #define BOARD_WEBSITE_URL    "github.com/Foxies-CSTL"
39
 #define BOARD_WEBSITE_URL    "github.com/Foxies-CSTL"
40
 
40
 
41
+#define BOARD_NO_NATIVE_USB
42
+
41
 //
43
 //
42
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
44
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
43
 //
45
 //

+ 2
- 2
Marlin/src/pins/stm32f1/pins_FLY_MINI.h View File

21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
 
23
 
24
-#ifndef __STM32F1__
24
+#if NOT_TARGET(__STM32F1__)
25
   #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
25
   #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
26
 #endif
26
 #endif
27
 
27
 
28
 #define BOARD_INFO_NAME   "FLY_MINI"
28
 #define BOARD_INFO_NAME   "FLY_MINI"
29
-#define BOARD_WEBSITE_URL    "github.com/FLYmaker"
29
+#define BOARD_WEBSITE_URL "github.com/FLYmaker"
30
 #define DISABLE_JTAG
30
 #define DISABLE_JTAG
31
 
31
 
32
 //
32
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h View File

28
 #define BOARD_INFO_NAME   "FYSETC AIO II"
28
 #define BOARD_INFO_NAME   "FYSETC AIO II"
29
 #define BOARD_WEBSITE_URL "fysetc.com"
29
 #define BOARD_WEBSITE_URL "fysetc.com"
30
 
30
 
31
+#define BOARD_NO_NATIVE_USB
32
+
31
 #define DISABLE_JTAG
33
 #define DISABLE_JTAG
32
 
34
 
33
 #define pins_v2_20190128                          // new pins define
35
 #define pins_v2_20190128                          // new pins define

+ 2
- 1
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h View File

29
 
29
 
30
 #define BOARD_INFO_NAME   "FYSETC Cheetah"
30
 #define BOARD_INFO_NAME   "FYSETC Cheetah"
31
 #define BOARD_WEBSITE_URL "fysetc.com"
31
 #define BOARD_WEBSITE_URL "fysetc.com"
32
-// https://github.com/FYSETC/Cheetah
33
 
32
 
34
 // Ignore temp readings during development.
33
 // Ignore temp readings during development.
35
 //#define BOGUS_TEMPERATURE_GRACE_PERIOD    2000
34
 //#define BOGUS_TEMPERATURE_GRACE_PERIOD    2000
36
 
35
 
36
+#define BOARD_NO_NATIVE_USB
37
+
37
 #define DISABLE_JTAG
38
 #define DISABLE_JTAG
38
 
39
 
39
 #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
40
 #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)

+ 2
- 0
Marlin/src/pins/stm32f1/pins_GTM32_MINI.h View File

33
 #define BOARD_INFO_NAME      "GTM32 Pro VB"
33
 #define BOARD_INFO_NAME      "GTM32 Pro VB"
34
 #define DEFAULT_MACHINE_NAME "STM32F103VET6"
34
 #define DEFAULT_MACHINE_NAME "STM32F103VET6"
35
 
35
 
36
+#define BOARD_NO_NATIVE_USB
37
+
36
 //#define DISABLE_DEBUG
38
 //#define DISABLE_DEBUG
37
 
39
 
38
 //
40
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h View File

33
 #define BOARD_INFO_NAME      "GTM32 Pro VB"
33
 #define BOARD_INFO_NAME      "GTM32 Pro VB"
34
 #define DEFAULT_MACHINE_NAME "STM32F103VET6"
34
 #define DEFAULT_MACHINE_NAME "STM32F103VET6"
35
 
35
 
36
+#define BOARD_NO_NATIVE_USB
37
+
36
 //#define DISABLE_DEBUG
38
 //#define DISABLE_DEBUG
37
 
39
 
38
 //
40
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h View File

33
 #define BOARD_INFO_NAME      "GTM32 Pro VB"
33
 #define BOARD_INFO_NAME      "GTM32 Pro VB"
34
 #define DEFAULT_MACHINE_NAME "STM32F103VET6"
34
 #define DEFAULT_MACHINE_NAME "STM32F103VET6"
35
 
35
 
36
+#define BOARD_NO_NATIVE_USB
37
+
36
 //#define DISABLE_DEBUG
38
 //#define DISABLE_DEBUG
37
 
39
 
38
 //
40
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h View File

33
 #define BOARD_INFO_NAME      "GTM32 Pro VB"
33
 #define BOARD_INFO_NAME      "GTM32 Pro VB"
34
 #define DEFAULT_MACHINE_NAME "M201"
34
 #define DEFAULT_MACHINE_NAME "M201"
35
 
35
 
36
+#define BOARD_NO_NATIVE_USB
37
+
36
 //#define DISABLE_DEBUG
38
 //#define DISABLE_DEBUG
37
 
39
 
38
 //
40
 //

+ 3
- 0
Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h View File

33
 #elif HOTENDS > 1 || E_STEPPERS > 1
33
 #elif HOTENDS > 1 || E_STEPPERS > 1
34
   #error "JGAurora 32-bit board only supports 1 hotend / E-stepper. Comment out this line to continue."
34
   #error "JGAurora 32-bit board only supports 1 hotend / E-stepper. Comment out this line to continue."
35
 #endif
35
 #endif
36
+
36
 #define BOARD_INFO_NAME "JGAurora A5S A1 board"
37
 #define BOARD_INFO_NAME "JGAurora A5S A1 board"
37
 
38
 
39
+#define BOARD_NO_NATIVE_USB
40
+
38
 #ifndef STM32_XL_DENSITY
41
 #ifndef STM32_XL_DENSITY
39
   #define STM32_XL_DENSITY
42
   #define STM32_XL_DENSITY
40
 #endif
43
 #endif

+ 2
- 0
Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h View File

31
 #define BOARD_INFO_NAME "Longer3D"
31
 #define BOARD_INFO_NAME "Longer3D"
32
 #define ALFAWISE_UX0                              // Common to all Longer3D STM32F1 boards (used for Open drain mosfets)
32
 #define ALFAWISE_UX0                              // Common to all Longer3D STM32F1 boards (used for Open drain mosfets)
33
 
33
 
34
+#define BOARD_NO_NATIVE_USB
35
+
34
 //#define DISABLE_DEBUG                           //  We still want to debug with STLINK...
36
 //#define DISABLE_DEBUG                           //  We still want to debug with STLINK...
35
 #define DISABLE_JTAG                              //  We free the jtag pins (PA15) but keep STLINK
37
 #define DISABLE_JTAG                              //  We free the jtag pins (PA15) but keep STLINK
36
                                                   //  Release PB4 (STEP_X_PIN) from JTAG NRST role.
38
                                                   //  Release PB4 (STEP_X_PIN) from JTAG NRST role.

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h View File

35
 
35
 
36
 #define BOARD_INFO_NAME "MKS Robin"
36
 #define BOARD_INFO_NAME "MKS Robin"
37
 
37
 
38
+#define BOARD_NO_NATIVE_USB
39
+
38
 //
40
 //
39
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
41
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
40
 //
42
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h View File

35
 
35
 
36
 #define BOARD_INFO_NAME "MKS Robin e3p"
36
 #define BOARD_INFO_NAME "MKS Robin e3p"
37
 
37
 
38
+#define BOARD_NO_NATIVE_USB
39
+
38
 //
40
 //
39
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
41
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
40
 //
42
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h View File

29
   #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
29
   #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
30
 #endif
30
 #endif
31
 
31
 
32
+#define BOARD_NO_NATIVE_USB
33
+
32
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks"
34
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks"
33
 
35
 
34
 //#define DISABLE_DEBUG
36
 //#define DISABLE_DEBUG

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h View File

32
 #endif
32
 #endif
33
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks"
33
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks"
34
 
34
 
35
+#define BOARD_NO_NATIVE_USB
36
+
35
 //#define DISABLE_DEBUG
37
 //#define DISABLE_DEBUG
36
 #define DISABLE_JTAG
38
 #define DISABLE_JTAG
37
 
39
 

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h View File

36
 #endif
36
 #endif
37
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks"
37
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks"
38
 
38
 
39
+#define BOARD_NO_NATIVE_USB
40
+
39
 //#define DISABLE_DEBUG
41
 //#define DISABLE_DEBUG
40
 #define DISABLE_JTAG
42
 #define DISABLE_JTAG
41
 
43
 

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h View File

33
 
33
 
34
 #define BOARD_INFO_NAME "MKS Robin Mini"
34
 #define BOARD_INFO_NAME "MKS Robin Mini"
35
 
35
 
36
+#define BOARD_NO_NATIVE_USB
37
+
36
 //
38
 //
37
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
39
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
38
 //
40
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h View File

33
 
33
 
34
 #define BOARD_INFO_NAME "MKS Robin Nano"
34
 #define BOARD_INFO_NAME "MKS Robin Nano"
35
 
35
 
36
+#define BOARD_NO_NATIVE_USB
37
+
36
 //
38
 //
37
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
39
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
38
 //
40
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h View File

35
 
35
 
36
 #define BOARD_INFO_NAME "MKS Robin nano V2.0"
36
 #define BOARD_INFO_NAME "MKS Robin nano V2.0"
37
 
37
 
38
+#define BOARD_NO_NATIVE_USB
39
+
38
 //
40
 //
39
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
41
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
40
 //
42
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h View File

33
 
33
 
34
 #define BOARD_INFO_NAME "MKS Robin pro"
34
 #define BOARD_INFO_NAME "MKS Robin pro"
35
 
35
 
36
+#define BOARD_NO_NATIVE_USB
37
+
36
 //
38
 //
37
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
39
 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
38
 //
40
 //

+ 2
- 2
Marlin/src/pins/stm32f1/pins_STM3R_MINI.h View File

21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
 
23
 
24
-#if NOT_TARGET(__STM32F1__, __STM32F4__)
25
-  #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'"
24
+#if NOT_TARGET(__STM32F1__)
25
+  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
26
 #endif
26
 #endif
27
 
27
 
28
 /**
28
 /**

+ 3
- 0
Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h View File

35
 #endif
35
 #endif
36
 
36
 
37
 #define BOARD_INFO_NAME "Trigorilla Pro"
37
 #define BOARD_INFO_NAME "Trigorilla Pro"
38
+
39
+#define BOARD_NO_NATIVE_USB
40
+
38
 #define DISABLE_JTAG
41
 #define DISABLE_JTAG
39
 
42
 
40
 //
43
 //

+ 1
- 1
buildroot/tests/mks_robin_lite-tests View File

8
 
8
 
9
 restore_configs
9
 restore_configs
10
 opt_set MOTHERBOARD BOARD_MKS_ROBIN_LITE
10
 opt_set MOTHERBOARD BOARD_MKS_ROBIN_LITE
11
-opt_set SERIAL_PORT -1
11
+opt_set SERIAL_PORT 1
12
 opt_enable EEPROM_SETTINGS
12
 opt_enable EEPROM_SETTINGS
13
 opt_enable SDSUPPORT
13
 opt_enable SDSUPPORT
14
 exec_test $1 $2 "Default Configuration with Fallback SD EEPROM"
14
 exec_test $1 $2 "Default Configuration with Fallback SD EEPROM"

+ 2
- 0
buildroot/tests/mks_robin_pro-tests View File

8
 
8
 
9
 use_example_configs Mks/Robin_Pro
9
 use_example_configs Mks/Robin_Pro
10
 opt_enable EMERGENCY_PARSER
10
 opt_enable EMERGENCY_PARSER
11
+opt_set SERIAL_PORT 3
12
+opt_disable SERIAL_PORT_2
11
 opt_set SDCARD_CONNECTION LCD
13
 opt_set SDCARD_CONNECTION LCD
12
 opt_set X_DRIVER_TYPE TMC2209
14
 opt_set X_DRIVER_TYPE TMC2209
13
 opt_set Y_DRIVER_TYPE TMC2130
15
 opt_set Y_DRIVER_TYPE TMC2130

Loading…
Cancel
Save