Browse Source

Support 512K "RCT6" in BTT SKR Mini (#15890)

thisiskeithb 5 years ago
parent
commit
0f57818f2d

+ 1
- 1
.travis.yml View File

@@ -27,7 +27,7 @@ env:
27 27
 
28 28
   # Extended STM32 Environments
29 29
   - TEST_PLATFORM="STM32F103RC_bigtree"
30
-  - TEST_PLATFORM="STM32F103RC_bigtree_USB"
30
+  - TEST_PLATFORM="STM32F103RC_bigtree_NOUSB"
31 31
   - TEST_PLATFORM="STM32F103RC_fysetc"
32 32
   - TEST_PLATFORM="jgaurora_a5s_a1"
33 33
   - TEST_PLATFORM="STM32F103VE_longer"

+ 8
- 0
Marlin/src/HAL/HAL_STM32F1/HAL.h View File

@@ -51,6 +51,14 @@
51 51
 // Defines
52 52
 // ------------------------
53 53
 
54
+#ifndef STM32_FLASH_SIZE
55
+  #ifdef MCU_STM32F103RE
56
+    #define STM32_FLASH_SIZE 512
57
+  #else
58
+    #define STM32_FLASH_SIZE 256
59
+  #endif
60
+#endif
61
+
54 62
 #ifdef SERIAL_USB
55 63
   #ifndef USE_USB_COMPOSITE
56 64
     #define UsbSerial Serial

+ 4
- 4
Marlin/src/pins/pins.h View File

@@ -470,13 +470,13 @@
470 470
 #elif MB(MKS_ROBIN_LITE)
471 471
   #include "stm32/pins_MKS_ROBIN_LITE.h"        // STM32F1                                env:mks_robin_lite
472 472
 #elif MB(BIGTREE_SKR_MINI_V1_1)
473
-  #include "stm32/pins_BIGTREE_SKR_MINI_V1_1.h" // STM32F1                                env:STM32F103RC_bigtree
473
+  #include "stm32/pins_BIGTREE_SKR_MINI_V1_1.h" // STM32F1                                env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_NOUSB env:STM32F103RC_bigtree_512K_NOUSB
474 474
 #elif MB(BTT_SKR_MINI_E3_V1_2)
475
-  #include "stm32/pins_BTT_SKR_MINI_E3_V1_2.h"  // STM32F1                                env:STM32F103RC_bigtree
475
+  #include "stm32/pins_BTT_SKR_MINI_E3_V1_2.h"  // STM32F1                                env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_NOUSB env:STM32F103RC_bigtree_512K_NOUSB
476 476
 #elif MB(BIGTREE_SKR_MINI_E3)
477
-  #include "stm32/pins_BIGTREE_SKR_MINI_E3.h"   // STM32F1                                env:STM32F103RC_bigtree
477
+  #include "stm32/pins_BIGTREE_SKR_MINI_E3.h"   // STM32F1                                env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_NOUSB env:STM32F103RC_bigtree_512K_NOUSB
478 478
 #elif MB(BIGTREE_SKR_E3_DIP)
479
-  #include "stm32/pins_BIGTREE_SKR_E3_DIP.h"    // STM32F1                                env:STM32F103RC_bigtree
479
+  #include "stm32/pins_BIGTREE_SKR_E3_DIP.h"    // STM32F1                                env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_NOUSB env:STM32F103RC_bigtree_512K_NOUSB
480 480
 #elif MB(JGAURORA_A5S_A1)
481 481
   #include "stm32/pins_JGAURORA_A5S_A1.h"       // STM32F1                                env:jgaurora_a5s_a1
482 482
 #elif MB(FYSETC_AIO_II)

+ 1
- 7
Marlin/src/pins/stm32/pins_BIGTREE_SKR_E3_DIP.h View File

@@ -33,15 +33,9 @@
33 33
 // Ignore temp readings during development.
34 34
 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
35 35
 
36
-#ifdef MCU_STM32F103RE
37
-  #define STM32_FLASH_SIZE (512 * 1024)
38
-#else
39
-  #define STM32_FLASH_SIZE (256 * 1024)
40
-#endif
41
-
42 36
 #define FLASH_EEPROM_EMULATION
43 37
 #define EEPROM_PAGE_SIZE     uint16(0x800) // 2KB
44
-#define EEPROM_START_ADDRESS uint32(0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE)
38
+#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE)
45 39
 #undef E2END
46 40
 #define E2END                (EEPROM_PAGE_SIZE - 1) // 2KB
47 41
 

+ 1
- 7
Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_E3.h View File

@@ -33,15 +33,9 @@
33 33
 // Ignore temp readings during development.
34 34
 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
35 35
 
36
-#ifdef MCU_STM32F103RE
37
-  #define STM32_FLASH_SIZE (512 * 1024)
38
-#else
39
-  #define STM32_FLASH_SIZE (256 * 1024)
40
-#endif
41
-
42 36
 #define FLASH_EEPROM_EMULATION
43 37
 #define EEPROM_PAGE_SIZE     uint16(0x800) // 2KB
44
-#define EEPROM_START_ADDRESS uint32(0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE)
38
+#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE)
45 39
 #undef E2END
46 40
 #define E2END                (EEPROM_PAGE_SIZE - 1) // 2KB
47 41
 

+ 1
- 7
Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_V1_1.h View File

@@ -33,15 +33,9 @@
33 33
 // Ignore temp readings during development.
34 34
 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
35 35
 
36
-#ifdef MCU_STM32F103RE
37
-  #define STM32_FLASH_SIZE (512 * 1024)
38
-#else
39
-  #define STM32_FLASH_SIZE (256 * 1024)
40
-#endif
41
-
42 36
 #define FLASH_EEPROM_EMULATION
43 37
 #define EEPROM_PAGE_SIZE     (0x800) // 2KB
44
-#define EEPROM_START_ADDRESS (0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE)
38
+#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE)
45 39
 #define E2END                (EEPROM_PAGE_SIZE - 1)
46 40
 
47 41
 //

+ 1
- 1
Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_2.h View File

@@ -35,7 +35,7 @@
35 35
 
36 36
 #define FLASH_EEPROM_EMULATION
37 37
 #define EEPROM_PAGE_SIZE     uint16(0x800) // 2KB
38
-#define EEPROM_START_ADDRESS uint32(0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE)
38
+#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE)
39 39
 #undef E2END
40 40
 #define E2END                (EEPROM_PAGE_SIZE - 1) // 2KB
41 41
 

buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI.ld → buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_256K.ld View File


+ 14
- 0
buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_512K.ld View File

@@ -0,0 +1,14 @@
1
+MEMORY
2
+{
3
+  ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
4
+  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 512K - 28K
5
+}
6
+
7
+/* Provide memory region aliases for common.inc */
8
+REGION_ALIAS("REGION_TEXT", rom);
9
+REGION_ALIAS("REGION_DATA", ram);
10
+REGION_ALIAS("REGION_BSS", ram);
11
+REGION_ALIAS("REGION_RODATA", rom);
12
+
13
+/* Let common.inc handle the real work. */
14
+INCLUDE common.inc

+ 7
- 2
buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py View File

@@ -1,13 +1,18 @@
1 1
 import os
2 2
 Import("env")
3 3
 
4
-# Relocate firmware from 0x08000000 to 0x08007000
4
+STM32_FLASH_SIZE = 256
5
+
5 6
 for define in env['CPPDEFINES']:
6 7
     if define[0] == "VECT_TAB_ADDR":
7 8
         env['CPPDEFINES'].remove(define)
9
+    if define[0] == "STM32_FLASH_SIZE":
10
+        STM32_FLASH_SIZE = define[1]
11
+
12
+# Relocate firmware from 0x08000000 to 0x08007000
8 13
 env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000"))
9 14
 
10
-custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI.ld")
15
+custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_" + str(STM32_FLASH_SIZE) + "K.ld")
11 16
 for i, flag in enumerate(env["LINKFLAGS"]):
12 17
     if "-Wl,-T" in flag:
13 18
         env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script

+ 1011
- 1010
buildroot/share/atom/auto_build.py
File diff suppressed because it is too large
View File


buildroot/share/tests/STM32F103RC_bigtree_USB-tests → buildroot/share/tests/STM32F103RC_bigtree_NOUSB-tests View File


+ 40
- 2
platformio.ini View File

@@ -294,6 +294,12 @@ upload_protocol   = serial
294 294
 #
295 295
 # BigTree SKR Mini V1.1 / SKR mini E3 / SKR E3 DIP (STM32F103RCT6 ARM Cortex-M3)
296 296
 #
297
+#   STM32F103RC_bigtree .............. RCT6 with 256K
298
+#   STM32F103RC_bigtree_NOUSB ........ RCT6 with 256K (no USB)
299
+#   STM32F103RC_bigtree_512K.......... RCT6 with 512K
300
+#   STM32F103RC_bigtree_512K_NOUSB ... RCT6 with 512K (no USB)
301
+#
302
+
297 303
 [env:STM32F103RC_bigtree]
298 304
 platform          = ststm32
299 305
 framework         = arduino
@@ -301,6 +307,21 @@ board             = genericSTM32F103RC
301 307
 platform_packages = tool-stm32duino
302 308
 extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
303 309
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
310
+  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=256
311
+build_unflags     = -std=gnu++11
312
+lib_deps          = ${common.lib_deps}
313
+  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
314
+lib_ignore        = Adafruit NeoPixel, SPI
315
+src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
316
+monitor_speed     = 115200
317
+
318
+[env:STM32F103RC_bigtree_NOUSB]
319
+platform          = ststm32
320
+framework         = arduino
321
+board             = genericSTM32F103RC
322
+platform_packages = tool-stm32duino
323
+extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
324
+build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
304 325
   ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4
305 326
 build_unflags     = -std=gnu++11
306 327
 lib_deps          = ${common.lib_deps}
@@ -309,14 +330,31 @@ lib_ignore        = Adafruit NeoPixel, SPI
309 330
 src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
310 331
 monitor_speed     = 115200
311 332
 
312
-[env:STM32F103RC_bigtree_USB]
333
+[env:STM32F103RC_bigtree_512K]
334
+platform          = ststm32
335
+framework         = arduino
336
+board             = genericSTM32F103RC
337
+board_upload.maximum_size=524288
338
+platform_packages = tool-stm32duino
339
+extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
340
+build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
341
+  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512
342
+build_unflags     = -std=gnu++11
343
+lib_deps          = ${common.lib_deps}
344
+  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
345
+lib_ignore        = Adafruit NeoPixel, SPI
346
+src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
347
+monitor_speed     = 115200
348
+
349
+[env:STM32F103RC_bigtree_512K_NOUSB]
313 350
 platform          = ststm32
314 351
 framework         = arduino
315 352
 board             = genericSTM32F103RC
353
+board_upload.maximum_size=524288
316 354
 platform_packages = tool-stm32duino
317 355
 extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
318 356
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
319
-  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4
357
+  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512
320 358
 build_unflags     = -std=gnu++11
321 359
 lib_deps          = ${common.lib_deps}
322 360
   SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip

Loading…
Cancel
Save