Skip to content

Commit 036581a

Browse files
committed
Merge branch 'release/v4.13.0'
2 parents 8491e99 + b1290f7 commit 036581a

File tree

9 files changed

+99
-22
lines changed

9 files changed

+99
-22
lines changed

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os: [ubuntu-16.04, windows-latest, macos-latest]
11-
python-version: [2.7, 3.7]
11+
python-version: [3.7]
1212
example:
1313
- "examples/arduino-blink"
1414
- "examples/arduino-hid-usb-mouse"

boards/teensy40.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"maximum_size": 2031616,
2525
"protocol": "teensy-gui",
2626
"protocols": [
27+
"teensy-cli",
2728
"teensy-gui",
2829
"jlink"
2930
]

boards/teensy41.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"maximum_size": 8126464,
2525
"protocol": "teensy-gui",
2626
"protocols": [
27+
"teensy-cli",
2728
"teensy-gui",
2829
"jlink"
2930
]

boards/teensymm.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "imxrt1062_mm.ld"
5+
},
6+
"core": "teensy4",
7+
"cpu": "cortex-m7",
8+
"extra_flags": "-D__IMXRT1062__ -DARDUINO_TEENSY_MICROMOD",
9+
"f_cpu": "600000000",
10+
"mcu": "imxrt1062"
11+
},
12+
"connectivity": [
13+
"can"
14+
],
15+
"debug": {
16+
"jlink_device": "MIMXRT1062xxxxA"
17+
},
18+
"frameworks": [
19+
"arduino"
20+
],
21+
"name": "SparkFun MicroMod Teensy",
22+
"upload": {
23+
"maximum_ram_size": 524288,
24+
"maximum_size": 8126464,
25+
"protocol": "teensy-gui",
26+
"protocols": [
27+
"teensy-cli",
28+
"teensy-gui",
29+
"jlink"
30+
]
31+
},
32+
"url": "https://www.sparkfun.com/products/16402",
33+
"vendor": "SparkFun"
34+
}

builder/frameworks/arduino.py

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
env.Append(CPPDEFINES=["USB_SERIAL"])
6767

6868
env.Replace(
69-
SIZEPROGREGEXP=r"^(?:\.text|\.text\.progmem|\.text\.itcm|\.data)\s+([0-9]+).*",
69+
SIZEPROGREGEXP=r"^(?:\.text|\.text\.progmem|\.text\.itcm|\.data|\.text\.csf)\s+([0-9]+).*",
7070
SIZEDATAREGEXP=r"^(?:\.usbdescriptortable|\.dmabuffers|\.usbbuffers|\.data|\.bss|\.noinit|\.text\.itcm|\.text\.itcm\.padding)\s+([0-9]+).*"
7171
)
7272

@@ -157,8 +157,7 @@
157157
"-Wl,--gc-sections,--relax",
158158
"-mthumb",
159159
"-mcpu=%s" % env.BoardConfig().get("build.cpu"),
160-
"-Wl,--defsym=__rtc_localtime=$UNIX_TIME",
161-
"-fsingle-precision-constant"
160+
"-Wl,--defsym=__rtc_localtime=$UNIX_TIME"
162161
],
163162

164163
LIBS=["m", "stdc++"]
@@ -167,10 +166,17 @@
167166
if not env.BoardConfig().get("build.ldscript", ""):
168167
env.Replace(LDSCRIPT_PATH=env.BoardConfig().get("build.arduino.ldscript", ""))
169168

170-
if env.BoardConfig().id_ in ("teensy35", "teensy36", "teensy40", "teensy41"):
169+
if env.BoardConfig().id_ in (
170+
"teensy35",
171+
"teensy36",
172+
"teensy40",
173+
"teensy41",
174+
"teensymm",
175+
):
171176
fpv_version = "4-sp"
172-
if env.BoardConfig().id_.startswith("teensy4"):
177+
if env.BoardConfig().id_.startswith(("teensy4", "teensymm")):
173178
fpv_version = "5"
179+
env.Append(CXXFLAGS=["-fno-threadsafe-statics"])
174180

175181
env.Append(
176182
CCFLAGS=[
@@ -262,24 +268,38 @@
262268
LINKFLAGS=["-O2"]
263269
)
264270

265-
env.Append(
266-
ASFLAGS=env.get("CCFLAGS", [])[:]
267-
)
268271

269-
if "cortex-m" in env.BoardConfig().get("build.cpu", ""):
272+
cpu = env.BoardConfig().get("build.cpu", "")
273+
if "cortex-m" in cpu:
270274
board = env.subst("$BOARD")
271275
math_lib = "arm_cortex%s_math"
272276
if board in ("teensy35", "teensy36"):
273277
math_lib = math_lib % "M4lf"
274278
elif board in ("teensy30", "teensy31"):
275279
math_lib = math_lib % "M4l"
276-
elif board.startswith("teensy4"):
280+
elif board.startswith(("teensy4", "teensymm")):
277281
math_lib = math_lib % "M7lfsp"
278282
else:
279283
math_lib = math_lib % "M0l"
280284

281285
env.Prepend(LIBS=[math_lib])
282286

287+
if cpu.startswith(("cortex-m4", "cortex-m0")):
288+
env.Append(
289+
CCFLAGS=[
290+
"-mno-unaligned-access",
291+
"-fsingle-precision-constant"
292+
],
293+
294+
LINKFLAGS=[
295+
"-fsingle-precision-constant"
296+
]
297+
)
298+
299+
env.Append(
300+
ASFLAGS=env.get("CCFLAGS", [])[:]
301+
)
302+
283303
# Teensy 2.x Core
284304
if BUILD_CORE == "teensy":
285305
env.Append(CPPPATH=[join(FRAMEWORK_DIR, "cores")])

builder/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
else:
144144
target_elf = env.BuildProgram()
145145
target_firm = env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf)
146+
env.Depends(target_firm, "checkprogsize")
146147

