Skip to content

Commit

Permalink
♻️ Refactor STM32 ini files (MarlinFirmware#22377)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
slowbro and thinkyhead committed Jul 20, 2021
1 parent eb7e244 commit 09d6229
Show file tree
Hide file tree
Showing 9 changed files with 411 additions and 423 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"build": {
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32F401xx",
"extra_flags": "-DSTM32F401xx -DARDUINO_STEVAL",
"f_cpu": "84000000L",
"hwids": [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"build": {
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32F407xx",
"extra_flags": "-DSTM32F407xx -DARDUINO_BLACK_F407VE",
"f_cpu": "168000000L",
"hwids": [
[
Expand Down
41 changes: 41 additions & 0 deletions ini/stm32-common.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Marlin Firmware
# PlatformIO Configuration File
#

####################################
#
# HAL/STM32 Common Environments
#
####################################

[common_stm32]
platform = ststm32@~12.1
board_build.core = stm32
build_flags = ${common.build_flags}
-std=gnu++14
-DUSBCON -DUSBD_USE_CDC
-DTIM_IRQ_PRIO=13
-DADC_RESOLUTION=12
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32> +<src/HAL/shared/backtrace>
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py

#
# STM32 board based on a variant.
#
[stm32_variant]
extends = common_stm32
extra_scripts = ${common_stm32.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
buildroot/share/PlatformIO/scripts/offset_and_rename.py

#
# USB Flash Drive mix-ins for STM32
#
[stm_flash_drive]
platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc-cdc-msc-3.zip
build_flags = ${common_stm32.build_flags}
-DHAL_PCD_MODULE_ENABLED -DHAL_HCD_MODULE_ENABLED
-DUSBHOST -DUSBH_IRQ_PRIO=3 -DUSBH_IRQ_SUBPRIO=4
10 changes: 6 additions & 4 deletions ini/stm32f0.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ platform = ${common_stm32.platform}
extends = common_stm32
board = marlin_malyanM200v2
build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED
-O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing
-DCUSTOM_STARTUP_FILE
-O2 -ffreestanding -fsigned-char -fno-move-loop-invariants
-fno-strict-aliasing -DCUSTOM_STARTUP_FILE

#
# Malyan M200 v2 (STM32F070CB)
Expand All @@ -38,7 +38,8 @@ platform = ${common_stm32.platform}
extends = common_stm32
board = malyanm200_f070cb
build_flags = ${common_stm32.build_flags}
-DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DCUSTOM_STARTUP_FILE
-DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB
-DHAL_UART_MODULE_ENABLED -DCUSTOM_STARTUP_FILE

#
# Malyan M300 (STM32F070CB)
Expand All @@ -48,5 +49,6 @@ platform = ${common_stm32.platform}
extends = common_stm32
board = malyanm300_f070cb
build_flags = ${common_stm32.build_flags}
-DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED
-DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB
-DHAL_UART_MODULE_ENABLED
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
Loading

0 comments on commit 09d6229

Please sign in to comment.