Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up and refactor pio stm32 includes #22377

Merged
merged 4 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
-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