Browse Source

🔨 Fix HAL/STM32 F103Zx builds (#22610)

Scott Lahteine 3 years ago
parent
commit
efb9ea92b8

+ 1
- 1
Marlin/src/gcode/motion/G2_G3.cpp View File

@@ -217,7 +217,7 @@ void plan_arc(
217 217
    * tool precision in some cases. Therefore, arc path correction is implemented.
218 218
    *
219 219
    * Small angle approximation may be used to reduce computation overhead further. This approximation
220
-   * holds for everything, but very small circles and large MM_PER_ARC_SEGMENT values. In other words,
220
+   * holds for everything, but very small circles and large MAX_ARC_SEGMENT_MM values. In other words,
221 221
    * theta_per_segment would need to be greater than 0.1 rad and N_ARC_CORRECTION would need to be large
222 222
    * to cause an appreciable drift error. N_ARC_CORRECTION~=25 is more than small enough to correct for
223 223
    * numerical drift error. N_ARC_CORRECTION may be on the order a hundred(s) before error becomes an

+ 3
- 0
Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h View File

@@ -147,6 +147,9 @@
147 147
   #define FSMC_CS_PIN                       PD7   // NE4
148 148
   #define FSMC_RS_PIN                       PD11  // A0
149 149
 
150
+  #define TFT_CS_PIN                 FSMC_CS_PIN
151
+  #define TFT_RS_PIN                 FSMC_RS_PIN
152
+
150 153
   #define LCD_USE_DMA_FSMC                        // Use DMA transfers to send data to the TFT
151 154
   #define FSMC_DMA_DEV                      DMA2
152 155
   #define FSMC_DMA_CHANNEL               DMA_CH5

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h View File

@@ -8,7 +8,7 @@
8 8
 #define HAL_I2C_MODULE_ENABLED
9 9
 #define HAL_PWR_MODULE_ENABLED
10 10
 #define HAL_RCC_MODULE_ENABLED
11
-//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it?
11
+//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
12 12
 #define HAL_SPI_MODULE_ENABLED
13 13
 #define HAL_TIM_MODULE_ENABLED
14 14
 #define HAL_USART_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h View File

@@ -8,7 +8,7 @@
8 8
 #define HAL_I2C_MODULE_ENABLED
9 9
 #define HAL_PWR_MODULE_ENABLED
10 10
 #define HAL_RCC_MODULE_ENABLED
11
-//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it?
11
+//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
12 12
 #define HAL_SPI_MODULE_ENABLED
13 13
 #define HAL_TIM_MODULE_ENABLED
14 14
 #define HAL_USART_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/hal_conf_extra.h View File

@@ -8,7 +8,7 @@
8 8
 #define HAL_I2C_MODULE_ENABLED
9 9
 #define HAL_PWR_MODULE_ENABLED
10 10
 #define HAL_RCC_MODULE_ENABLED
11
-//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it?
11
+//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
12 12
 #define HAL_SPI_MODULE_ENABLED
13 13
 #define HAL_TIM_MODULE_ENABLED
14 14
 #define HAL_USART_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h View File

@@ -8,7 +8,7 @@
8 8
 #define HAL_I2C_MODULE_ENABLED
9 9
 #define HAL_PWR_MODULE_ENABLED
10 10
 #define HAL_RCC_MODULE_ENABLED
11
-//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it?
11
+//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
12 12
 #define HAL_SPI_MODULE_ENABLED
13 13
 #define HAL_TIM_MODULE_ENABLED
14 14
 #define HAL_USART_MODULE_ENABLED

+ 10
- 31
buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h View File

@@ -20,25 +20,18 @@ extern "C" {
20 20
   */
21 21
 #include "stm32yyxx_hal_conf.h"
22 22
 
23
-#ifdef HAL_PWR_MODULE_ENABLED
24
-  #undef HAL_PWR_MODULE_ENABLED // only way to disable it
25
-#endif
23
+#undef HAL_PWR_MODULE_ENABLED
24
+#define HAL_PWR_MODULE_ONLY   // disable low power & PA0 wakeup pin (its T°c pin)
26 25
 
27
-#if defined(HAL_PWR_MODULE_ENABLED) && !defined(HAL_PWR_MODULE_ONLY)
28
-  #define HAL_PWR_MODULE_ONLY // disable low power & PA0 wakeup pin (its T°c pin)
29
-#endif
30
-
31
-#ifndef HAL_IWDG_MODULE_ENABLED
32
-  #define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG
33
-#endif
26
+#define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG
34 27
 
35 28
 #ifdef HAL_PCD_MODULE_ENABLED
36
-  #warning No direct STM32 USB pins on Longer3D board
29
+  #warning "No direct STM32 USB pins on Longer3D board"
37 30
   #undef HAL_PCD_MODULE_ENABLED // USB Device
38 31
 #endif
39 32
 
40 33
 #ifdef HAL_HCD_MODULE_ENABLED
41
-  #warning No direct STM32 USB pins on Longer3D board
34
+  #warning "No direct STM32 USB pins on Longer3D board"
42 35
   #undef HAL_HCD_MODULE_ENABLED // USB Host
43 36
 #endif
44 37
 
@@ -46,25 +39,12 @@ extern "C" {
46 39
   //#define HAL_USART_MODULE_ENABLED // Useless.... UART_MODULE do it
47 40
 #endif
48 41
 
49
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
50
-  #undef HAL_CAN_LEGACY_MODULE_ENABLED
51
-#endif
52
-
53
-#ifdef HAL_CAN_MODULE_ENABLED
54
-  #undef HAL_CAN_MODULE_ENABLED
55
-#endif
56
-
57
-#ifdef HAL_DAC_MODULE_ENABLED
58
-  #undef HAL_DAC_MODULE_ENABLED
59
-#endif
42
+#undef HAL_CAN_LEGACY_MODULE_ENABLED
43
+#undef HAL_CAN_MODULE_ENABLED
44
+#undef HAL_DAC_MODULE_ENABLED
45
+#undef HAL_RTC_MODULE_ENABLED
60 46
 
61
-#ifdef HAL_RTC_MODULE_ENABLED
62
-  #undef HAL_RTC_MODULE_ENABLED
63
-#endif
64
-
65
-#ifndef HAL_EXTI_MODULE_ENABLED
66
-  #define HAL_EXTI_MODULE_ENABLED // for ENDSTOP_INTERRUPTS_FEATURE
67
-#endif
47
+#define HAL_EXTI_MODULE_ENABLED // for ENDSTOP_INTERRUPTS_FEATURE
68 48
 
69 49
 /**
70 50
   * @brief List of modules in the framework (first ones enabled by default)
@@ -345,4 +325,3 @@ extern "C" {
345 325
 #ifdef __cplusplus
346 326
 }
347 327
 #endif
348
-

+ 2
- 1
buildroot/share/PlatformIO/variants/MARLIN_F103Zx/PinNamesVar.h View File

@@ -1,5 +1,6 @@
1 1
 /* SYS_WKUP */
2
-#ifdef PWR_WAKEUP_PIN1
2
+#if defined(PWR_WAKEUP_PIN1) && defined(HAL_PWR_MODULE_ENABLED) && !defined(HAL_PWR_MODULE_ONLY)
3
+  #error "PA0 is used by thermal sensor. Disable low power wake with -DHAL_PWR_MODULE_ONLY."
3 4
   SYS_WKUP1 = PA_0,
4 5
 #endif
5 6
 #ifdef PWR_WAKEUP_PIN2

+ 37
- 34
buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h View File

@@ -37,40 +37,43 @@ extern "C" {
37 37
 /**
38 38
   * @brief This is the list of modules to be used in the HAL driver
39 39
   */
40
-//#define HAL_MODULE_ENABLED
41
-//#define HAL_ADC_MODULE_ENABLED
42
-//#define HAL_CAN_MODULE_ENABLED
43
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
44
-//#define HAL_CEC_MODULE_ENABLED
45
-//#define HAL_CORTEX_MODULE_ENABLED
46
-//#define HAL_CRC_MODULE_ENABLED
47
-//#define HAL_DAC_MODULE_ENABLED
48
-//#define HAL_DMA_MODULE_ENABLED
49
-//#define HAL_ETH_MODULE_ENABLED
50
-//#define HAL_EXTI_MODULE_ENABLED
51
-//#define HAL_FLASH_MODULE_ENABLED
52
-//#define HAL_GPIO_MODULE_ENABLED
53
-//#define HAL_HCD_MODULE_ENABLED
54
-//#define HAL_I2C_MODULE_ENABLED
55
-//#define HAL_I2S_MODULE_ENABLED
56
-//#define HAL_IRDA_MODULE_ENABLED
57
-//#define HAL_IWDG_MODULE_ENABLED
58
-//#define HAL_NAND_MODULE_ENABLED
59
-//#define HAL_NOR_MODULE_ENABLED
60
-//#define HAL_PCCARD_MODULE_ENABLED
61
-//#define HAL_PCD_MODULE_ENABLED
62
-//#define HAL_PWR_MODULE_ENABLED
63
-//#define HAL_RCC_MODULE_ENABLED
64
-//#define HAL_RTC_MODULE_ENABLED
65
-//#define HAL_SD_MODULE_ENABLED
66
-//#define HAL_SMARTCARD_MODULE_ENABLED
67
-//#define HAL_SPI_MODULE_ENABLED
68
-//#define HAL_SRAM_MODULE_ENABLED
69
-//#define HAL_TIM_MODULE_ENABLED
70
-//#define HAL_UART_MODULE_ENABLED
71
-//#define HAL_USART_MODULE_ENABLED
72
-//#define HAL_WWDG_MODULE_ENABLED
73
-//#define HAL_MMC_MODULE_ENABLED
40
+#define HAL_MODULE_ENABLED
41
+#define HAL_ADC_MODULE_ENABLED
42
+#define HAL_CRC_MODULE_ENABLED
43
+#define HAL_DMA_MODULE_ENABLED
44
+#define HAL_EXTI_MODULE_ENABLED
45
+#define HAL_FLASH_MODULE_ENABLED
46
+#define HAL_GPIO_MODULE_ENABLED
47
+#define HAL_I2C_MODULE_ENABLED
48
+#define HAL_IWDG_MODULE_ENABLED
49
+#define HAL_RCC_MODULE_ENABLED
50
+#define HAL_SPI_MODULE_ENABLED
51
+#define HAL_SRAM_MODULE_ENABLED
52
+#define HAL_TIM_MODULE_ENABLED
53
+#define HAL_USART_MODULE_ENABLED
54
+#define HAL_CORTEX_MODULE_ENABLED
55
+//#define HAL_UART_MODULE_ENABLED // by default
56
+//#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)
57
+#define HAL_SD_MODULE_ENABLED
58
+
59
+#undef HAL_CAN_MODULE_ENABLED
60
+#undef HAL_CAN_LEGACY_MODULE_ENABLED
61
+#undef HAL_CEC_MODULE_ENABLED
62
+#undef HAL_DAC_MODULE_ENABLED
63
+#undef HAL_ETH_MODULE_ENABLED
64
+#undef HAL_HCD_MODULE_ENABLED         // USB Host
65
+#undef HAL_I2S_MODULE_ENABLED
66
+#undef HAL_IRDA_MODULE_ENABLED
67
+#undef HAL_NAND_MODULE_ENABLED
68
+#undef HAL_NOR_MODULE_ENABLED
69
+#undef HAL_PCCARD_MODULE_ENABLED
70
+#undef HAL_PWR_MODULE_ENABLED
71
+#undef HAL_RTC_MODULE_ENABLED
72
+#undef HAL_SMARTCARD_MODULE_ENABLED
73
+#undef HAL_WWDG_MODULE_ENABLED
74
+#undef HAL_MMC_MODULE_ENABLED
75
+
76
+#define HAL_PWR_MODULE_ONLY
74 77
 
75 78
 /* ########################## Oscillator Values adaptation ####################*/
76 79
 /**

+ 9
- 3
ini/stm32f1.ini View File

@@ -348,9 +348,15 @@ debug_tool                  = stlink
348 348
 # TRIGORILLA PRO (STM32F103ZET6)
349 349
 #
350 350
 [env:trigorilla_pro]
351
-platform      = ${common_stm32.platform}
352
-extends       = env:mks_robin
353
-extra_scripts = ${common_stm32.extra_scripts}
351
+platform             = ${stm32_variant.platform}
352
+extends              = stm32_variant
353
+board                = genericSTM32F103ZE
354
+board_build.variant  = MARLIN_F103Zx
355
+board_build.offset   = 0x7000
356
+build_flags          = ${stm32_variant.build_flags}
357
+                       -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
358
+build_unflags        = ${stm32_variant.build_unflags}
359
+                       -DUSBCON -DUSBD_USE_CDC
354 360
 
355 361
 #
356 362
 # Chitu boards like Tronxy X5s (STM32F103ZET6)

Loading…
Cancel
Save