147148
AlwaysBuild(env.Alias("nobuild", target_firm))
148149
target_buildprog = env.Alias("buildprog", target_firm, target_firm)
@@ -188,7 +189,7 @@ def _jlink_cmd_script(env, source):
188189
UPLOADER="JLink.exe" if system() == "Windows" else "JLinkExe",
189190
UPLOADERFLAGS=[
190191
"-device", board_config.get("debug", {}).get("jlink_device"),
191-
"-speed", "4000",
192+
"-speed", env.GetProjectOption("debug_speed", "4000"),
192193
"-if", ("jtag" if upload_protocol == "jlink-jtag" else "swd"),
193194
"-autoconnect", "1",
194195
"-NoGui", "1"

examples/arduino-internal-libs/platformio.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,8 @@ board = teensy40
5151
platform = teensy
5252
framework = arduino
5353
board = teensy41
54+
55+
[env:teensymm]
56+
platform = teensy
57+
framework = arduino
58+
board = teensymm

platform.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"type": "git",
2020
"url": "https://github.com/platformio/platform-teensy.git"
2121
},
22-
"version": "4.12.0",
22+
"version": "4.13.0",
2323
"frameworks": {
2424
"arduino": {
2525
"package": "framework-arduinoteensy",
@@ -35,7 +35,8 @@
3535
"type": "toolchain",
3636
"optional": false,
3737
"owner": "platformio",
38-
"version": "~1.50400.0"
38+
"version": "~1.50400.0",
39+
"optionalVersions": [">=1.60301.0,<1.80000.0"]
3940
},
4041
"toolchain-gccarmnoneeabi": {
4142
"type": "toolchain",
@@ -47,7 +48,7 @@
4748
"type": "framework",
4849
"optional": true,
4950
"owner": "platformio",
50-
"version": "~1.153.0"
51+
"version": "~1.154.0"
5152
},
5253
"framework-mbed": {
5354
"type": "framework",

platform.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from platform import system
15+
import copy
16+
import platform
1617

1718
from platformio.managers.platform import PlatformBase
1819

@@ -30,7 +31,7 @@ def configure_default_packages(self, variables, targets):
3031

3132
if "mbed" in variables.get("pioframework", []):
3233
self.packages["toolchain-gccarmnoneeabi"][
33-
'version'] = ">=1.60301.0,<1.80000.0"
34+
"version"] = ">=1.60301.0,<1.80000.0"
3435

3536
# configure J-LINK tool
3637
jlink_conds = [
@@ -66,12 +67,12 @@ def _add_default_debug_tools(self, board):
6667
upload_protocols = board.manifest.get("upload", {}).get(
6768
"protocols", [])
6869
if "tools" not in debug:
69-
debug['tools'] = {}
70+
debug["tools"] = {}
7071

71-
if "jlink" in upload_protocols and "jlink" not in debug['tools']:
72+
if "jlink" in upload_protocols and "jlink" not in debug["tools"]:
7273
assert debug.get("jlink_device"), (
7374
"Missed J-Link Device ID for %s" % board.id)
74-
debug['tools']['jlink'] = {
75+
debug["tools"]["jlink"] = {
7576
"server": {
7677
"package": "tool-jlink",
7778
"arguments": [
@@ -82,10 +83,23 @@ def _add_default_debug_tools(self, board):
8283
"-port", "2331"
8384
],
8485
"executable": ("JLinkGDBServerCL.exe"
85-
if system() == "Windows" else
86+
if platform.system() == "Windows" else
8687
"JLinkGDBServer")
8788
}
8889
}
8990

90-
board.manifest['debug'] = debug
91+
board.manifest["debug"] = debug
9192
return board
93+
94+
def configure_debug_options(self, initial_debug_options, ide_data):
95+
debug_options = copy.deepcopy(initial_debug_options)
96+
adapter_speed = initial_debug_options.get("speed")
97+
if adapter_speed:
98+
server_options = debug_options.get("server") or {}
99+
server_executable = server_options.get("executable", "").lower()
100+
if "jlink" in server_executable:
101+
debug_options["server"]["arguments"].extend(
102+
["-speed", adapter_speed]
103+
)
104+
105+
return debug_options

0 commit comments

Comments
 (0)