From f3f3d202accf2c36e348c5e08fae82981d74c872 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 5 Jun 2021 01:49:00 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20STM32F103RE=5Fbtt(=5FUS?= =?UTF-8?q?B)=20with=20HAL/STM32=20(#22040)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/pins.h | 4 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 4 +- .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 4 +- .../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 4 +- .../src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 6 +-- ini/stm32f1-maple.ini | 12 +++--- ini/stm32f1.ini | 37 +++++++++++++++++++ 7 files changed, 51 insertions(+), 20 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index a1f45f577..4aec569ac 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -518,9 +518,9 @@ #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_512K env:STM32F103RC_btt_maple env:STM32F103RC_btt_512K_maple env:STM32F103RC_btt_USB_maple env:STM32F103RC_btt_512K_USB_maple #elif MB(BTT_SKR_E3_DIP) - #include "stm32f1/pins_BTT_SKR_E3_DIP.h" // STM32F1 env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RC_btt env:STM32F103RC_btt_512K + #include "stm32f1/pins_BTT_SKR_E3_DIP.h" // STM32F1 env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RE_btt_maple env:STM32F103RE_btt_USB_maple env:STM32F103RC_btt env:STM32F103RC_btt_512K #elif MB(BTT_SKR_CR6) - #include "stm32f1/pins_BTT_SKR_CR6.h" // STM32F1 env:STM32F103RE_btt env:STM32F103RE_btt_USB + #include "stm32f1/pins_BTT_SKR_CR6.h" // STM32F1 env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RE_btt_maple env:STM32F103RE_btt_USB_maple #elif MB(JGAURORA_A5S_A1) #include "stm32f1/pins_JGAURORA_A5S_A1.h" // STM32F1 env:jgaurora_a5s_a1 #elif MB(FYSETC_AIO_II) diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h index 50a533cde..35224ebdd 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -21,9 +21,7 @@ */ #pragma once -#if NOT_TARGET(TARGET_STM32F1) - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif +#include "env_validate.h" #define BOARD_INFO_NAME "BTT SKR E3 DIP V1.x" diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index 58adc5853..bb356485c 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -21,9 +21,7 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, STM32F1) - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif +#include "env_validate.h" // Release PB3/PB4 (E0 STP/DIR) from JTAG pins #define DISABLE_JTAG diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index 8668e1def..6b3d2832d 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -21,9 +21,7 @@ */ #pragma once -#if NOT_TARGET(TARGET_STM32F1) - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif +#include "env_validate.h" #define BOARD_INFO_NAME "BTT SKR Mini V1.1" diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index 43dfdece4..dc8b8c50f 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -21,9 +21,9 @@ */ #pragma once -#if NOT_TARGET(TARGET_STM32F1) - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#elif HOTENDS > 1 || E_STEPPERS > 1 +#include "env_validate.h" + +#if HOTENDS > 1 || E_STEPPERS > 1 #error "CCROBOT-ONLINE MEEB_3DP only supports one hotend / E-stepper. Comment out this line to continue." #endif diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index ec72e8983..4daf04263 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -157,10 +157,10 @@ upload_protocol = jlink # # BigTree SKR Mini E3 DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) # -# STM32F103RE_btt ............. RET6 -# STM32F103RE_btt_USB ......... RET6 (USB mass storage) +# STM32F103RE_btt_maple ............. RET6 +# STM32F103RE_btt_USB_maple ......... RET6 (USB mass storage) # -[env:STM32F103RE_btt] +[env:STM32F103RE_btt_maple] platform = ${common_stm32f1.platform} extends = env:STM32F103RE_maple board_build.address = 0x08007000 @@ -171,10 +171,10 @@ build_flags = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 debug_tool = stlink upload_protocol = stlink -[env:STM32F103RE_btt_USB] +[env:STM32F103RE_btt_USB_maple] platform = ${common_stm32f1.platform} -extends = env:STM32F103RE_btt -build_flags = ${env:STM32F103RE_btt.build_flags} -DUSE_USB_COMPOSITE +extends = env:STM32F103RE_btt_maple +build_flags = ${env:STM32F103RE_btt_maple.build_flags} -DUSE_USB_COMPOSITE lib_deps = ${common_stm32f1.lib_deps} USBComposite for STM32F1@0.91 diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index bbd203847..2e197ccb4 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -184,6 +184,43 @@ extra_scripts = ${common.extra_scripts} debug_tool = jlink upload_protocol = jlink +# +# BigTree SKR Mini E3 DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) +# +# STM32F103RE_btt ............. RET6 +# STM32F103RE_btt_USB ......... RET6 (USB mass storage) +# +[env:STM32F103RE_btt] +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 +board = genericSTM32F103RE +monitor_speed = 115200 +board_build.core = stm32 +board_build.variant = MARLIN_F103Rx +board_build.offset = 0x7000 +board_build.ldscript = ldscript.ld +board_upload.offset_address = 0x08007000 +build_unflags = ${common_stm32.build_unflags} +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + buildroot/share/PlatformIO/scripts/stm32_bootloader.py +debug_tool = jlink +upload_protocol = jlink + +[env:STM32F103RE_btt_USB] +extends = env:STM32F103RE_btt +platform = ${common_stm32.platform} +platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc-cdc-msc-2.zip +build_unflags = ${common_stm32.build_unflags} -DUSBD_USE_CDC +build_flags = ${env:STM32F103RE_btt.build_flags} ${env:stm32_flash_drive.build_flags} + -DUSBCON + -DUSE_USBHOST_HS + -DUSBD_IRQ_PRIO=5 + -DUSBD_IRQ_SUBPRIO=6 + -DUSE_USB_HS_IN_FS + -DUSBD_USE_CDC_MSC + # # FLSUN QQS Pro (STM32F103VET6) # board Hispeedv1