Skip to content

Commit

Permalink
🔨 More HAL/STM32 targets (#22358, #22369)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and thinkyhead committed Jul 21, 2021
1 parent 8283f15 commit b6cb56f
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 30 deletions.
26 changes: 13 additions & 13 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,17 +486,17 @@
#elif MB(MKS_ROBIN)
#include "stm32f1/pins_MKS_ROBIN.h" // STM32F1 env:mks_robin env:mks_robin_maple
#elif MB(MKS_ROBIN_MINI)
#include "stm32f1/pins_MKS_ROBIN_MINI.h" // STM32F1 env: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
#elif MB(MKS_ROBIN_NANO_V2)
#include "stm32f1/pins_MKS_ROBIN_NANO_V2.h" // STM32F1 env:mks_robin_nano35 env:mks_robin_nano35_maple
#elif MB(MKS_ROBIN_LITE)
#include "stm32f1/pins_MKS_ROBIN_LITE.h" // STM32F1 env: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)
#include "stm32f1/pins_MKS_ROBIN_LITE3.h" // STM32F1 env:mks_robin_lite3
#include "stm32f1/pins_MKS_ROBIN_LITE3.h" // STM32F1 env:mks_robin_lite3 env:mks_robin_lite3_maple
#elif MB(MKS_ROBIN_PRO)
#include "stm32f1/pins_MKS_ROBIN_PRO.h" // STM32F1 env:mks_robin_pro
#include "stm32f1/pins_MKS_ROBIN_PRO.h" // STM32F1 env:mks_robin_pro env:mks_robin_pro_maple
#elif MB(MKS_ROBIN_E3)
#include "stm32f1/pins_MKS_ROBIN_E3.h" // STM32F1 env:mks_robin_e3 env:mks_robin_e3_maple
#elif MB(MKS_ROBIN_E3_V1_1)
Expand All @@ -506,7 +506,7 @@
#elif MB(MKS_ROBIN_E3D_V1_1)
#include "stm32f1/pins_MKS_ROBIN_E3D_V1_1.h" // STM32F1 env:mks_robin_e3
#elif MB(MKS_ROBIN_E3P)
#include "stm32f1/pins_MKS_ROBIN_E3P.h" // STM32F1 env:mks_robin_e3p
#include "stm32f1/pins_MKS_ROBIN_E3P.h" // STM32F1 env:mks_robin_e3p env:mks_robin_e3p_maple
#elif MB(BTT_SKR_MINI_V1_1)
#include "stm32f1/pins_BTT_SKR_MINI_V1_1.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple
#elif MB(BTT_SKR_MINI_E3_V1_0)
Expand All @@ -522,21 +522,21 @@
#elif MB(BTT_SKR_CR6)
#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
#include "stm32f1/pins_JGAURORA_A5S_A1.h" // STM32F1 env:jgaurora_a5s_a1 env:jgaurora_a5s_a1_maple
#elif MB(FYSETC_AIO_II)
#include "stm32f1/pins_FYSETC_AIO_II.h" // STM32F1 env:STM32F103RC_fysetc
#include "stm32f1/pins_FYSETC_AIO_II.h" // STM32F1 env:STM32F103RC_fysetc env:STM32F103RC_fysetc_maple
#elif MB(FYSETC_CHEETAH)
#include "stm32f1/pins_FYSETC_CHEETAH.h" // STM32F1 env:STM32F103RC_fysetc
#include "stm32f1/pins_FYSETC_CHEETAH.h" // STM32F1 env:STM32F103RC_fysetc env:STM32F103RC_fysetc_maple
#elif MB(FYSETC_CHEETAH_V12)
#include "stm32f1/pins_FYSETC_CHEETAH_V12.h" // STM32F1 env:STM32F103RC_fysetc
#include "stm32f1/pins_FYSETC_CHEETAH_V12.h" // STM32F1 env:STM32F103RC_fysetc env:STM32F103RC_fysetc_maple
#elif MB(LONGER3D_LK)
#include "stm32f1/pins_LONGER3D_LK.h" // STM32F1 env:STM32F103VE_longer
#include "stm32f1/pins_LONGER3D_LK.h" // STM32F1 env:STM32F103VE_longer env:STM32F103VE_longer_maple
#elif MB(CCROBOT_MEEB_3DP)
#include "stm32f1/pins_CCROBOT_MEEB_3DP.h" // STM32F1 env:STM32F103RC_meeb
#elif MB(CHITU3D_V5)
#include "stm32f1/pins_CHITU3D_V5.h" // STM32F1 env:chitu_f103 env:chitu_v5_gpio_init
#include "stm32f1/pins_CHITU3D_V5.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple env:chitu_v5_gpio_init env:chitu_v5_gpio_init_maple
#elif MB(CHITU3D_V6)
#include "stm32f1/pins_CHITU3D_V6.h" // STM32F1 env:chitu_f103
#include "stm32f1/pins_CHITU3D_V6.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple
#elif MB(CREALITY_V4)
#include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple
#elif MB(CREALITY_V4210)
Expand All @@ -550,7 +550,7 @@
#elif MB(CREALITY_V453)
#include "stm32f1/pins_CREALITY_V453.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple
#elif MB(TRIGORILLA_PRO)
#include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro
#include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro env:trigorilla_pro_maple
#elif MB(FLY_MINI)
#include "stm32f1/pins_FLY_MINI.h" // STM32F1 env:FLY_MINI env:FLY_MINI_maple
#elif MB(FLSUN_HISPEED)
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
#define FSMC_DMA_DEV DMA2
#define FSMC_DMA_CHANNEL DMA_CH5

#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN
#endif

#if ENABLED(TFT_LVGL_UI)
Expand Down
8 changes: 6 additions & 2 deletions buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ extern "C" {

// Timer Definitions (optional)
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
#define TIMER_TONE TIM3
#define TIMER_SERVO TIM2
#ifndef TIMER_TONE
#define TIMER_TONE TIM6
#endif
#ifndef TIMER_SERVO
#define TIMER_SERVO TIM7
#endif

// UART Definitions
// Define here Serial instance number to map on Serial generic name
Expand Down
26 changes: 13 additions & 13 deletions ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ upload_protocol = dfu
#
# FYSETC STM32F103RC
#
[env:STM32F103RC_fysetc]
[env:STM32F103RC_fysetc_maple]
platform = ${common_stm32f1.platform}
extends = common_STM32F103RC_maple
extra_scripts = ${common_stm32f1.extra_scripts}
Expand Down Expand Up @@ -173,7 +173,7 @@ upload_protocol = serial
#
# Longer 3D board in Alfawise U20 (STM32F103VET6)
#
[env:STM32F103VE_longer]
[env:STM32F103VE_longer_maple]
platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = genericSTM32F103VE
Expand All @@ -190,7 +190,7 @@ build_unflags = ${common_stm32f1.build_unflags}
#
# MKS Robin Mini (STM32F103VET6)
#
[env:mks_robin_mini]
[env:mks_robin_mini_maple]
platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = genericSTM32F103VE
Expand Down Expand Up @@ -228,7 +228,7 @@ build_flags = ${common_stm32f1.build_flags}
#
# MKS Robin Pro (STM32F103ZET6)
#
[env:mks_robin_pro]
[env:mks_robin_pro_maple]
platform = ${common_stm32f1.platform}
extends = env:mks_robin_maple
extra_scripts = ${common_stm32f1.extra_scripts}
Expand All @@ -237,7 +237,7 @@ extra_scripts = ${common_stm32f1.extra_scripts}
#
# TRIGORILLA PRO (STM32F103ZET6)
#
[env:trigorilla_pro]
[env:trigorilla_pro_maple]
platform = ${common_stm32f1.platform}
extends = env:mks_robin_maple
extra_scripts = ${common_stm32f1.extra_scripts}
Expand All @@ -259,7 +259,7 @@ build_flags = ${common_stm32f1.build_flags}
# MKS Robin E3p (STM32F103VET6)
# - LVGL UI
#
[env:mks_robin_e3p]
[env:mks_robin_e3p_maple]
platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = genericSTM32F103VE
Expand All @@ -273,7 +273,7 @@ upload_protocol = jlink
#
# MKS Robin Lite/Lite2 (STM32F103RCT6)
#
[env:mks_robin_lite]
[env:mks_robin_lite_maple]
platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = genericSTM32F103RC
Expand All @@ -283,7 +283,7 @@ extra_scripts = ${common_stm32f1.extra_scripts}
#
# MKS ROBIN LITE3 (STM32F103RCT6)
#
[env:mks_robin_lite3]
[env:mks_robin_lite3_maple]
platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = genericSTM32F103RC
Expand All @@ -293,7 +293,7 @@ extra_scripts = ${common_stm32f1.extra_scripts}
#
# JGAurora A5S A1 (STM32F103ZET6)
#
[env:jgaurora_a5s_a1]
[env:jgaurora_a5s_a1_maple]
platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = genericSTM32F103ZE
Expand Down Expand Up @@ -321,7 +321,7 @@ lib_ignore = ${common_stm32f1.lib_ignore}
#
# Chitu boards like Tronxy X5s (STM32F103ZET6)
#
[env:chitu_f103]
[env:chitu_f103_maple]
platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = marlin_CHITU_F103
Expand All @@ -338,10 +338,10 @@ build_unflags = ${common_stm32f1.build_unflags}
# Some Chitu V5 boards have a problem with GPIO init.
# Use this target if G28 or G29 are always failing.
#
[env:chitu_v5_gpio_init]
[env:chitu_v5_gpio_init_maple]
platform = ${common_stm32f1.platform}
extends = env:chitu_f103
build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX
extends = env:chitu_f103_maple
build_flags = ${env:chitu_f103_maple.build_flags} -DCHITU_V5_Z_MIN_BUGFIX

#
# FLYmaker FLY Mini (STM32F103RCT6)
Expand Down
152 changes: 150 additions & 2 deletions ini/stm32f1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ build_flags = ${env:STM32F103RE_btt.build_flags} ${env:stm32_flash_drive.b
[env:flsun_hispeedv1]
platform = ${common_stm32.platform}
extends = common_stm32
build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3
build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
board = genericSTM32F103VE
board_build.core = stm32
board_build.variant = MARLIN_F103Vx
Expand All @@ -209,7 +209,7 @@ extra_scripts = ${stm32f1_variant.extra_scripts}
[env:mks_robin_nano35]
platform = ${common_stm32.platform}
extends = common_stm32
build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3
build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
board = genericSTM32F103VE
board_build.core = stm32
board_build.variant = MARLIN_F103Vx
Expand Down Expand Up @@ -259,3 +259,151 @@ board_build.variant = MARLIN_F103Rx
board_build.offset = 0x5000
board_upload.offset_address = 0x08005000
extra_scripts = ${stm32f1_variant.extra_scripts}

#
# MKS Robin Mini (STM32F103VET6)
#
[env:mks_robin_mini]
platform = ${common_stm32.platform}
extends = common_stm32
board = genericSTM32F103VE
board_build.core = stm32
board_build.variant = MARLIN_F103Vx
board_build.offset = 0x7000
board_build.encrypt = Robin_mini.bin
build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
board_upload.offset_address = 0x08007000
extra_scripts = ${stm32f1_variant.extra_scripts}

#
# MKS Robin Lite/Lite2 (STM32F103RCT6)
#
[env:mks_robin_lite]
platform = ${common_stm32.platform}
extends = common_stm32
board = genericSTM32F103RC
board_build.core = stm32
board_build.variant = MARLIN_F103Rx
board_build.offset = 0x5000
board_build.encrypt = mksLite.bin
build_flags = ${common_stm32.build_flags}
board_upload.offset_address = 0x08005000
extra_scripts = ${stm32f1_variant.extra_scripts}

#
# MKS ROBIN LITE3 (STM32F103RCT6)
#
[env:mks_robin_lite3]
platform = ${common_stm32.platform}
extends = common_stm32
board = genericSTM32F103RC
board_build.core = stm32
board_build.variant = MARLIN_F103Rx
board_build.offset = 0x5000
board_build.encrypt = mksLite3.bin
build_flags = ${common_stm32.build_flags}
board_upload.offset_address = 0x08005000
extra_scripts = ${stm32f1_variant.extra_scripts}

#
# MKS Robin Pro (STM32F103ZET6)
#
[env:mks_robin_pro]
platform = ${common_stm32.platform}
extends = env:mks_robin
board_build.encrypt = Robin_pro.bin

#
# MKS Robin E3p (STM32F103VET6)
# - LVGL UI
#
[env:mks_robin_e3p]
platform = ${common_stm32.platform}
extends = common_stm32
board = genericSTM32F103VE
board_build.core = stm32
board_build.variant = MARLIN_F103Vx
board_build.offset = 0x7000
board_build.encrypt = Robin_e3p.bin
build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
board_upload.offset_address = 0x08007000
extra_scripts = ${stm32f1_variant.extra_scripts}
debug_tool = jlink
upload_protocol = jlink

#
# JGAurora A5S A1 (STM32F103ZET6)
#
[env:jgaurora_a5s_a1]
platform = ${common_stm32.platform}
extends = common_stm32
board = genericSTM32F103ZE
board_build.core = stm32
board_build.variant = MARLIN_F103Zx
board_build.offset = 0xA000
board_build.rename = firmware_for_sd_upload.bin
build_flags = ${common_stm32.build_flags} -DSTM32F1xx -DSTM32_XL_DENSITY
board_build.address = 0x0800A000
extra_scripts = ${stm32f1_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py

#
# FYSETC STM32F103RC
#
[env:STM32F103RC_fysetc]
platform = ${common_stm32.platform}
extends = common_STM32F103RC
extra_scripts = ${stm32f1_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
build_flags = ${common_stm32.build_flags} -DDEBUG_LEVEL=0
lib_ldf_mode = chain
debug_tool = stlink
upload_protocol = serial

#
# Longer 3D board in Alfawise U20 (STM32F103VET6)
#
[env:STM32F103VE_longer]
platform = ${common_stm32.platform}
extends = common_stm32
board = genericSTM32F103VE
board_build.core = stm32
board_build.variant = MARLIN_F103Vx
board_build.offset = 0x1000
board_build.address = 0x08010000
build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DU20 -DTS_V12
build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
extra_scripts = ${stm32f1_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py

#
# TRIGORILLA PRO (STM32F103ZET6)
#
[env:trigorilla_pro]
platform = ${common_stm32.platform}
extends = env:mks_robin
extra_scripts = ${common_stm32.extra_scripts}

#
# Chitu boards like Tronxy X5s (STM32F103ZET6)
#
[env:chitu_f103]
platform = ${common_stm32.platform}
extends = common_stm32
board = genericSTM32F103ZE
board_build.core = stm32
board_build.variant = MARLIN_F103Zx
extra_scripts = ${stm32f1_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/chitu_crypt.py
build_flags = ${common_stm32.build_flags} -DSTM32_XL_DENSITY
build_unflags = ${common_stm32.build_unflags}
-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG= -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6

#
# Some Chitu V5 boards have a problem with GPIO init.
# Use this target if G28 or G29 are always failing.
#
[env:chitu_v5_gpio_init]
platform = ${common_stm32.platform}
extends = env:chitu_f103
build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX

0 comments on commit b6cb56f

Please sign in to comment.