Browse Source

✨ Robin Nano v1 CDC (USB mod) (#24619)

EvilGremlin 1 year ago
parent
commit
2a1c2e26ed
No account linked to committer's email address

+ 4
- 2
.github/workflows/test-builds.yml View File

@@ -66,7 +66,7 @@ jobs:
66 66
         #- mks_robin_maple
67 67
         - mks_robin_lite_maple
68 68
         - mks_robin_pro_maple
69
-        #- mks_robin_nano35_maple
69
+        #- mks_robin_nano_v1v2_maple
70 70
         #- STM32F103RE_creality_maple
71 71
         - STM32F103VE_ZM3E4V2_USB_maple
72 72
 
@@ -93,7 +93,9 @@ jobs:
93 93
         - rumba32
94 94
         - LERDGEX
95 95
         - LERDGEK
96
-        - mks_robin_nano35
96
+        - mks_robin_nano_v1v2
97
+        - mks_robin_nano_v1_2_usbmod
98
+        - mks_robin_nano_v1_3_f4_usbmod
97 99
         - NUCLEO_F767ZI
98 100
         - REMRAM_V1
99 101
         - BTT_SKR_SE_BX

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

@@ -512,9 +512,9 @@
512 512
 #elif MB(MKS_ROBIN_MINI)
513 513
   #include "stm32f1/pins_MKS_ROBIN_MINI.h"      // STM32F1                                env:mks_robin_mini env:mks_robin_mini_maple
514 514
 #elif MB(MKS_ROBIN_NANO)
515
-  #include "stm32f1/pins_MKS_ROBIN_NANO.h"      // STM32F1                                env:mks_robin_nano35 env:mks_robin_nano35_maple
515
+  #include "stm32f1/pins_MKS_ROBIN_NANO.h"      // STM32F1                                env:mks_robin_nano_v1v2 env:mks_robin_nano_v1v2_maple env:mks_robin_nano_v1_2_usbmod
516 516
 #elif MB(MKS_ROBIN_NANO_V2)
517
-  #include "stm32f1/pins_MKS_ROBIN_NANO_V2.h"   // STM32F1                                env:mks_robin_nano35 env:mks_robin_nano35_maple
517
+  #include "stm32f1/pins_MKS_ROBIN_NANO_V2.h"   // STM32F1                                env:mks_robin_nano_v1v2 env:mks_robin_nano3_v1v2_maple
518 518
 #elif MB(MKS_ROBIN_LITE)
519 519
   #include "stm32f1/pins_MKS_ROBIN_LITE.h"      // STM32F1                                env:mks_robin_lite env:mks_robin_lite_maple
520 520
 #elif MB(MKS_ROBIN_LITE3)
@@ -694,7 +694,7 @@
694 694
 #elif MB(OPULO_LUMEN_REV3)
695 695
   #include "stm32f4/pins_OPULO_LUMEN_REV3.h"    // STM32F4                                env:Opulo_Lumen_REV3
696 696
 #elif MB(MKS_ROBIN_NANO_V1_3_F4)
697
-  #include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4                             env:mks_robin_nano_v1_3_f4
697
+  #include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4                             env:mks_robin_nano_v1_3_f4 env:mks_robin_nano_v1_3_f4_usbmod
698 698
 #elif MB(MKS_EAGLE)
699 699
   #include "stm32f4/pins_MKS_EAGLE.h"           // STM32F4                                env:mks_eagle
700 700
 #elif MB(ARTILLERY_RUBY)

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

@@ -35,7 +35,9 @@
35 35
 
36 36
 #define BOARD_INFO_NAME "MKS Robin nano V2.0"
37 37
 
38
-#define BOARD_NO_NATIVE_USB
38
+#ifndef USB_MOD
39
+  #define BOARD_NO_NATIVE_USB
40
+#endif
39 41
 #define USES_DIAG_PINS
40 42
 
41 43
 // Avoid conflict with TIMER_SERVO when using the STM32 HAL

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

@@ -29,7 +29,9 @@
29 29
   #error "MKS Robin nano boards support up to 2 hotends / E steppers."
30 30
 #endif
31 31
 
32
-#define BOARD_NO_NATIVE_USB
32
+#ifndef USB_MOD
33
+  #define BOARD_NO_NATIVE_USB
34
+#endif
33 35
 
34 36
 // Avoid conflict with TIMER_SERVO when using the STM32 HAL
35 37
 #define TEMP_TIMER  5
@@ -58,9 +60,14 @@
58 60
 // Limit Switches
59 61
 //
60 62
 #define X_STOP_PIN                          PA15
61
-#define Y_STOP_PIN                          PA12
62
-#define Z_MIN_PIN                           PA11
63 63
 #define Z_MAX_PIN                           PC4
64
+#ifndef USB_MOD
65
+  #define Y_STOP_PIN                        PA12
66
+  #define Z_MIN_PIN                         PA11
67
+#else
68
+  #define Y_STOP_PIN                        PB10
69
+  #define Z_MIN_PIN                         PB11
70
+#endif
64 71
 
65 72
 //
66 73
 // Steppers

+ 6
- 1
buildroot/share/PlatformIO/scripts/offset_and_rename.py View File

@@ -53,8 +53,13 @@ if pioutil.is_pio_build():
53 53
     #
54 54
     if 'rename' in board_keys:
55 55
 
56
+        # If FIRMWARE_BIN is defined by config, override all
57
+        mf = env["MARLIN_FEATURES"]
58
+        if "FIRMWARE_BIN" in mf: new_name = mf["FIRMWARE_BIN"]
59
+        else: new_name = board.get("build.rename")
60
+
56 61
         def rename_target(source, target, env):
57 62
             from pathlib import Path
58
-            Path(target[0].path).replace(Path(target[0].dir.path, board.get("build.rename")))
63
+            Path(target[0].path).replace(Path(target[0].dir.path, new_name))
59 64
 
60 65
         marlin.add_post_action(rename_target)

+ 19
- 0
buildroot/tests/mks_robin_nano_v1_3_f4_usbmod View File

@@ -0,0 +1,19 @@
1
+#!/usr/bin/env bash
2
+#
3
+# Build tests for MKS Robin nano
4
+# (STM32F4 genericSTM32F407VE)
5
+#
6
+
7
+# exit on first failure
8
+set -e
9
+
10
+#
11
+# MKS/ZNP Robin nano v1.3 Emulated DOGM FSMC and native USB mod
12
+#
13
+use_example_configs Mks/Robin
14
+opt_add USB_MOD
15
+opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V1_3_F4 SERIAL_PORT -1
16
+exec_test $1 $2 "MKS/ZNP Robin nano v1.3 Emulated DOGM FSMC and native USB mod" "$3"
17
+
18
+# cleanup
19
+restore_configs

buildroot/tests/mks_robin_nano35 → buildroot/tests/mks_robin_nano_v1v2 View File


buildroot/tests/mks_robin_nano35_maple → buildroot/tests/mks_robin_nano_v1v2_maple View File


+ 19
- 0
buildroot/tests/mks_robin_nano_v1v2_usbmod View File

@@ -0,0 +1,19 @@
1
+#!/usr/bin/env bash
2
+#
3
+# Build tests for MKS Robin nano
4
+# (STM32F1 genericSTM32F103VE)
5
+#
6
+
7
+# exit on first failure
8
+set -e
9
+
10
+#
11
+# MKS/ZNP Robin nano v1.2 Emulated DOGM FSMC and native USB mod
12
+#
13
+use_example_configs Mks/Robin
14
+opt_add USB_MOD
15
+opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO SERIAL_PORT -1
16
+exec_test $1 $2 "MKS/ZNP Robin nano v1.2 Emulated DOGM FSMC and native USB mod" "$3"
17
+
18
+# cleanup
19
+restore_configs

+ 8
- 0
ini/renamed.ini View File

@@ -56,3 +56,11 @@ extends = renamed
56 56
 [env:STM32F103VE_GTM32]
57 57
 # Renamed to STM32F103VE_GTM32_maple
58 58
 extends = renamed
59
+
60
+[env:mks_robin_nano_35]
61
+# Renamed to mks_robin_nano_v1v2
62
+extends = renamed
63
+
64
+[env:mks_robin_nano_35_maple]
65
+# Renamed to mks_robin_nano_v1v2_maple
66
+extends = renamed

+ 2
- 4
ini/stm32f1-maple.ini View File

@@ -203,17 +203,15 @@ board_build.ldscript = mks_robin_mini.ld
203 203
 build_flags          = ${STM32F1_maple.build_flags} -DMCU_STM32F103VE
204 204
 
205 205
 #
206
-# MKS Robin Nano (STM32F103VET6)
206
+# MKS Robin Nano v1.x and v2 (STM32F103VET6)
207 207
 #
208
-[env:mks_robin_nano35_maple]
208
+[env:mks_robin_nano_v1v2_maple]
209 209
 extends              = STM32F1_maple
210 210
 board                = genericSTM32F103VE
211 211
 board_build.address  = 0x08007000
212 212
 board_build.rename   = Robin_nano35.bin
213 213
 board_build.ldscript = mks_robin_nano.ld
214 214
 build_flags          = ${STM32F1_maple.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4
215
-debug_tool           = jlink
216
-upload_protocol      = jlink
217 215
 
218 216
 #
219 217
 # MKS Robin (STM32F103ZET6)

+ 18
- 6
ini/stm32f1.ini View File

@@ -216,23 +216,35 @@ build_flags                 = ${stm32_variant.build_flags}
216 216
 build_unflags               = ${stm32_variant.build_unflags}
217 217
                               -DUSBCON -DUSBD_USE_CDC
218 218
 
219
-#
220
-# MKS Robin Nano V1.2 and V2
221
-#
222
-[env:mks_robin_nano35]
219
+[mks_robin_nano_v1v2_common]
223 220
 extends                     = stm32_variant
224 221
 board                       = genericSTM32F103VE
225 222
 board_build.variant         = MARLIN_F103Vx
226 223
 board_build.encrypt_mks     = Robin_nano35.bin
227 224
 board_build.offset          = 0x7000
228 225
 board_upload.offset_address = 0x08007000
226
+debug_tool                  = stlink
227
+upload_protocol             = stlink
228
+
229
+#
230
+# MKS Robin Nano V1.2 and V2
231
+#
232
+[env:mks_robin_nano_v1v2]
233
+extends                     = mks_robin_nano_v1v2_common
229 234
 build_flags                 = ${stm32_variant.build_flags}
230 235
                               -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3
231 236
                               -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
232 237
 build_unflags               = ${stm32_variant.build_unflags}
233 238
                               -DUSBCON -DUSBD_USE_CDC
234
-debug_tool                  = jlink
235
-upload_protocol             = jlink
239
+
240
+#
241
+# MKS/ZNP Robin Nano v1.2 with native USB modification
242
+#
243
+[env:mks_robin_nano_v1_2_usbmod]
244
+extends                     = mks_robin_nano_v1v2_common
245
+build_flags                 = ${common_stm32.build_flags}
246
+                              -DMCU_STM32F103VE -DSS_TIMER=4
247
+                              -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
236 248
 
237 249
 #
238 250
 # Mingda MPX_ARM_MINI

+ 35
- 23
ini/stm32f4.ini View File

@@ -570,42 +570,54 @@ board_upload.offset_address = 0x0800C000
570 570
 extra_scripts               = ${stm32_variant.extra_scripts}
571 571
                               buildroot/share/PlatformIO/scripts/openblt.py
572 572
 
573
-#
574
-# BOARD_MKS_ROBIN_NANO_V1_3_F4
575
-#  - MKS Robin Nano   V1.3 (STM32F407VET6) 5 Pololu Plug
576
-#  - MKS Robin Nano-S V1.3 (STM32F407VET6) 4 TMC2225 + 1 Pololu Plug
577
-#
578
-[env:mks_robin_nano_v1_3_f4]
573
+[mks_robin_nano_v1_3_f4_common]
579 574
 extends                     = stm32_variant
580 575
 board                       = marlin_STM32F407VGT6_CCM
581 576
 board_build.variant         = MARLIN_F4x7Vx
582 577
 board_build.offset          = 0x8000
583 578
 board_upload.offset_address = 0x08008000
584 579
 board_build.rename          = Robin_nano35.bin
585
-build_flags                 = ${stm32_variant.build_flags}
586
-                              -DMCU_STM32F407VE -DSS_TIMER=4 -DENABLE_HWSERIAL3
587
-                              -DSTM32_FLASH_SIZE=512
588
-                              -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
589
-                              -DHAL_SD_MODULE_ENABLED
590
-                              -DHAL_SRAM_MODULE_ENABLED
591
-build_unflags               = ${stm32_variant.build_unflags}
592
-                              -DUSBCON -DUSBD_USE_CDC
593 580
 debug_tool                  = jlink
594 581
 upload_protocol             = jlink
595 582
 
596 583
 #
584
+# BOARD_MKS_ROBIN_NANO_V1_3_F4
585
+#  - MKS Robin Nano   V1.3 (STM32F407VET6, 5 Pololu Plug)
586
+#  - MKS Robin Nano-S V1.3 (STM32F407VET6, 4 TMC2225, 1 Pololu Plug)
587
+#  - ZNP Robin Nano   V1.3 (STM32F407VET6, 2 TMC2208, 2 A4988, 1x Polulu plug)
588
+#
589
+[env:mks_robin_nano_v1_3_f4]
590
+extends       = mks_robin_nano_v1_3_f4_common
591
+build_flags   = ${stm32_variant.build_flags}
592
+                -DMCU_STM32F407VE -DENABLE_HWSERIAL3 -DSTM32_FLASH_SIZE=512
593
+                -DTIMER_SERVO=TIM2 -DTIMER_TONE=TIM3 -DSS_TIMER=4
594
+                -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED
595
+build_unflags = ${stm32_variant.build_unflags}
596
+                -DUSBCON -DUSBD_USE_CDC
597
+
598
+#
599
+#  MKS/ZNP Robin Nano V1.3 with native USB mod
600
+#
601
+[env:mks_robin_nano_v1_3_f4_usbmod]
602
+extends       = mks_robin_nano_v1_3_f4_common
603
+build_flags   = ${stm32_variant.build_flags}
604
+                -DMCU_STM32F407VE -DSTM32_FLASH_SIZE=512
605
+                -DTIMER_SERVO=TIM2 -DTIMER_TONE=TIM3 -DSS_TIMER=4
606
+                -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED
607
+
608
+#
597 609
 # Artillery Ruby
598 610
 #
599 611
 [env:Artillery_Ruby]
600
-extends           = common_stm32
601
-board             = marlin_Artillery_Ruby
602
-build_flags       = ${common_stm32.build_flags}
603
-                    -DSTM32F401xC -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32
604
-                    -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
605
-                    -DUSB_PRODUCT=\"Artillery_3D_Printer\"
606
-                    -DFLASH_DATA_SECTOR=1U -DFLASH_BASE_ADDRESS=0x08004000
607
-extra_scripts     = ${common_stm32.extra_scripts}
608
-                    pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
612
+extends       = common_stm32
613
+board         = marlin_Artillery_Ruby
614
+build_flags   = ${common_stm32.build_flags}
615
+                -DSTM32F401xC -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32
616
+                -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
617
+                -DUSB_PRODUCT=\"Artillery_3D_Printer\"
618
+                -DFLASH_DATA_SECTOR=1U -DFLASH_BASE_ADDRESS=0x08004000
619
+extra_scripts = ${common_stm32.extra_scripts}
620
+                pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
609 621
 
610 622
 #
611 623
 # Ender-3 S1 STM32F401RC_creality

Loading…
Cancel
Save