forked from platformio/platformio-core
Add SPL support for nucleo_f401re // Resolve #453
This commit is contained in:
@ -273,14 +273,14 @@
|
||||
"nucleo_f401re": {
|
||||
"build": {
|
||||
"core": "stm32",
|
||||
"extra_flags": "-DSTM32F4 -DSTM32F401xE",
|
||||
"extra_flags": "-DSTM32F4 -DSTM32F401xE -DSTM32F40_41xxx",
|
||||
"f_cpu": "84000000L",
|
||||
"ldscript": "stm32f401xe.ld",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32f401ret6",
|
||||
"variant": "stm32f401xe"
|
||||
},
|
||||
"frameworks": ["cmsis", "mbed"],
|
||||
"frameworks": ["mbed", "cmsis", "spl"],
|
||||
"name": "ST Nucleo F401RE",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
|
@ -23,7 +23,7 @@ directly with the registers.
|
||||
http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743?sc=stm32embeddedsoftware
|
||||
"""
|
||||
|
||||
from os.path import join
|
||||
from os.path import isfile, join
|
||||
|
||||
from SCons.Script import DefaultEnvironment
|
||||
|
||||
@ -70,6 +70,23 @@ envsafe.Append(
|
||||
# Target: Build SPL Library
|
||||
#
|
||||
|
||||
# use mbed ldscript with bootloader section
|
||||
ldscript = env.get("BOARD_OPTIONS", {}).get("build", {}).get("ldscript")
|
||||
if not isfile(join(env.subst("$PIOPACKAGES_DIR"), "ldscripts", ldscript)):
|
||||
if "mbed" in env.get("BOARD_OPTIONS", {}).get("frameworks", {}):
|
||||
env.Append(
|
||||
LINKFLAGS=[
|
||||
'-Wl,-T"%s"' %
|
||||
join(
|
||||
"$PIOPACKAGES_DIR", "framework-mbed", "variant",
|
||||
env.subst("$BOARD").upper(), "mbed",
|
||||
"TARGET_%s" % env.subst(
|
||||
"$BOARD").upper(), "TOOLCHAIN_GCC_ARM",
|
||||
"%s.ld" % ldscript.upper()[:-3]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
extra_flags = env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags")
|
||||
src_filter_patterns = ["+<*>"]
|
||||
if "STM32F40_41xxx" in extra_flags:
|
||||
|
Reference in New Issue
Block a user