瀏覽代碼

Sanity-check illegal native USB (#20047)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Jason Smith 4 年之前
父節點
當前提交
a439892d7a
No account linked to committer's email address
共有 28 個文件被更改,包括 76 次插入15 次删除
  1. 14
    0
      Marlin/src/inc/SanityCheck.h
  2. 4
    2
      Marlin/src/pins/stm32f1/pins_CHITU3D.h
  3. 4
    2
      Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h
  4. 4
    2
      Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h
  5. 3
    3
      Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
  6. 2
    0
      Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
  7. 2
    2
      Marlin/src/pins/stm32f1/pins_FLY_MINI.h
  8. 2
    0
      Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h
  9. 2
    1
      Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h
  10. 2
    0
      Marlin/src/pins/stm32f1/pins_GTM32_MINI.h
  11. 2
    0
      Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h
  12. 2
    0
      Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h
  13. 2
    0
      Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h
  14. 3
    0
      Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h
  15. 2
    0
      Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h
  16. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h
  17. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h
  18. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
  19. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h
  20. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h
  21. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h
  22. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
  23. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
  24. 2
    0
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
  25. 2
    2
      Marlin/src/pins/stm32f1/pins_STM3R_MINI.h
  26. 3
    0
      Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h
  27. 1
    1
      buildroot/tests/mks_robin_lite-tests
  28. 2
    0
      buildroot/tests/mks_robin_pro-tests

+ 14
- 0
Marlin/src/inc/SanityCheck.h 查看文件

@@ -2295,6 +2295,20 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
2295 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 2312
  * Serial displays require a dedicated serial port
2299 2313
  */
2300 2314
 #ifdef LCD_SERIAL_PORT

+ 4
- 2
Marlin/src/pins/stm32f1/pins_CHITU3D.h 查看文件

@@ -21,8 +21,8 @@
21 21
  */
22 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 26
 #endif
27 27
 
28 28
 /**
@@ -32,6 +32,8 @@
32 32
 #define BOARD_INFO_NAME      "Chitu3D"
33 33
 #define DEFAULT_MACHINE_NAME "STM32F103RET6"
34 34
 
35
+#define BOARD_NO_NATIVE_USB
36
+
35 37
 // Enable I2C_EEPROM for testing
36 38
 //#define I2C_EEPROM
37 39
 

+ 4
- 2
Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h 查看文件

@@ -21,8 +21,8 @@
21 21
  */
22 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 26
 #endif
27 27
 
28 28
 /**
@@ -32,6 +32,8 @@
32 32
 #define BOARD_INFO_NAME      "Chitu3D V5"
33 33
 #define DEFAULT_MACHINE_NAME "STM32F103ZET6"
34 34
 
35
+#define BOARD_NO_NATIVE_USB
36
+
35 37
 #define DISABLE_JTAG
36 38
 
37 39
 //

+ 4
- 2
Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h 查看文件

@@ -21,8 +21,8 @@
21 21
  */
22 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 26
 #endif
27 27
 
28 28
 /**
@@ -32,6 +32,8 @@
32 32
 #define BOARD_INFO_NAME      "Chitu3D"
33 33
 #define DEFAULT_MACHINE_NAME "STM32F103ZET6"
34 34
 
35
+#define BOARD_NO_NATIVE_USB
36
+
35 37
 #define DISABLE_JTAG
36 38
 
37 39
 //

+ 3
- 3
Marlin/src/pins/stm32f1/pins_CREALITY_V4.h 查看文件

@@ -26,9 +26,7 @@
26 26
 
27 27
 #if NOT_TARGET(__STM32F1__)
28 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 30
   #error "CREALITY supports up to 1 hotends / E-steppers. Comment out this line to continue."
33 31
 #endif
34 32
 
@@ -39,6 +37,8 @@
39 37
   #define DEFAULT_MACHINE_NAME "Ender 3 V2"
40 38
 #endif
41 39
 
40
+#define BOARD_NO_NATIVE_USB
41
+
42 42
 //
43 43
 // EEPROM
44 44
 //

+ 2
- 0
Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h 查看文件

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

+ 2
- 2
Marlin/src/pins/stm32f1/pins_FLY_MINI.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h 查看文件

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

+ 2
- 1
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_GTM32_MINI.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h 查看文件

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

+ 3
- 0
Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h 查看文件

@@ -31,6 +31,8 @@
31 31
 #define BOARD_INFO_NAME "Longer3D"
32 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 36
 //#define DISABLE_DEBUG                           //  We still want to debug with STLINK...
35 37
 #define DISABLE_JTAG                              //  We free the jtag pins (PA15) but keep STLINK
36 38
                                                   //  Release PB4 (STEP_X_PIN) from JTAG NRST role.

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h 查看文件

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

+ 2
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h 查看文件

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

+ 2
- 2
Marlin/src/pins/stm32f1/pins_STM3R_MINI.h 查看文件

@@ -21,8 +21,8 @@
21 21
  */
22 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 26
 #endif
27 27
 
28 28
 /**

+ 3
- 0
Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h 查看文件

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

+ 1
- 1
buildroot/tests/mks_robin_lite-tests 查看文件

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

+ 2
- 0
buildroot/tests/mks_robin_pro-tests 查看文件

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

Loading…
取消
儲存