-
Notifications
You must be signed in to change notification settings - Fork 69
/
platform.txt
158 lines (125 loc) · 8.21 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# XMC platform
# ------------------------------
# For more info:
# https://arduino.github.io/arduino-cli/platform-specification/
# The information about this Arduino compatible environment
# ---------
name=XMC Family
version=3.0.0
# Build related core definitions
# ---------
build.core.path ={runtime.platform.path}/core
build.variant.path ={runtime.platform.path}/variants/{build.variant}
build.variant.config_path ={runtime.platform.path}/variants/{build.variant}/config/{build.board_variant}
build.flash_ld_path ={build.variant.path}/{build.flash_ld}
build.assembly_file ={build.variant.path}/Startup_{build.variant}.S
# Arduino boards.txt & Arduino IDE menu related definitions
# This can be overwritten/changed in boards.txt
# ---------
uart.selected=
build.menu_flags={uart.selected} {library.selected}
# Toolchain binaries
# ---------
compiler.path={runtime.tools.arm-none-eabi-gcc.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
# Toolchain definitions
# ---------
# Compiler definitions
compiler.warning_flags=-w
compiler.define=-DARDUINO=
# Compiler include paths for include files
compiler.xmclib_include.path={runtime.platform.path}/cores/xmc_lib
compiler.cmsis_include.path={compiler.xmclib_include.path}/CMSIS/Include
compiler.nn_include.path={compiler.xmclib_include.path}/CMSIS/NN/Include
compiler.dsp_include.path={compiler.xmclib_include.path}/CMSIS/DSP/Include
compiler.arm.cmsis.path= "-I{compiler.xmclib_include.path}/XMCLib/inc" "-I{compiler.dsp_include.path}" "-I{compiler.nn_include.path}" "-I{compiler.cmsis_include.path}" "-I{compiler.xmclib_include.path}/LIBS" "-I{build.variant.path}" "-I{build.variant.config_path}"
compiler.avr_support.path= "-I{build.core.path}/avr"
compiler.usb.path = "-I{runtime.platform.path}/cores/usblib" "-I{runtime.platform.path}/cores/usblib/Common" "-I{runtime.platform.path}/cores/usblib/Class" "-I{runtime.platform.path}/cores/usblib/Class/Common" "-I{runtime.platform.path}/cores/usblib/Class/Device" "-I{runtime.platform.path}/cores/usblib/Core" "-I{runtime.platform.path}/cores/usblib/Core/XMC4000"
# USB Flags
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
# Default usb manufacturer will be replaced at compile time using numeric vendor ID if available or by board's specific value.
build.usb_manufacturer="Unknown"
# GCC related definitions
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD
#compiler.c.extra_flags=-ftime-report
compiler.c.extra_flags=
compiler.libraries.ldflags=
compiler.c.elf.flags=-Os -Wl,--gc-sections -save-temps
compiler.c.elf.extra_flags=
# G++ related definitions
compiler.cpp.flags=-mcpu={build.mcu} -mthumb -fpermissive -c -g -Os {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD
#compiler.cpp.extra_flags=-ftime-report
compiler.cpp.extra_flags=
# Assembler related definitions
compiler.S.flags=-mcpu={build.mcu} -mthumb -c -g -x assembler-with-cpp
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=
# Compile patterns
# ----------------
## Compile C files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DXMC{build.board.version}_{build.board.type} -D{build.board_variant} -DF_CPU={build.f_cpu} -DARDUINO={build.board.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.menu_flags} {compiler.arm.cmsis.path} {compiler.avr_support.path} {compiler.usb.path} {includes} "{source_file}" -o "{object_file}"
## Compile C++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DXMC{build.board.version}_{build.board.type} -D{build.board_variant} -DF_CPU={build.f_cpu} -DARDUINO={build.board.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.menu_flags} {compiler.arm.cmsis.path} {compiler.avr_support.path} {compiler.usb.path} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DXMC{build.board.version}_{build.board.type} -D{build.board_variant} -DF_CPU={build.f_cpu} -DARDUINO={build.board.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.menu_flags} {compiler.arm.cmsis.path} {compiler.avr_support.path} {compiler.usb.path} {includes} "{source_file}" -o "{object_file}"
# Linker patterns
# ----------------
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -mthumb --specs=nosys.specs --specs=nano.specs -mcpu={build.mcu} {compiler.c.elf.flags} "-T{build.flash_ld_path}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align {object_files} "{build.path}/{archive_file}" {compiler.libraries.ldflags} -lm
## 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}"
# 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
# Debug patterns
debug.toolchain.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
debug.toolchain.prefix=arm-none-eabi-
debug.toolchain=gcc
debug.server=jlink
debug.server.jlink.script=
debug.server.jlink.path.windows=C:/Program Files/SEGGER/JLink/JLinkGDBServerCL
debug.server.jlink.path.linux=/opt/SEGGER/JLink/JLINKGDBServer
debug.cortex-debug.custom.device=XMC{build.board.version}-{build.board.v}
debug.executable={build.path}/{build.project_name}.elf
# Supported by Arduino offcially
# debug.server=openocd
# debug.server.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}/bin/openocd
# debug.server.openocd.scripts_dir={runtime.tools.openocd-0.10.0-arduino7.path}/share/openocd/scripts/
# debug.server.openocd.script={runtime.platform.path}/variants/{build.variant}/{build.openocdscript}
## 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]+).*
# ARM uploader/programmers tools
# ----------------
tools.xmcflasher.path={runtime.platform.path}/tools
tools.xmcflasher.cmd.path={path}/xmc-flasher.py
tools.xmcflasher.erase.params=-d XMC{build.board.version}-{build.board.v} -p {upload.port.address}
tools.xmcflasher.erase.pattern=python3 {cmd.path} erase {erase.params}
tools.xmcflasher.erase.pattern.windows=python {cmd.path} erase {erase.params}
tools.xmcflasher.upload.protocol=
tools.xmcflasher.upload.params.verbose=--verbose
tools.xmcflasher.upload.params.quiet=
tools.xmcflasher.upload.params=-d XMC{build.board.version}-{build.board.v} -p {upload.port.address} -f {build.path}/{build.project_name}.hex {upload.verbose}
tools.xmcflasher.upload.pattern=python3 {cmd.path} upload {upload.params}
tools.xmcflasher.upload.pattern.windows=python {cmd.path} upload {upload.params}