Skip to content

Commit

Permalink
Merge branch 'release/v4.13.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed Aug 13, 2021
2 parents 036581a + c85cedd commit ceb3257
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
37 changes: 24 additions & 13 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,17 @@
platform = env.PioPlatform()
board_config = env.BoardConfig()

# Allow user to override via pre:script
if env.get("PROGNAME", "program") == "program":
env.Replace(PROGNAME="firmware")

env.Replace(
ARFLAGS=["rc"],

SIZEPROGREGEXP=r"^(?:\.text|\.data|\.rodata|\.text.align|\.ARM.exidx)\s+(\d+).*",
SIZEDATAREGEXP=r"^(?:\.data|\.bss|\.noinit)\s+(\d+).*",
SIZECHECKCMD="$SIZETOOL -A -d $SOURCES",

PROGSUFFIX=".elf"
)

# Allow user to override via pre:script
if env.get("PROGNAME", "program") == "program":
env.Replace(PROGNAME="firmware")

if "BOARD" in env and board_config.get("build.core") == "teensy":
build_core = board_config.get("build.core", "")
if "BOARD" in env and build_core == "teensy":
env.Replace(
AR="avr-ar",
AS="avr-as",
Expand All @@ -48,7 +44,7 @@
OBJCOPY="avr-objcopy",
RANLIB="avr-ranlib",
SIZETOOL="avr-size",
SIZEPRINTCMD='$SIZETOOL --mcu=$BOARD_MCU -C -d $SOURCES'
SIZEPRINTCMD="$SIZETOOL --mcu=$BOARD_MCU -C -d $SOURCES"
)

env.Append(
Expand Down Expand Up @@ -88,7 +84,7 @@
if not env.get("PIOFRAMEWORK"):
env.SConscript("frameworks/_bare_avr.py")

elif "BOARD" in env and board_config.get("build.core") in ("teensy3", "teensy4"):
elif "BOARD" in env and build_core in ("teensy3", "teensy4"):
env.Replace(
AR="arm-none-eabi-ar",
AS="arm-none-eabi-as",
Expand All @@ -98,7 +94,7 @@
OBJCOPY="arm-none-eabi-objcopy",
RANLIB="arm-none-eabi-gcc-ranlib",
SIZETOOL="arm-none-eabi-size",
SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES'
SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES"
)

env.Append(
Expand Down Expand Up @@ -132,6 +128,21 @@
if not env.get("PIOFRAMEWORK"):
env.SConscript("frameworks/_bare_arm.py")

# Default GCC's size tool
env.Replace(
SIZECHECKCMD="$SIZETOOL -A -d $SOURCES",
SIZEPROGREGEXP=r"^(?:\.text|\.text\.progmem|\.text\.itcm|\.data|\.text\.csf)\s+([0-9]+).*",
SIZEDATAREGEXP=r"^(?:\.usbdescriptortable|\.dmabuffers|\.usbbuffers|\.data|\.bss|\.noinit|\.text\.itcm|\.text\.itcm\.padding)\s+([0-9]+).*",
)

# Disable memory calculation and print output from custom "teensy_size" tool
if "arduino" in env.subst("$PIOFRAMEWORK") and build_core == "teensy4":
env.Replace(
SIZETOOL=None,
SIZECHECKCMD=None,
SIZEPRINTCMD="teensy_size $SOURCES",
)

#
# Target: Build executable and linkable firmware
#
Expand Down
2 changes: 1 addition & 1 deletion platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"type": "git",
"url": "https://github.com/platformio/platform-teensy.git"
},
"version": "4.13.0",
"version": "4.13.1",
"frameworks": {
"arduino": {
"package": "framework-arduinoteensy",
Expand Down
5 changes: 4 additions & 1 deletion platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ def configure_default_packages(self, variables, targets):
if del_toolchain in self.packages:
del self.packages[del_toolchain]

if "mbed" in variables.get("pioframework", []):
frameworks = variables.get("pioframework", [])
if "mbed" in frameworks:
self.packages["toolchain-gccarmnoneeabi"][
"version"] = ">=1.60301.0,<1.80000.0"
elif "arduino" in frameworks and board_config.get("build.core", "") == "teensy4":
self.packages["tool-teensy"]["optional"] = False

# configure J-LINK tool
jlink_conds = [
Expand Down

0 comments on commit ceb3257

Please sign in to comment.