Skip to content

Commit

Permalink
STM32F103.. reorganization, SKR mini fix (MarlinFirmware#15398)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot authored and Markus Seidl committed Oct 31, 2019
1 parent ec3b1cb commit 74786a9
Show file tree
Hide file tree
Showing 23 changed files with 98 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ jobs:
build_marlin_pio ./ ${TEST_PLATFORM}
restore_configs
echo testing STM32F1 targets...
export TEST_PLATFORM="-e STM32F103R"
export TEST_PLATFORM="-e STM32F103RE"
restore_configs
echo use_example_configs STM32/STM32F103R
use_example_configs STM32/STM32F103R
echo use_example_configs STM32/STM32F103RE
use_example_configs STM32/STM32F103RE
build_marlin_pio ./ ${TEST_PLATFORM}
restore_configs
echo use_example_configs STM32/stm32f103ret6
Expand Down
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
- TEST_PLATFORM="LPC1768"
- TEST_PLATFORM="LPC1769"
- TEST_PLATFORM="megaatmega2560"
- TEST_PLATFORM="STM32F103R"
- TEST_PLATFORM="STM32F103RE"
- TEST_PLATFORM="teensy31"
- TEST_PLATFORM="teensy35"

Expand All @@ -31,22 +31,23 @@ env:
- TEST_PLATFORM="ARMED"
- TEST_PLATFORM="BIGTREE_BTT002"
- TEST_PLATFORM="BIGTREE_SKR_PRO"
- TEST_PLATFORM="STM32F103R_bigtree"
- TEST_PLATFORM="STM32F103RC_bigtree"
- TEST_PLATFORM="jgaurora_a5s_a1"
- TEST_PLATFORM="STM32F103V_longer"
- TEST_PLATFORM="STM32F103VE_longer"
- TEST_PLATFORM="STM32F407VE_black"

# Non-working environment tests
#- TEST_PLATFORM="at90usb1286_cdc"
#- TEST_PLATFORM="at90usb1286_dfu"
#- TEST_PLATFORM="malyanm200"
#- TEST_PLATFORM="STM32F103CB_malyan"
#- TEST_PLATFORM="mks_robin"
#- TEST_PLATFORM="mks_robin_lite"
#- TEST_PLATFORM="mks_robin_mini"
#- TEST_PLATFORM="mks_robin_nano"
#- TEST_PLATFORM="SAMD51_grandcentral_m4"
#- TEST_PLATFORM="STM32F103R_bigtree"
#- TEST_PLATFORM="STM32F103R_fysetc"
#- TEST_PLATFORM="STM32F103RC_bigtree"
#- TEST_PLATFORM="STM32F103RC_bigtree_USB"
#- TEST_PLATFORM="STM32F103RC_fysetc"
#- TEST_PLATFORM="STM32F4"
#- TEST_PLATFORM="STM32F7"

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@
// STM32 ARM Cortex-M3
//

#define BOARD_STM32F103R 4000 // STM32F103R Libmaple-based STM32F1 controller
#define BOARD_STM32F103RE 4000 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_MALYAN_M200 4001 // STM32C8T6 Libmaple-based STM32F1 controller
#define BOARD_STM3R_MINI 4002 // STM32F103R Libmaple-based STM32F1 controller
#define BOARD_STM3R_MINI 4002 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_GTM32_PRO_VB 4003 // STM32F103VET6 controller
#define BOARD_MORPHEUS 4004 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
#define BOARD_CHITU3D 4005 // Chitu3D (STM32F103RET6)
Expand Down
6 changes: 5 additions & 1 deletion Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@
#define BOARD_FORMBOT_TREX2 -1003
#define BOARD_BIQU_SKR_V1_1 -1004
#define BOARD_STM32F1R -1005
#define BOARD_STM32F103R -1006
#if MB(MKS_13)
#error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration."
#elif MB(TRIGORILLA)
Expand All @@ -421,14 +422,17 @@
#elif MB(BIQU_SKR_V1_1)
#error "BOARD_BIQU_SKR_V1_1 has been renamed BOARD_BIGTREE_SKR_V1_1. Please update your configuration."
#elif MB(STM32F1R)
#error "BOARD_STM32F1R has been renamed BOARD_STM32F103R. Please update your configuration."
#error "BOARD_STM32F1R has been renamed BOARD_STM32F103RE. Please update your configuration."
#elif MB(STM32F103R)
#error "BOARD_STM32F103R has been renamed BOARD_STM32F103RE. Please update your configuration."
#endif
#undef BOARD_MKS_13
#undef BOARD_TRIGORILLA
#undef BOARD_RURAMPS4D
#undef BOARD_FORMBOT_TREX2
#undef BOARD_BIQU_SKR_V1_1
#undef BOARD_STM32F1R
#undef BOARD_STM32F103R

/**
* Marlin release, version and default string
Expand Down
28 changes: 14 additions & 14 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,18 +442,18 @@
// STM32 ARM Cortex-M3
//

#elif MB(STM32F103R)
#include "stm32/pins_STM32F1R.h" // STM32F1 env:STM32F103R
#elif MB(STM32F103RE)
#include "stm32/pins_STM32F1R.h" // STM32F1 env:STM32F103RE
#elif MB(MALYAN_M200)
#include "stm32/pins_MALYAN_M200.h" // STM32F1 env:malyanm200
#include "stm32/pins_MALYAN_M200.h" // STM32F1 env:STM32F103CB_malyan
#elif MB(STM3R_MINI)
#include "stm32/pins_STM3R_MINI.h" // STM32F1 env:STM32F103R
#include "stm32/pins_STM3R_MINI.h" // STM32F1 env:STM32F103RE
#elif MB(GTM32_PRO_VB)
#include "stm32/pins_GTM32_PRO_VB.h" // STM32F1 env:STM32F103R
#include "stm32/pins_GTM32_PRO_VB.h" // STM32F1 env:STM32F103RE
#elif MB(MORPHEUS)
#include "stm32/pins_MORPHEUS.h" // STM32F1 env:STM32F103R
#include "stm32/pins_MORPHEUS.h" // STM32F1 env:STM32F103RE
#elif MB(CHITU3D)
#include "stm32/pins_CHITU3D.h" // STM32F1 env:STM32F103R
#include "stm32/pins_CHITU3D.h" // STM32F1 env:STM32F103RE
#elif MB(MKS_ROBIN)
#include "stm32/pins_MKS_ROBIN.h" // STM32F1 env:mks_robin
#elif MB(MKS_ROBIN_MINI)
Expand All @@ -463,21 +463,21 @@
#elif MB(MKS_ROBIN_LITE)
#include "stm32/pins_MKS_ROBIN_LITE.h" // STM32F1 env:mks_robin_lite
#elif MB(BIGTREE_SKR_MINI_V1_1)
#include "stm32/pins_BIGTREE_SKR_MINI_V1_1.h" // STM32F1 env:STM32F103R_bigtree
#include "stm32/pins_BIGTREE_SKR_MINI_V1_1.h" // STM32F1 env:STM32F103RC_bigtree
#elif MB(BIGTREE_SKR_MINI_E3)
#include "stm32/pins_BIGTREE_SKR_MINI_E3.h" // STM32F1 env:STM32F103R_bigtree
#include "stm32/pins_BIGTREE_SKR_MINI_E3.h" // STM32F1 env:STM32F103RC_bigtree
#elif MB(BIGTREE_SKR_E3_DIP)
#include "stm32/pins_BIGTREE_SKR_E3_DIP.h" // STM32F1 env:STM32F103R_bigtree
#include "stm32/pins_BIGTREE_SKR_E3_DIP.h" // STM32F1 env:STM32F103RC_bigtree
#elif MB(JGAURORA_A5S_A1)
#include "stm32/pins_JGAURORA_A5S_A1.h" // STM32F1 env:jgaurora_a5s_a1
#elif MB(FYSETC_AIO_II)
#include "stm32/pins_FYSETC_AIO_II.h" // STM32F1 env:STM32F103R_fysetc
#include "stm32/pins_FYSETC_AIO_II.h" // STM32F1 env:STM32F103RC_fysetc
#elif MB(FYSETC_CHEETAH)
#include "stm32/pins_FYSETC_CHEETAH.h" // STM32F1 env:STM32F103R_fysetc
#include "stm32/pins_FYSETC_CHEETAH.h" // STM32F1 env:STM32F103RC_fysetc
#elif MB(FYSETC_CHEETAH_V12)
#include "stm32/pins_FYSETC_CHEETAH_V12.h" // STM32F1 env:STM32F103R_fysetc
#include "stm32/pins_FYSETC_CHEETAH_V12.h" // STM32F1 env:STM32F103RC_fysetc
#elif MB(LONGER3D_LK)
#include "stm32/pins_LONGER3D_LK.h" // STM32F1 env:STM32F103V_longer
#include "stm32/pins_LONGER3D_LK.h" // STM32F1 env:STM32F103VE_longer

//
// ARM Cortex-M4F
Expand Down
8 changes: 7 additions & 1 deletion Marlin/src/pins/stm32/pins_BIGTREE_SKR_E3_DIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@
// Ignore temp readings during development.
//#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 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 - 2 * EEPROM_PAGE_SIZE)
#undef E2END
#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB

Expand Down
8 changes: 7 additions & 1 deletion Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_E3.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@
// Ignore temp readings during development.
//#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 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 - 2 * EEPROM_PAGE_SIZE)
#undef E2END
#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB

Expand Down
15 changes: 11 additions & 4 deletions Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_V1_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@
// Ignore temp readings during development.
//#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 EEPROM_PAGE_SIZE (0x800) // 2KB
#define EEPROM_START_ADDRESS (0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE)
#define E2END (EEPROM_PAGE_SIZE - 1)

//
// Limit Switches
//
Expand Down Expand Up @@ -208,7 +219,3 @@
#define ST7920_DELAY_3 DELAY_NS(125)
#endif

#define FLASH_EEPROM_EMULATION
#define EEPROM_PAGE_SIZE (0x800) // 2KB
#define EEPROM_START_ADDRESS (0x8000000 + (256 * 1024) - 2 * EEPROM_PAGE_SIZE)
#define E2END (EEPROM_PAGE_SIZE - 1)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
if define[0] == "VECT_TAB_ADDR":
env['CPPDEFINES'].remove(define)
env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000"))
env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/STM32F1_SKR_MINI.ld")
env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI.ld")
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if define[0] == "VECT_TAB_ADDR":
env['CPPDEFINES'].remove(define)
env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))
env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/longer_STM32.ld")
env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/STM32F103VE_longer.ld")

# Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D)
def encrypt(source, target, env):
Expand Down
4 changes: 2 additions & 2 deletions buildroot/share/git/mftest
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ case $TESTENV in
m128) TESTENV='megaatmega1280' ;;
m256) TESTENV='megaatmega2560' ;;
mega) TESTENV='megaatmega2560' ;;
stm) TESTENV='STM32F103R' ;;
f1) TESTENV='STM32F103R' ;;
stm) TESTENV='STM32F103RE' ;;
f1) TESTENV='STM32F103RE' ;;
f4) TESTENV='STM32F4' ;;
f7) TESTENV='STM32F7' ;;
teensy) TESTENV='teensy31' ;;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Build tests for STM32F1 malyanM200
# Build tests for STM32F103CB Malyan M200
#

# exit on first failure
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Build tests for STM32F1 Bigtreetech (SKR Mini v1.1)
# Build tests for STM32F103RC Bigtreetech (SKR Mini v1.1)
#

# exit on first failure
Expand Down
19 changes: 19 additions & 0 deletions buildroot/share/tests/STM32F103RC_bigtree_USB-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
#
# Build tests for STM32F103RC Bigtreetech (SKR Mini v1.1)
#

# exit on first failure
set -e

#
# Build with the default configurations
#
restore_configs
opt_set MOTHERBOARD BOARD_BIGTREE_SKR_MINI_V1_1
opt_set SERIAL_PORT 1
opt_set SERIAL_PORT_2 -1
exec_test $1 $2 "Bigtreetech SKR Mini v1.1 - Basic Configuration"

# clean up
restore_configs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Build tests for STM32F1 FYSETC
# Build tests for STM32F103RC FYSETC
#

# exit on first failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e
# Build with the default configurations
#
restore_configs
opt_set MOTHERBOARD BOARD_STM32F103R
opt_set MOTHERBOARD BOARD_STM32F103RE
opt_set EXTRUDERS 2
opt_set SERIAL_PORT -1
opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

// Choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_STM32F103R
#define MOTHERBOARD BOARD_STM32F103RE
#endif

// Name displayed in the LCD "Ready" message and Info menu
Expand Down
2 changes: 1 addition & 1 deletion config/examples/STM32/stm32f103ret6/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

// Choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_STM32F103R
#define MOTHERBOARD BOARD_STM32F103RE
#endif

// Name displayed in the LCD "Ready" message and Info menu
Expand Down
26 changes: 13 additions & 13 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ monitor_speed = 250000
#
# STM32F103RE
#
[env:STM32F103R]
[env:STM32F103RE]
platform = ststm32
framework = arduino
board = genericSTM32F103RE
Expand All @@ -262,20 +262,20 @@ build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
-DDEBUG_LEVEL=0
build_unflags = -std=gnu++11
lib_deps = ${common.lib_deps}
lib_ignore = U8glib-HAL, Adafruit NeoPixel, SPI
lib_ignore = Adafruit NeoPixel, SPI
src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
monitor_speed = 250000

#
# STM32F103R_fysetc
# STM32F103RC_fysetc
#
[env:STM32F103R_fysetc]
[env:STM32F103RC_fysetc]
platform = ststm32
framework = arduino
board = genericSTM32F103RC
#board_build.core = maple
platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103R_fysetc.py
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
${common.build_flags} -std=gnu++14
-DDEBUG_LEVEL=0 -DHAVE_SW_SERIAL
Expand All @@ -292,12 +292,12 @@ upload_protocol = serial
#
# BigTree SKR Mini V1.1 / SKR mini E3 / SKR E3 DIP (STM32F103RCT6 ARM Cortex-M3)
#
[env:STM32F103R_bigtree]
[env:STM32F103RC_bigtree]
platform = ststm32
framework = arduino
board = genericSTM32F103RC
platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F1_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
build_unflags = -std=gnu++11
Expand All @@ -308,12 +308,12 @@ monitor_speed = 115200
upload_protocol = stlink
debug_tool = stlink

[env:STM32F103R_bigtree_USB]
[env:STM32F103RC_bigtree_USB]
platform = ststm32
framework = arduino
board = genericSTM32F103RC
platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F1_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 -DUSE_USB_COMPOSITE -std=gnu++14
build_unflags = -std=gnu++11
Expand Down Expand Up @@ -366,12 +366,12 @@ monitor_speed = 250000
#
# Longer 3D board in Alfawise U20 (STM32F103VET6)
#
[env:STM32F103V_longer]
[env:STM32F103VE_longer]
platform = ststm32
framework = arduino
board = genericSTM32F103VE
monitor_speed = 250000
extra_scripts = buildroot/share/PlatformIO/scripts/longer_STM32.py
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
${common.build_flags} -std=gnu++14 -USERIAL_USB
-DSTM32F1xx -DU20 -DTS_V12
Expand Down Expand Up @@ -543,9 +543,9 @@ src_filter = ${common.default_src_filter} +<src/HAL/HAL_TEENSY35_36>
monitor_speed = 250000

#
# Malyan M200 (STM32F1)
# Malyan M200 (STM32F103CB)
#
[env:malyanm200]
[env:STM32F103CB_malyan]
platform = ststm32
framework = arduino
board = malyanM200
Expand Down

0 comments on commit 74786a9

Please sign in to comment.