From 30d98396317c3c39a89aa85e63ac8c2433198e76 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 22 Dec 2020 04:02:25 -0800 Subject: [PATCH] Overrides to prevent STM32 timer conflicts (#20545) --- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 3 +++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 3 +++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 3 +++ Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 4 ++++ Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 3 +++ Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 3 +++ platformio.ini | 2 +- 7 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 93403b9ddd..e980d884a7 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -40,6 +40,9 @@ #define BOARD_NO_NATIVE_USB +// Avoid conflict with TIMER_SERVO when using the STM32 HAL +#define TEMP_TIMER 5 + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 4b644d693b..c430671b2e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -36,6 +36,9 @@ #define BOARD_NO_NATIVE_USB +// Avoid conflict with TIMER_SERVO when using the STM32 HAL +#define TEMP_TIMER 5 + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 1816d6bd41..063e548a32 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -37,6 +37,9 @@ #define BOARD_NO_NATIVE_USB +// Avoid conflict with TIMER_SERVO when using the STM32 HAL +#define TEMP_TIMER 5 + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 808751d7a5..933ee532a9 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -31,6 +31,10 @@ #define BOARD_WEBSITE_URL "github.com/FLYmaker/FLYF407ZG" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +// Avoid conflict with fans and TIMER_TONE +#define TEMP_TIMER 3 +#define STEP_TIMER 5 + // // EEPROM Emulation // diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h index 5ff29a1f1c..c48cbc9e56 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -31,6 +31,9 @@ #define BOARD_INFO_NAME "MKS Robin Nano V3" +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 13 + // Use one of these or SDCard-based Emulation will be used //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 48943ad973..40da409185 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -29,6 +29,9 @@ #define BOARD_INFO_NAME "MKS Robin PRO V2" +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 13 + // Use one of these or SDCard-based Emulation will be used //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation diff --git a/platformio.ini b/platformio.ini index e7f22e3f09..acb5990edb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -980,7 +980,7 @@ board_build.ldscript = ldscript.ld board_build.offset = 0x7000 board_build.firmware = Robin.bin build_flags = ${common_stm32.build_flags} - -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 + -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 -DTIMER_SERIAL=TIM5 build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC extra_scripts = ${common.extra_scripts}