1
- # http://www.pjrc.com/teensy/teensyduino.html
2
1
name=Teensyduino
3
2
version=1.8.5
4
3
rewriting=disabled
5
4
6
- compiler.path={runtime.hardware.path}/../tools/
5
+ # Teensyduino Installer
6
+ #compiler.path={runtime.hardware.path}/../tools/
7
+ #teensytools.path={runtime.hardware.path}/../tools/
8
+
9
+ # Arduino Boards Manager
10
+ compiler.path={runtime.tools.teensy-compile.path}/
11
+ teensytools.path={runtime.tools.teensy-tools.path}/
12
+
13
+
14
+
15
+ ## EEPROM Data
7
16
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
8
17
compiler.elf2hex.flags=-O ihex -R .eeprom
9
18
compiler.libraries.ldflags=
@@ -20,7 +29,7 @@ tools.arduino-preprocessor.cmd.path={path}/arduino-preprocessor
20
29
tools.arduino-preprocessor.pattern="{cmd.path}" "{source_file}" "{codecomplete}" -- -std=gnu++14
21
30
22
31
## Precompile Arduino.h header
23
- recipe.hooks.sketch.prebuild.1.pattern="{compiler .path}precompile_helper" "{runtime.platform.path}/cores/{build.core}" "{build.path}" "{compiler.path}{build.toolchain}{build.command.g++}" -x c++-header {build.flags.optimize} {build.flags.common} {build.flags.dep} {build.flags.cpp} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} "-I{runtime.platform.path}/cores/{build.core}" "{build.path}/pch/Arduino.h" -o "{build.path}/pch/Arduino.h.gch"
32
+ recipe.hooks.sketch.prebuild.1.pattern="{teensytools .path}precompile_helper" "{runtime.platform.path}/cores/{build.core}" "{build.path}" "{compiler.path}{build.toolchain}{build.command.g++}" -x c++-header {build.flags.optimize} {build.flags.common} {build.flags.dep} {build.flags.cpp} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} "-I{runtime.platform.path}/cores/{build.core}" "{build.path}/pch/Arduino.h" -o "{build.path}/pch/Arduino.h.gch"
24
33
25
34
## Compile c++ files
26
35
recipe.cpp.o.pattern="{compiler.path}{build.toolchain}{build.command.g++}" -c {build.flags.optimize} {build.flags.common} {build.flags.dep} {build.flags.cpp} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} "-I{build.path}/pch" {includes} "{source_file}" -o "{object_file}"
@@ -37,46 +46,74 @@ recipe.ar.pattern="{compiler.path}{build.toolchain}{build.command.ar}" rcs "{arc
37
46
## Link
38
47
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.linker}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" {compiler.libraries.ldflags} "-L{build.path}" {build.flags.libs}
39
48
40
- ## Patch ELF - TODO: not supported by Arduino 1.6.6 builder
41
- recipe.elfpatch.pattern="{compiler .path}/hardware/tools /{build.elfpatch}" -mmcu={build.mcu} "{build.path}/{build.project_name}.elf" "{sketch_path}/disk"
49
+ ## Patch ELF - TODO: not supported by modern Arduino... :(
50
+ recipe.elfpatch.pattern="{teensytools .path}/{build.elfpatch}" -mmcu={build.mcu} "{build.path}/{build.project_name}.elf" "{sketch_path}/disk"
42
51
43
52
## Create eeprom
44
53
recipe.objcopy.eep.pattern="{compiler.path}{build.toolchain}{build.command.objcopy}" {compiler.objcopy.eep.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
45
54
46
55
## Create hex
47
56
recipe.objcopy.hex.pattern="{compiler.path}{build.toolchain}{build.command.objcopy}" {compiler.elf2hex.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
48
57
58
+ ## EHEX file - for Teensy 4.x secure mode
59
+ recipe.hooks.objcopy.postobjcopy.1.pattern="{teensytools.path}teensy_secure" encrypthex {build.board} "{build.path}/{build.project_name}.hex"
60
+
61
+
49
62
## Post Build - inform Teensy Loader of new file
50
- recipe.hooks.postbuild.1.pattern="{compiler.path}stdout_redirect" "{build.path}/{build.project_name}.lst" "{compiler.path}{build.toolchain}{build.command.objdump}" -d -S -C "{build.path}/{build.project_name}.elf"
51
- recipe.hooks.postbuild.2.pattern="{compiler.path}stdout_redirect" "{build.path}/{build.project_name}.sym" "{compiler.path}{build.toolchain}{build.command.objdump}" -t -C "{build.path}/{build.project_name}.elf"
52
- recipe.hooks.postbuild.3.pattern="{compiler.path}teensy_post_compile" "-file={build.project_name}" "-path={build.path}" "-tools={compiler.path}" "-board={build.board}"
63
+ recipe.hooks.postbuild.1.pattern="{teensytools.path}teensy_post_compile" "-file={build.project_name}" "-path={build.path}" "-tools={teensytools.path}" "-board={build.board}"
64
+ recipe.hooks.postbuild.2.pattern="{teensytools.path}stdout_redirect" "{build.path}/{build.project_name}.sym" "{compiler.path}{build.toolchain}{build.command.objdump}" -t -C "{build.path}/{build.project_name}.elf"
65
+ recipe.hooks.postbuild.3.pattern="{teensytools.path}teensy_size" "{build.path}/{build.project_name}.elf"
66
+ #
67
+ # objdump to create .lst file is VERY SLOW for huge files
68
+ # https://forum.pjrc.com/threads/68121?p=288306&viewfull=1#post288306
69
+ #
70
+ # recipe.hooks.postbuild.4.pattern="{teensytools.path}stdout_redirect" "{build.path}/{build.project_name}.lst" "{compiler.path}{build.toolchain}{build.command.objdump}" -d -S -C "{build.path}/{build.project_name}.elf"
71
+
53
72
54
73
## Compute size
55
74
recipe.size.pattern="{compiler.path}{build.toolchain}{build.command.size}" -A "{build.path}/{build.project_name}.elf"
56
- recipe.size.regex=^(?:\.text|\.text\.progmem|\.text\.itcm|\.data)\s+([0-9]+).*
75
+ recipe.size.regex=^(?:\.text|\.text\.progmem|\.text\.itcm|\.data|\.text\.csf )\s+([0-9]+).*
57
76
recipe.size.regex.data=^(?:\.usbdescriptortable|\.dmabuffers|\.usbbuffers|\.data|\.bss|\.noinit|\.text\.itcm|\.text\.itcm\.padding)\s+([0-9]+).*
58
77
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
59
78
60
- ## Teensy Ports Discovery (Arduino 1.8.9 with pathPrefs patch)
61
- discovery.teensy.pattern="{runtime.hardware.path}/../tools/teensy_ports" -J2
79
+ ## Teensy Ports Discovery
80
+ ## Arduino 1.8.9 requires pathPrefs patch
81
+ ## discovery patters have only limited support for substitution macros,
82
+ ## so we can not use {teensytools.path} or {compiler.path} here
83
+
84
+ # Teensyduino Installer
85
+ #discovery.teensy.pattern="{runtime.hardware.path}/../tools/teensy_ports" -J2
86
+
87
+ # Arduino Boards Manager
88
+ discovery.teensy.pattern="{runtime.tools.teensy-tools.path}/teensy_ports" -J2
89
+ pluggable_discovery.required=teensy:teensy-discovery
90
+ pluggable_monitor.required.teensy=teensy:teensy-monitor
62
91
63
- ## Teensy Ports Discovery (Arduino 1.8.9)
64
- #discovery.teensy.pattern="{runtime.ide.path}/hardware/tools/teensy_ports" -J2
65
92
66
93
## Teensy Loader
67
- tools.teensyloader.cmd.path={runtime.hardware.path}/../tools
94
+
95
+ # Teensyduino Installer
96
+ #tools.teensyloader.cmd.path={runtime.hardware.path}/../tools
97
+
98
+ # Arduino Boards Manager
99
+ tools.teensyloader.cmd.path={runtime.tools.teensy-tools.path}
100
+
68
101
tools.teensyloader.upload.params.quiet=
69
102
tools.teensyloader.upload.params.verbose=-verbose
70
103
tools.teensyloader.upload.pattern="{cmd.path}/teensy_post_compile" "-file={build.project_name}" "-path={build.path}" "-tools={cmd.path}" "-board={build.board}" -reboot "-port={serial.port}" "-portlabel={serial.port.label}" "-portprotocol={serial.port.protocol}"
71
104
105
+
106
+
107
+
72
108
## Export hex
73
109
recipe.output.tmp_file={build.project_name}.hex
74
110
recipe.output.save_file={build.project_name}.{build.board}.hex
111
+ recipe.hooks.savehex.postsavehex.1.pattern="{teensytools.path}teensy_secure" encrypthex {build.board} "{sketch_path}/{build.project_name}.{build.board}.hex"
75
112
76
113
# TODO: missing patch in 1.6.6...
77
114
recipe.output.tmp_file2={build.project_name}.elf
78
115
recipe.output.save_file2={build.project_name}.elf
79
116
80
117
81
118
# documentation on this file's format
82
- # https://github.com /arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware- specification
119
+ # https://arduino. github.io /arduino-cli/latest/platform- specification/
0 commit comments