From 5038e591eb7b6268dc10de56c17944d5bba96303 Mon Sep 17 00:00:00 2001 From: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 8 Jun 2023 18:21:33 -0700 Subject: [PATCH 1/2] Add SKR Mini E3 V3.0.1 _xfer Environment Similar to SKR Mini E3 V3's _xfer environment. --- Marlin/src/pins/pins.h | 2 +- ini/stm32f4.ini | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index d4ec9f22c0c1..e15aeb5c4b9c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -613,7 +613,7 @@ #elif MB(BTT_MANTA_M8P_V1_1) #include "stm32g0/pins_BTT_MANTA_M8P_V1_1.h" // STM32G0 env:STM32G0B1VE_btt env:STM32G0B1VE_btt_xfer #elif MB(BTT_SKR_MINI_E3_V3_0_1) - #include "stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h"// STM32F4 env:STM32F401RC_btt + #include "stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h"// STM32F4 env:STM32F401RC_btt env:STM32F401RC_btt_xfer #elif MB(BTT_SKR_MINI_MZ_V1_0) #include "stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple #elif MB(BTT_SKR_E3_DIP) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 67c2c6033cb0..3cd415776c64 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -743,6 +743,20 @@ build_flags = ${stm32_variant.build_flags} upload_protocol = stlink debug_tool = stlink +# +# BigTreeTech SKR Mini E3 V3.0.1 (STM32F401RCT6 ARM Cortex-M0+) +# Custom upload to SD via Marlin with Binary Protocol +# Requires Marlin with BINARY_FILE_TRANSFER already installed on the target board. +# If CUSTOM_FIRMWARE_UPLOAD is also installed, Marlin will reboot the board to install the firmware. +# Currently CUSTOM_FIRMWARE_UPLOAD must also be enabled to use 'xfer' build envs. +# +[env:STM32F401RC_btt_xfer] +extends = env:STM32F401RC_btt +build_flags = ${env:STM32F401RC_btt.build_flags} -DXFER_BUILD +extra_scripts = ${env:STM32F401RC_btt.extra_scripts} + pre:buildroot/share/scripts/upload.py +upload_protocol = custom + # # MKS SKIPR v1.0 all-in-one board (STM32F407VE) # From 8bb92a7f9f03171e7e4b8ed556c86b60fd1ccb65 Mon Sep 17 00:00:00 2001 From: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 10 Jun 2023 11:34:13 -0700 Subject: [PATCH 2/2] SDSUPPORT (HAS_MEDIA) is also required for XFER_BUILDs SDSUPPORT = HAS_MEDIA, but users shouldn't define HAS_MEDIA directly, so check that SDSUPPORT is enabled. --- Marlin/src/inc/SanityCheck.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 00b532120518..f4d1ff836596 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3988,8 +3988,8 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #endif // Check requirements for upload.py -#if ENABLED(XFER_BUILD) && !ALL(BINARY_FILE_TRANSFER, CUSTOM_FIRMWARE_UPLOAD) - #error "BINARY_FILE_TRANSFER and CUSTOM_FIRMWARE_UPLOAD are required for custom upload." +#if ENABLED(XFER_BUILD) && !ALL(SDSUPPORT, BINARY_FILE_TRANSFER, CUSTOM_FIRMWARE_UPLOAD) + #error "SDSUPPORT, BINARY_FILE_TRANSFER, and CUSTOM_FIRMWARE_UPLOAD are required for custom upload." #endif /**