Skip to content

Commit

Permalink
fix cli exec
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 14, 2024
1 parent 71e09fa commit 76371fe
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 43 deletions.
92 changes: 50 additions & 42 deletions buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py
Original file line number Diff line number Diff line change
@@ -1,56 +1,64 @@
#!/usr/bin/env python
#
# STM32F1_build_flags.py
# Add build_flags for the base STM32F1_maple environment (stm32f1-maple.ini)
#
from __future__ import print_function
import sys

# Dynamic build flags for generic compile options
if __name__ == "__main__":
args = " ".join([ "-std=gnu++14",
"-Os",
"-mcpu=cortex-m3",
"-mthumb",

"-fsigned-char",
"-fno-move-loop-invariants",
"-fno-strict-aliasing",
"-fsingle-precision-constant",
# Print these plus the given args when running directly on the command-line
args = " ".join([ "-std=gnu++14",
"-Os",
"-mcpu=cortex-m3",
"-mthumb",

"--specs=nano.specs",
"--specs=nosys.specs",
"-fsigned-char",
"-fno-move-loop-invariants",
"-fno-strict-aliasing",
"-fsingle-precision-constant",

"-IMarlin/src/HAL/STM32F1",
"--specs=nano.specs",
"--specs=nosys.specs",

"-MMD",
"-MP",
"-DTARGET_STM32F1"
])
"-MMD", "-MP",

for i in range(1, len(sys.argv)):
args += " " + sys.argv[i]
"-IMarlin/src/HAL/STM32F1",

print(args)
"-DTARGET_STM32F1",
"-DARDUINO_ARCH_STM32",
"-DPLATFORM_M997_SUPPORT"
])

args += " " + " ".join(sys.argv[1:])

print(args)

else:

# Extra script for stm32f1-maple.ini build_flags

import pioutil
if pioutil.is_pio_build():
pioutil.env.Append(
ARFLAGS=["rcs"],

ASFLAGS=["-x", "assembler-with-cpp"],

CXXFLAGS=[
"-fabi-version=0",
"-fno-use-cxa-atexit",
"-fno-threadsafe-statics"
],
LINKFLAGS=[
"-Os",
"-mcpu=cortex-m3",
"-ffreestanding",
"-mthumb",
"--specs=nano.specs",
"--specs=nosys.specs",
"-u_printf_float",
],
)
# Extra script for stm32f1-maple.ini build_flags

import pioutil
if pioutil.is_pio_build():
pioutil.env.Append(
ARFLAGS=["rcs"],

ASFLAGS=["-x", "assembler-with-cpp"],

CXXFLAGS=[
"-fabi-version=0",
"-fno-use-cxa-atexit",
"-fno-threadsafe-statics"
],
LINKFLAGS=[
"-Os",
"-mcpu=cortex-m3",
"-ffreestanding",
"-mthumb",
"--specs=nano.specs",
"--specs=nosys.specs",
"-u_printf_float",
],
)
2 changes: 1 addition & 1 deletion ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ build_unflags = -std=gnu11 -std=gnu++11
build_src_filter = ${common.default_src_filter} +<src/HAL/STM32F1> -<src/HAL/STM32F1/tft>
lib_ignore = SPI, FreeRTOS701, FreeRTOS821
lib_deps = ${common.lib_deps}
SoftwareSerialM
SoftwareSerialM
platform_packages = tool-stm32duino
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
Expand Down

0 comments on commit 76371fe

Please sign in to comment.