-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplatform.txt
125 lines (94 loc) · 5.61 KB
/
platform.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# PSOC™ 6 platform
# ------------------------------
# For more info:
# https://arduino.github.io/arduino-cli/platform-specification/
# The information about this Arduino compatible environment
# ---------
name=Infineon PSOC6 Boards
version=0.2.1
# Build related core definitions
# ---------
build.core.path={runtime.platform.path}/core
# Compiler and toolchain paths
# ---------
compiler.path={runtime.tools.mtb-gcc-arm-none-eabi.path}/bin/
compiler.c.cmd=arm-none-eabi-gcc
compiler.cpp.cmd=arm-none-eabi-g++
compiler.ar.cmd=arm-none-eabi-ar
compiler.size.cmd=arm-none-eabi-size
compiler.c.elf.cmd=arm-none-eabi-gcc
compiler.S.cmd=arm-none-eabi-gcc
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.elf2hex.cmd=arm-none-eabi-objcopy
# Compiler definitions
compiler.warning_flags=-w
compiler.define=-DARDUINO=
# Compiler include paths for include files
compiler.arduino_core.path={runtime.platform.path}/cores/psoc6/api
compiler.arduino_core_dep.path={compiler.arduino_core.path}/deprecated
compiler.arduino_core_dep_avr.path={compiler.arduino_core.path}/deprecated-avr-comp/avr
compiler.arduino_core_api.path= "-I{compiler.arduino_core_dep_avr.path}" "-I{compiler.arduino_core_dep.path}"
# GCC related definitions
# Some flags might not be required : -mtune={build.mcu}
compiler.c.flags= -c -g -Os {compiler.warning_flags} -std=gnu11 -nostdlib --param max-inline-insns-single=500 -MMD -DARDUINO={runtime.ide.version} -DARDUINO_ARCH_{build.arch}
compiler.c.extra_flags=
compiler.libraries.ldflags= -lstdc++
# linker options
compiler.c.elf.flags=-Os -Wl,-Map,{build.path}/{build.project_name}.map
compiler.cpp.elf.flags={compiler.c.elf.flags}
compiler.c.elf.extra_flags=
# G++ related definitions
compiler.cpp.flags= -fpermissive -c -g -Os {compiler.warning_flags} -std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DARDUINO={runtime.ide.version} -DARDUINO_ARCH_{build.arch}
compiler.cpp.extra_flags=
# Assembler related definitions
compiler.S.flags= -mthumb -c -g -x assembler-with-cpp -DARDUINO={runtime.ide.version} -DARDUINO_ARCH_{build.arch}
compiler.S.extra_flags=-w
# Archives & binaries related definitions
compiler.ar.flags=rcs
compiler.ar.extra_flags=
compiler.elf2hex.flags=-O ihex
compiler.elf2hex.extra_flags=
# Prebuild Hooks
# ----------------
# Builds the bsp mtb-lib and fetch the compiler and linker flags
hooks_prebuild_args=add-abs-paths {runtime.platform.path} {build.path} {build.variant}
recipe.hooks.prebuild.1.pattern.linux=bash {runtime.platform.path}/tools/mtb-lib.sh {hooks_prebuild_args}
recipe.hooks.prebuild.1.pattern.windows={runtime.platform.path}/tools/mtb-lib.cmd {hooks_prebuild_args}
compiler.flags.from_file=@{runtime.platform.path}/variants/{build.variant}/mtb-lib-cxx-flags.txt
compiler.elf_flags.from_file=@{build.path}/mtb-lib-linker-flags.txt
compiler.inc_dirs.from_file=@{build.path}/mtb-lib-inc-dirs.txt
# Includes
includes=-I{build.path}/cores/psoc6
# Build commands
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} "{compiler.flags.from_file}" {compiler.arduino_core_api.path} {compiler.inc_dirs.from_file} {compiler.c.extra_flags} {includes} "{source_file}" -o "{object_file}"
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} "{compiler.flags.from_file}" {compiler.arduino_core_api.path} {compiler.inc_dirs.from_file} {compiler.cpp.extra_flags} {includes} "{source_file}" -o "{object_file}"
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} "{compiler.flags.from_file}" {compiler.arduino_core_api.path} {compiler.inc_dirs.from_file} {includes} "{source_file}" -o "{object_file}"
## Create archives
# ----------------
# Archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
archive_file_path={build.path}/{archive_file}
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
# mtb library paths
compiler.mtb_lib.path = "{runtime.platform.path}/variants/{build.variant}/mtb-libs.a"
# Linker command
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.elf_flags.from_file} {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} {archive_file_path} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" {compiler.mtb_lib.path} {compiler.libraries.ldflags}
## Compute size
# ----------------
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A --common "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(\.text|\.eh_frame)\s+([0-9]+).*
# Recipe to show SRAM size used
recipe.size.regex.data=^(?:\.data|\.VENEER_Code|\.ram_code|\.bss|\.no_init|\Stack)\s+([0-9]+).*
# Create output files
# -------------------
## Create output (bin file)
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags}"{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
## Save hex
recipe.output.tmp_file={build.project_name}.bin
recipe.output.save_file={build.project_name}.{build.variant}.bin
# Upload .hex file
# ----------------
tools.openocd.upload.params.verbose=-v
tools.openocd.upload.params.quiet=
tools.openocd.upload.params.args=upload {runtime.tools.openocd.path} {runtime.platform.path} {build.path} {build.variant} {upload.port.properties.serialNumber} {upload.target.cfg} {build.project_name} {upload.verbose}
tools.openocd.upload.pattern.linux=bash {runtime.platform.path}/tools/upload.sh {upload.params.args}
tools.openocd.upload.pattern.windows={runtime.platform.path}/tools/upload.cmd {upload.params.args}