From 7a48799dd5d87a814f4bd117605378c3708d8697 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Aug 2021 22:53:14 -0500 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=93=9D=20Update=20G2/G3=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/motion/G2_G3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index f9f9c2b3da6c..33167d9dff8d 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -217,7 +217,7 @@ void plan_arc( * tool precision in some cases. Therefore, arc path correction is implemented. * * Small angle approximation may be used to reduce computation overhead further. This approximation - * holds for everything, but very small circles and large MM_PER_ARC_SEGMENT values. In other words, + * holds for everything, but very small circles and large MAX_ARC_SEGMENT_MM values. In other words, * theta_per_segment would need to be greater than 0.1 rad and N_ARC_CORRECTION would need to be large * to cause an appreciable drift error. N_ARC_CORRECTION~=25 is more than small enough to correct for * numerical drift error. N_ARC_CORRECTION may be on the order a hundred(s) before error becomes an From 7d81a927fbccffff6aa607e1615c91f6caa0848f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 21 Aug 2021 14:00:53 -0500 Subject: [PATCH 2/5] Fix Trigorilla Pro build --- Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 3 +++ ini/stm32f1.ini | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 5b59a157f163..bf38955127e4 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -147,6 +147,9 @@ #define FSMC_CS_PIN PD7 // NE4 #define FSMC_RS_PIN PD11 // A0 + #define TFT_CS_PIN FSMC_CS_PIN + #define TFT_RS_PIN FSMC_RS_PIN + #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index f1cb078fd81c..a27d275fc112 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -348,9 +348,15 @@ debug_tool = stlink # TRIGORILLA PRO (STM32F103ZET6) # [env:trigorilla_pro] -platform = ${common_stm32.platform} -extends = env:mks_robin -extra_scripts = ${common_stm32.extra_scripts} +platform = ${stm32_variant.platform} +extends = stm32_variant +board = genericSTM32F103ZE +board_build.variant = MARLIN_F103Zx +board_build.offset = 0x7000 +build_flags = ${stm32_variant.build_flags} + -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 +build_unflags = ${stm32_variant.build_unflags} + -DUSBCON -DUSBD_USE_CDC # # Chitu boards like Tronxy X5s (STM32F103ZET6) From 62cd9aa277efbd985b6e6e2fb1cce200a53f0a1e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Aug 2021 16:59:00 -0500 Subject: [PATCH 3/5] Disable low_power.* in framework --- .../share/PlatformIO/variants/MARLIN_F103Zx/PinNamesVar.h | 3 ++- .../share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/PinNamesVar.h index d9076b4dfb59..b0259ab3355a 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/PinNamesVar.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/PinNamesVar.h @@ -1,5 +1,6 @@ /* SYS_WKUP */ -#ifdef PWR_WAKEUP_PIN1 +#if defined(PWR_WAKEUP_PIN1) && defined(HAL_PWR_MODULE_ENABLED) && !defined(HAL_PWR_MODULE_ONLY) + #error "PA0 is used by thermal sensor. Disable low power wake with -DHAL_PWR_MODULE_ONLY." SYS_WKUP1 = PA_0, #endif #ifdef PWR_WAKEUP_PIN2 diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h index 4e55fe1240f3..4da94a789358 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h @@ -72,6 +72,8 @@ extern "C" { //#define HAL_WWDG_MODULE_ENABLED //#define HAL_MMC_MODULE_ENABLED +#define HAL_PWR_MODULE_ONLY + /* ########################## Oscillator Values adaptation ####################*/ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. From 63cb8905c3868453da24e958f750b0d6713c36cd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Aug 2021 16:40:25 -0500 Subject: [PATCH 4/5] Turn off a variety of things --- .../variants/MARLIN_F103Zx/hal_conf_custom.h | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h index 4da94a789358..f6944c439cea 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h @@ -37,40 +37,41 @@ extern "C" { /** * @brief This is the list of modules to be used in the HAL driver */ -//#define HAL_MODULE_ENABLED -//#define HAL_ADC_MODULE_ENABLED -//#define HAL_CAN_MODULE_ENABLED -//#define HAL_CAN_LEGACY_MODULE_ENABLED -//#define HAL_CEC_MODULE_ENABLED -//#define HAL_CORTEX_MODULE_ENABLED -//#define HAL_CRC_MODULE_ENABLED -//#define HAL_DAC_MODULE_ENABLED -//#define HAL_DMA_MODULE_ENABLED -//#define HAL_ETH_MODULE_ENABLED -//#define HAL_EXTI_MODULE_ENABLED -//#define HAL_FLASH_MODULE_ENABLED -//#define HAL_GPIO_MODULE_ENABLED -//#define HAL_HCD_MODULE_ENABLED -//#define HAL_I2C_MODULE_ENABLED -//#define HAL_I2S_MODULE_ENABLED -//#define HAL_IRDA_MODULE_ENABLED -//#define HAL_IWDG_MODULE_ENABLED -//#define HAL_NAND_MODULE_ENABLED -//#define HAL_NOR_MODULE_ENABLED -//#define HAL_PCCARD_MODULE_ENABLED -//#define HAL_PCD_MODULE_ENABLED -//#define HAL_PWR_MODULE_ENABLED -//#define HAL_RCC_MODULE_ENABLED -//#define HAL_RTC_MODULE_ENABLED -//#define HAL_SD_MODULE_ENABLED -//#define HAL_SMARTCARD_MODULE_ENABLED -//#define HAL_SPI_MODULE_ENABLED -//#define HAL_SRAM_MODULE_ENABLED -//#define HAL_TIM_MODULE_ENABLED -//#define HAL_UART_MODULE_ENABLED -//#define HAL_USART_MODULE_ENABLED -//#define HAL_WWDG_MODULE_ENABLED -//#define HAL_MMC_MODULE_ENABLED +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +//#define HAL_UART_MODULE_ENABLED // by default +//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE) +#define HAL_SD_MODULE_ENABLED + +#undef HAL_CAN_MODULE_ENABLED +#undef HAL_CAN_LEGACY_MODULE_ENABLED +#undef HAL_CEC_MODULE_ENABLED +#undef HAL_DAC_MODULE_ENABLED +#undef HAL_ETH_MODULE_ENABLED +#undef HAL_HCD_MODULE_ENABLED +#undef HAL_I2S_MODULE_ENABLED +#undef HAL_IRDA_MODULE_ENABLED +#undef HAL_NAND_MODULE_ENABLED +#undef HAL_NOR_MODULE_ENABLED +#undef HAL_PCCARD_MODULE_ENABLED +#undef HAL_PWR_MODULE_ENABLED +#undef HAL_RTC_MODULE_ENABLED +#undef HAL_SMARTCARD_MODULE_ENABLED +#undef HAL_WWDG_MODULE_ENABLED +#undef HAL_MMC_MODULE_ENABLED #define HAL_PWR_MODULE_ONLY From 18d79cf493edfd954e117d41d2be3340ba67fe20 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Aug 2021 16:40:50 -0500 Subject: [PATCH 5/5] Clean up variant conf --- .../MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h | 2 +- .../MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h | 2 +- .../hal_conf_extra.h | 2 +- .../hal_conf_extra.h | 2 +- .../MARLIN_F103VE_LONGER/hal_conf_custom.h | 41 +++++-------------- .../variants/MARLIN_F103Zx/hal_conf_custom.h | 2 +- 6 files changed, 15 insertions(+), 36 deletions(-) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h index 6c4a991f33b8..2c1557cbbbc5 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h @@ -8,7 +8,7 @@ #define HAL_I2C_MODULE_ENABLED #define HAL_PWR_MODULE_ENABLED #define HAL_RCC_MODULE_ENABLED -//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it? +//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it? #define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED #define HAL_USART_MODULE_ENABLED diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h index e6d558b3e174..40b340c20560 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h @@ -8,7 +8,7 @@ #define HAL_I2C_MODULE_ENABLED #define HAL_PWR_MODULE_ENABLED #define HAL_RCC_MODULE_ENABLED -//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it? +//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it? #define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED #define HAL_USART_MODULE_ENABLED diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/hal_conf_extra.h index da974b1ba761..42c76a4bbffb 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/hal_conf_extra.h @@ -8,7 +8,7 @@ #define HAL_I2C_MODULE_ENABLED #define HAL_PWR_MODULE_ENABLED #define HAL_RCC_MODULE_ENABLED -//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it? +//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it? #define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED #define HAL_USART_MODULE_ENABLED diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h index e6d558b3e174..40b340c20560 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h @@ -8,7 +8,7 @@ #define HAL_I2C_MODULE_ENABLED #define HAL_PWR_MODULE_ENABLED #define HAL_RCC_MODULE_ENABLED -//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it? +//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it? #define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED #define HAL_USART_MODULE_ENABLED diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h index e2247addb964..fd20d8fe6f07 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h @@ -20,25 +20,18 @@ extern "C" { */ #include "stm32yyxx_hal_conf.h" -#ifdef HAL_PWR_MODULE_ENABLED - #undef HAL_PWR_MODULE_ENABLED // only way to disable it -#endif +#undef HAL_PWR_MODULE_ENABLED +#define HAL_PWR_MODULE_ONLY // disable low power & PA0 wakeup pin (its T°c pin) -#if defined(HAL_PWR_MODULE_ENABLED) && !defined(HAL_PWR_MODULE_ONLY) - #define HAL_PWR_MODULE_ONLY // disable low power & PA0 wakeup pin (its T°c pin) -#endif - -#ifndef HAL_IWDG_MODULE_ENABLED - #define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG -#endif +#define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG #ifdef HAL_PCD_MODULE_ENABLED - #warning No direct STM32 USB pins on Longer3D board + #warning "No direct STM32 USB pins on Longer3D board" #undef HAL_PCD_MODULE_ENABLED // USB Device #endif #ifdef HAL_HCD_MODULE_ENABLED - #warning No direct STM32 USB pins on Longer3D board + #warning "No direct STM32 USB pins on Longer3D board" #undef HAL_HCD_MODULE_ENABLED // USB Host #endif @@ -46,25 +39,12 @@ extern "C" { //#define HAL_USART_MODULE_ENABLED // Useless.... UART_MODULE do it #endif -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED - #undef HAL_CAN_LEGACY_MODULE_ENABLED -#endif - -#ifdef HAL_CAN_MODULE_ENABLED - #undef HAL_CAN_MODULE_ENABLED -#endif - -#ifdef HAL_DAC_MODULE_ENABLED - #undef HAL_DAC_MODULE_ENABLED -#endif +#undef HAL_CAN_LEGACY_MODULE_ENABLED +#undef HAL_CAN_MODULE_ENABLED +#undef HAL_DAC_MODULE_ENABLED +#undef HAL_RTC_MODULE_ENABLED -#ifdef HAL_RTC_MODULE_ENABLED - #undef HAL_RTC_MODULE_ENABLED -#endif - -#ifndef HAL_EXTI_MODULE_ENABLED - #define HAL_EXTI_MODULE_ENABLED // for ENDSTOP_INTERRUPTS_FEATURE -#endif +#define HAL_EXTI_MODULE_ENABLED // for ENDSTOP_INTERRUPTS_FEATURE /** * @brief List of modules in the framework (first ones enabled by default) @@ -345,4 +325,3 @@ extern "C" { #ifdef __cplusplus } #endif - diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h index f6944c439cea..7d19d532a597 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h @@ -61,7 +61,7 @@ extern "C" { #undef HAL_CEC_MODULE_ENABLED #undef HAL_DAC_MODULE_ENABLED #undef HAL_ETH_MODULE_ENABLED -#undef HAL_HCD_MODULE_ENABLED +#undef HAL_HCD_MODULE_ENABLED // USB Host #undef HAL_I2S_MODULE_ENABLED #undef HAL_IRDA_MODULE_ENABLED #undef HAL_NAND_MODULE_ENABLED