Fix optional board "extra_flags" and "ldscript"

This commit is contained in:
Valeriy Koval
2015-02-04 20:23:50 +02:00
parent 5a13454244
commit 9721172481
7 changed files with 31 additions and 38 deletions
@@ -43,7 +43,6 @@ env.Append(
]
)
#
# Target: Build Core Library
#
@@ -156,8 +156,8 @@ merge_ld_scripts(ldscript_path)
generate_nvic_files()
# override ldscript by opencm3
assert env['LINKFLAGS'][0] == "-T"
env['LINKFLAGS'][1] = ldscript_path
assert "-T" in env['LINKFLAGS']
env['LINKFLAGS'][env['LINKFLAGS'].index("-T") + 1] = ldscript_path
libs = []
env.VariantDir(
+1 -1
View File
@@ -50,7 +50,7 @@ if "STM32F40_41xxx" in extra_flags:
elif "STM32F303xC" in extra_flags:
ignore_files += ["stm32f30x_hrtim.c"]
elif "STM32L1XX_MD" in extra_flags:
ignore_files += ["stm32l1xx_flash_ramfunc.c"] # removed warning
ignore_files += ["stm32l1xx_flash_ramfunc.c"]
libs = []
libs.append(envsafe.BuildLibrary(
+14 -19
View File
@@ -48,6 +48,20 @@ env.Replace(
"-fno-exceptions"
],
CPPDEFINES=[
"F_CPU=$BOARD_F_CPU",
"${BOARD_OPTIONS['build']['variant'].upper()}"
],
LINKFLAGS=[
"-Os",
"-nostartfiles",
"-nostdlib",
"-Wl,--gc-sections",
"-mthumb",
"-mcpu=${BOARD_OPTIONS['build']['mcu']}"
],
UPLOADER=join("$PIOPACKAGES_DIR", "tool-stlink", "st-flash"),
UPLOADERFLAGS=[
"write", # write in flash
@@ -58,25 +72,6 @@ env.Replace(
UPLOADCMD="$UPLOADER $UPLOADERFLAGS"
)
env.Append(
CPPDEFINES=[
"F_CPU=$BOARD_F_CPU",
"${BOARD_OPTIONS['build']['variant'].upper()}"
]
)
env.Append(
LINKFLAGS=[
"-Os",
"-nostartfiles",
"-nostdlib",
"-Wl,--gc-sections",
"-mthumb",
"-mcpu=${BOARD_OPTIONS['build']['mcu']}"
]
)
if env.get("BOARD_OPTIONS", {}).get("build", {}).get("mcu")[-2:] == "m4":
env.Append(
ASFLAGS=[
+4 -6
View File
@@ -59,11 +59,6 @@ env.Replace(
"F_CPU=$BOARD_F_CPU"
],
UPLOADER=join("$PIOPACKAGES_DIR", "tool-lm4flash", "lm4flash"),
UPLOADCMD="$UPLOADER $SOURCES"
)
env.Append(
LINKFLAGS=[
"-Os",
"-nostartfiles",
@@ -74,7 +69,10 @@ env.Append(
"-mfloat-abi=hard",
"-mfpu=fpv4-sp-d16",
"-fsingle-precision-constant"
]
],
UPLOADER=join("$PIOPACKAGES_DIR", "tool-lm4flash", "lm4flash"),
UPLOADCMD="$UPLOADER $SOURCES"
)
env.Append(