Browse Source

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

EvilGremlin 2 years ago
parent
commit
2a1c2e26ed

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

@@ -66,7 +66,7 @@ jobs:
         #- mks_robin_maple
         - mks_robin_lite_maple
         - mks_robin_pro_maple
-        #- mks_robin_nano35_maple
+        #- mks_robin_nano_v1v2_maple
         #- STM32F103RE_creality_maple
         - STM32F103VE_ZM3E4V2_USB_maple
 
@@ -93,7 +93,9 @@ jobs:
         - rumba32
         - LERDGEX
         - LERDGEK
-        - mks_robin_nano35
+        - mks_robin_nano_v1v2
+        - mks_robin_nano_v1_2_usbmod
+        - mks_robin_nano_v1_3_f4_usbmod
         - NUCLEO_F767ZI
         - REMRAM_V1
         - BTT_SKR_SE_BX

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

@@ -512,9 +512,9 @@
 #elif MB(MKS_ROBIN_MINI)
   #include "stm32f1/pins_MKS_ROBIN_MINI.h"      // STM32F1                                env:mks_robin_mini env:mks_robin_mini_maple
 #elif MB(MKS_ROBIN_NANO)
-  #include "stm32f1/pins_MKS_ROBIN_NANO.h"      // STM32F1                                env:mks_robin_nano35 env:mks_robin_nano35_maple
+  #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
 #elif MB(MKS_ROBIN_NANO_V2)
-  #include "stm32f1/pins_MKS_ROBIN_NANO_V2.h"   // STM32F1                                env:mks_robin_nano35 env:mks_robin_nano35_maple
+  #include "stm32f1/pins_MKS_ROBIN_NANO_V2.h"   // STM32F1                                env:mks_robin_nano_v1v2 env:mks_robin_nano3_v1v2_maple
 #elif MB(MKS_ROBIN_LITE)
   #include "stm32f1/pins_MKS_ROBIN_LITE.h"      // STM32F1                                env:mks_robin_lite env:mks_robin_lite_maple
 #elif MB(MKS_ROBIN_LITE3)
@@ -694,7 +694,7 @@
 #elif MB(OPULO_LUMEN_REV3)
   #include "stm32f4/pins_OPULO_LUMEN_REV3.h"    // STM32F4                                env:Opulo_Lumen_REV3
 #elif MB(MKS_ROBIN_NANO_V1_3_F4)
-  #include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4                             env:mks_robin_nano_v1_3_f4
+  #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
 #elif MB(MKS_EAGLE)
   #include "stm32f4/pins_MKS_EAGLE.h"           // STM32F4                                env:mks_eagle
 #elif MB(ARTILLERY_RUBY)

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

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

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

@@ -29,7 +29,9 @@
   #error "MKS Robin nano boards support up to 2 hotends / E steppers."
 #endif
 
-#define BOARD_NO_NATIVE_USB
+#ifndef USB_MOD
+  #define BOARD_NO_NATIVE_USB
+#endif
 
 // Avoid conflict with TIMER_SERVO when using the STM32 HAL
 #define TEMP_TIMER  5
@@ -58,9 +60,14 @@
 // Limit Switches
 //
 #define X_STOP_PIN                          PA15
-#define Y_STOP_PIN                          PA12
-#define Z_MIN_PIN                           PA11
 #define Z_MAX_PIN                           PC4
+#ifndef USB_MOD
+  #define Y_STOP_PIN                        PA12
+  #define Z_MIN_PIN                         PA11
+#else
+  #define Y_STOP_PIN                        PB10
+  #define Z_MIN_PIN                         PB11
+#endif
 
 //
 // Steppers

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

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

+ 19 - 0
buildroot/tests/mks_robin_nano_v1_3_f4_usbmod

@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+#
+# Build tests for MKS Robin nano
+# (STM32F4 genericSTM32F407VE)
+#
+
+# exit on first failure
+set -e
+
+#
+# MKS/ZNP Robin nano v1.3 Emulated DOGM FSMC and native USB mod
+#
+use_example_configs Mks/Robin
+opt_add USB_MOD
+opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V1_3_F4 SERIAL_PORT -1
+exec_test $1 $2 "MKS/ZNP Robin nano v1.3 Emulated DOGM FSMC and native USB mod" "$3"
+
+# cleanup
+restore_configs

+ 0 - 0
buildroot/tests/mks_robin_nano35 → buildroot/tests/mks_robin_nano_v1v2


+ 0 - 0
buildroot/tests/mks_robin_nano35_maple → buildroot/tests/mks_robin_nano_v1v2_maple


+ 19 - 0
buildroot/tests/mks_robin_nano_v1v2_usbmod

@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+#
+# Build tests for MKS Robin nano
+# (STM32F1 genericSTM32F103VE)
+#
+
+# exit on first failure
+set -e
+
+#
+# MKS/ZNP Robin nano v1.2 Emulated DOGM FSMC and native USB mod
+#
+use_example_configs Mks/Robin
+opt_add USB_MOD
+opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO SERIAL_PORT -1
+exec_test $1 $2 "MKS/ZNP Robin nano v1.2 Emulated DOGM FSMC and native USB mod" "$3"
+
+# cleanup
+restore_configs

+ 8 - 0
ini/renamed.ini

@@ -56,3 +56,11 @@ extends = renamed
 [env:STM32F103VE_GTM32]
 # Renamed to STM32F103VE_GTM32_maple
 extends = renamed
+
+[env:mks_robin_nano_35]
+# Renamed to mks_robin_nano_v1v2
+extends = renamed
+
+[env:mks_robin_nano_35_maple]
+# Renamed to mks_robin_nano_v1v2_maple
+extends = renamed

Some files were not shown because too many files changed in this diff