Skip to content

Commit 291ff82

Browse files
committed
Add teeensy_secure support
1 parent 4af2ef0 commit 291ff82

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

builder/main.py

+19-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494
OBJCOPY="arm-none-eabi-objcopy",
9595
RANLIB="arm-none-eabi-gcc-ranlib",
9696
SIZETOOL="arm-none-eabi-size",
97-
SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES"
97+
SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES",
98+
TEENSYSECURE="teensy_secure"
9899
)
99100

100101
env.Append(
@@ -125,6 +126,21 @@
125126
)
126127
)
127128

129+
if build_core == "teensy4":
130+
env.Append(
131+
BUILDERS=dict(
132+
HexToEhex=Builder(
133+
action=env.VerboseAction(" ".join([
134+
"$TEENSYSECURE",
135+
"encrypthex",
136+
board_config.id.upper(),
137+
"$SOURCES"
138+
]), "Encrypting $TARGET"),
139+
suffix=".ehex"
140+
)
141+
)
142+
)
143+
128144
if not env.get("PIOFRAMEWORK"):
129145
env.SConscript("frameworks/_bare_arm.py")
130146

@@ -161,6 +177,8 @@
161177
else:
162178
target_elf = env.BuildProgram()
163179
target_firm = env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf)
180+
if build_core == "teensy4":
181+
target_firm = env.HexToEhex(join("$BUILD_DIR", "${PROGNAME}"), target_firm)
164182
env.Depends(target_firm, "checkprogsize")
165183

166184
AlwaysBuild(env.Alias("nobuild", target_firm))

0 commit comments

Comments
 (0)