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

This commit is contained in:
thisiskeithb 2019-11-15 00:51:26 -08:00 committed by Scott Lahteine
parent aa93e1f21a
commit 0f57818f2d
13 changed files with 1002 additions and 954 deletions

View file

@ -27,7 +27,7 @@ env:
# Extended STM32 Environments # Extended STM32 Environments
- TEST_PLATFORM="STM32F103RC_bigtree" - TEST_PLATFORM="STM32F103RC_bigtree"
- TEST_PLATFORM="STM32F103RC_bigtree_USB" - TEST_PLATFORM="STM32F103RC_bigtree_NOUSB"
- TEST_PLATFORM="STM32F103RC_fysetc" - TEST_PLATFORM="STM32F103RC_fysetc"
- TEST_PLATFORM="jgaurora_a5s_a1" - TEST_PLATFORM="jgaurora_a5s_a1"
- TEST_PLATFORM="STM32F103VE_longer" - TEST_PLATFORM="STM32F103VE_longer"

View file

@ -51,6 +51,14 @@
// Defines // Defines
// ------------------------ // ------------------------
#ifndef STM32_FLASH_SIZE
#ifdef MCU_STM32F103RE
#define STM32_FLASH_SIZE 512
#else
#define STM32_FLASH_SIZE 256
#endif
#endif
#ifdef SERIAL_USB #ifdef SERIAL_USB
#ifndef USE_USB_COMPOSITE #ifndef USE_USB_COMPOSITE
#define UsbSerial Serial #define UsbSerial Serial

View file

@ -470,13 +470,13 @@
#elif MB(MKS_ROBIN_LITE) #elif MB(MKS_ROBIN_LITE)
#include "stm32/pins_MKS_ROBIN_LITE.h" // STM32F1 env:mks_robin_lite #include "stm32/pins_MKS_ROBIN_LITE.h" // STM32F1 env:mks_robin_lite
#elif MB(BIGTREE_SKR_MINI_V1_1) #elif MB(BIGTREE_SKR_MINI_V1_1)
#include "stm32/pins_BIGTREE_SKR_MINI_V1_1.h" // STM32F1 env:STM32F103RC_bigtree #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
#elif MB(BTT_SKR_MINI_E3_V1_2) #elif MB(BTT_SKR_MINI_E3_V1_2)
#include "stm32/pins_BTT_SKR_MINI_E3_V1_2.h" // STM32F1 env:STM32F103RC_bigtree #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
#elif MB(BIGTREE_SKR_MINI_E3) #elif MB(BIGTREE_SKR_MINI_E3)
#include "stm32/pins_BIGTREE_SKR_MINI_E3.h" // STM32F1 env:STM32F103RC_bigtree #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
#elif MB(BIGTREE_SKR_E3_DIP) #elif MB(BIGTREE_SKR_E3_DIP)
#include "stm32/pins_BIGTREE_SKR_E3_DIP.h" // STM32F1 env:STM32F103RC_bigtree #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
#elif MB(JGAURORA_A5S_A1) #elif MB(JGAURORA_A5S_A1)
#include "stm32/pins_JGAURORA_A5S_A1.h" // STM32F1 env:jgaurora_a5s_a1 #include "stm32/pins_JGAURORA_A5S_A1.h" // STM32F1 env:jgaurora_a5s_a1
#elif MB(FYSETC_AIO_II) #elif MB(FYSETC_AIO_II)

View file

@ -33,15 +33,9 @@
// Ignore temp readings during development. // Ignore temp readings during development.
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
#ifdef MCU_STM32F103RE
#define STM32_FLASH_SIZE (512 * 1024)
#else
#define STM32_FLASH_SIZE (256 * 1024)
#endif
#define FLASH_EEPROM_EMULATION #define FLASH_EEPROM_EMULATION
#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB #define EEPROM_PAGE_SIZE uint16(0x800) // 2KB
#define EEPROM_START_ADDRESS uint32(0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE) #define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE)
#undef E2END #undef E2END
#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB #define E2END (EEPROM_PAGE_SIZE - 1) // 2KB

View file

@ -33,15 +33,9 @@
// Ignore temp readings during development. // Ignore temp readings during development.
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
#ifdef MCU_STM32F103RE
#define STM32_FLASH_SIZE (512 * 1024)
#else
#define STM32_FLASH_SIZE (256 * 1024)
#endif
#define FLASH_EEPROM_EMULATION #define FLASH_EEPROM_EMULATION
#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB #define EEPROM_PAGE_SIZE uint16(0x800) // 2KB
#define EEPROM_START_ADDRESS uint32(0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE) #define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE)
#undef E2END #undef E2END
#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB #define E2END (EEPROM_PAGE_SIZE - 1) // 2KB

View file

@ -33,15 +33,9 @@
// Ignore temp readings during development. // Ignore temp readings during development.
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
#ifdef MCU_STM32F103RE
#define STM32_FLASH_SIZE (512 * 1024)
#else
#define STM32_FLASH_SIZE (256 * 1024)
#endif
#define FLASH_EEPROM_EMULATION #define FLASH_EEPROM_EMULATION
#define EEPROM_PAGE_SIZE (0x800) // 2KB #define EEPROM_PAGE_SIZE (0x800) // 2KB
#define EEPROM_START_ADDRESS (0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE) #define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE)
#define E2END (EEPROM_PAGE_SIZE - 1) #define E2END (EEPROM_PAGE_SIZE - 1)
// //

View file

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

View file

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

View file

@ -1,13 +1,18 @@
import os import os
Import("env") Import("env")
# Relocate firmware from 0x08000000 to 0x08007000 STM32_FLASH_SIZE = 256
for define in env['CPPDEFINES']: for define in env['CPPDEFINES']:
if define[0] == "VECT_TAB_ADDR": if define[0] == "VECT_TAB_ADDR":
env['CPPDEFINES'].remove(define) env['CPPDEFINES'].remove(define)
if define[0] == "STM32_FLASH_SIZE":
STM32_FLASH_SIZE = define[1]
# Relocate firmware from 0x08000000 to 0x08007000
env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000"))
custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI.ld") custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_" + str(STM32_FLASH_SIZE) + "K.ld")
for i, flag in enumerate(env["LINKFLAGS"]): for i, flag in enumerate(env["LINKFLAGS"]):
if "-Wl,-T" in flag: if "-Wl,-T" in flag:
env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script

File diff suppressed because it is too large Load diff

View file

@ -294,12 +294,33 @@ upload_protocol = serial
# #
# BigTree SKR Mini V1.1 / SKR mini E3 / SKR E3 DIP (STM32F103RCT6 ARM Cortex-M3) # BigTree SKR Mini V1.1 / SKR mini E3 / SKR E3 DIP (STM32F103RCT6 ARM Cortex-M3)
# #
# STM32F103RC_bigtree .............. RCT6 with 256K
# STM32F103RC_bigtree_NOUSB ........ RCT6 with 256K (no USB)
# STM32F103RC_bigtree_512K.......... RCT6 with 512K
# STM32F103RC_bigtree_512K_NOUSB ... RCT6 with 512K (no USB)
#
[env:STM32F103RC_bigtree] [env:STM32F103RC_bigtree]
platform = ststm32 platform = ststm32
framework = arduino framework = arduino
board = genericSTM32F103RC board = genericSTM32F103RC
platform_packages = tool-stm32duino platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=256
build_unflags = -std=gnu++11
lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
lib_ignore = Adafruit NeoPixel, SPI
src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
monitor_speed = 115200
[env:STM32F103RC_bigtree_NOUSB]
platform = ststm32
framework = arduino
board = genericSTM32F103RC
platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4
build_unflags = -std=gnu++11 build_unflags = -std=gnu++11
@ -309,14 +330,31 @@ lib_ignore = Adafruit NeoPixel, SPI
src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1> src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
monitor_speed = 115200 monitor_speed = 115200
[env:STM32F103RC_bigtree_USB] [env:STM32F103RC_bigtree_512K]
platform = ststm32 platform = ststm32
framework = arduino framework = arduino
board = genericSTM32F103RC board = genericSTM32F103RC
board_upload.maximum_size=524288
platform_packages = tool-stm32duino platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4 ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512
build_unflags = -std=gnu++11
lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
lib_ignore = Adafruit NeoPixel, SPI
src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
monitor_speed = 115200
[env:STM32F103RC_bigtree_512K_NOUSB]
platform = ststm32
framework = arduino
board = genericSTM32F103RC
board_upload.maximum_size=524288
platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512
build_unflags = -std=gnu++11 build_unflags = -std=gnu++11
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip