forked from stm32duino/Arduino_Core_STM32
-
Notifications
You must be signed in to change notification settings - Fork 7
/
platform.txt
222 lines (177 loc) · 12.3 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# STM32 ARM Core and platform.
# ------------------------------
#
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
name=MCCI Catena STM32 Boards
version=3.1.0
# STM compile variables
# ----------------------
compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{build.core.path}/stm32" "-I{build.core.path}/stm32/USB" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Inc/" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Src/" "-I{build.system.path}/{build.series}/" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Src"
# "-I{build.system.path}/Drivers/BSP/Components" "-I{build.system.path}/Middlewares/Third_Party/FatFs/src" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Src" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc"
compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra
compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
compiler.S.cmd=arm-none-eabi-gcc
compiler.c.cmd=arm-none-eabi-gcc
compiler.cpp.cmd=arm-none-eabi-g++
compiler.ar.cmd=arm-none-eabi-gcc-ar
compiler.c.elf.cmd=arm-none-eabi-gcc
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.elf2bin.flags=-O binary
compiler.elf2hex.flags=-O ihex
compiler.elf2hex.bin.flags=-O binary
compiler.elf2hex.hex.flags=-O ihex
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.suffix.cmd=dfu-suffix
compiler.suffix.cmd.windows=dfu-suffix.exe
compiler.extra_flags=-mcpu={build.mcu} -mthumb @{build.opt.path}
compiler.S.flags={compiler.extra_flags} -c -g -x assembler-with-cpp {compiler.stm.extra_include}
compiler.c.flags={compiler.extra_flags} -c -g {build.flags.optimize} {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -MMD {compiler.stm.extra_include}
compiler.cpp.flags={compiler.extra_flags} -c -g {build.flags.optimize} {compiler.warning_flags} -std={compiler.cpp.std} -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD {compiler.stm.extra_include}
compiler.ar.flags=rcs
compiler.c.elf.flags=-mcpu={build.mcu} -mthumb {build.flags.optimize} {build.flags.ldspecs} -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.ldflags={build.flags.ldspecs}
compiler.size.cmd=arm-none-eabi-size
compiler.define=-DARDUINO=
compiler.platform.path={runtime.platform.path}/tools/windows/
compiler.platform.path.macosx={runtime.platform.path}/tools/macosx/
compiler.platform.path.linux={runtime.platform.path}/tools/linux/
# These can be overriden in boards.txt
build.extra_flags=
build.ldscript=ldscript.ld
build.baseaddr=0x08000000
build.c.Werror=
build.cpp.Werror=
build.S.Werror=
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.cpp.extra_flags=
compiler.cpp.std=gnu++14
compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.elf2bin.extra_flags=
compiler.elf2hex.extra_flags=
compiler.libraries.ldflags=
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Source/Templates/gcc/"
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Lib/GCC/" -l{build.cmsis_lib_gcc}
# USB Flags
# ---------
build.usb_flags=-DUSBCON -DUSBD_VID={build.vid} -DUSBD_PID={build.pid} '-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"
build.usb_product="Unknown"
# Defaults config
build.xSerial=
build.enable_usb=
build.flags.optimize=
build.flags.ldspecs=
# Pre and post build hooks
build.opt.name=build_opt.h
build.opt.sourcepath={build.source.path}/{build.opt.name}
build.opt.path={build.path}/sketch/{build.opt.name}
# Create empty {build.opt} if not exists in the sketch dir
recipe.hooks.prebuild.1.pattern.windows=cmd /c if not exist "{build.opt.sourcepath}" mkdir "{build.path}\sketch" & type NUL > "{build.opt.path}"
recipe.hooks.prebuild.1.pattern.linux=bash -c "[ -f {build.opt.sourcepath} ] || (mkdir -p {build.path}/sketch && touch {build.opt.path})"
recipe.hooks.prebuild.1.pattern.macosx=bash -c "[ -f {build.opt.sourcepath} ] || (mkdir -p {build.path}/sketch && touch {build.opt.path})"
# sign the output file [harmless even if not using trusted bootloader]
recipe.hooks.linking.postlink.1.pattern="{mccibootloader_image.path}/{mccibootloader_image.cmd}" -v -t --sign --keyfile "{mccibootloader_keys.path}/{mccibootloader_keys.test}" --patch "{build.path}/{build.project_name}.elf"
# compile patterns
# ---------------------
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -D{build.series} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.c.Werror} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -D{build.series} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.cpp.Werror} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -D{build.series} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.S.Werror} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-z,max-page-size=4096" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.ldflags} {compiler.arm.cmsis.ldflags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--start-group {object_files} {compiler.libraries.ldflags} -Wl,--whole-archive "{archive_file_path}" -Wl,--no-whole-archive {compiler.c.elf.extra_flags} -lc -Wl,--end-group -lm -lgcc -lstdc++ --specs=nano.specs
## Create output (dfu file)
recipe.objcopy.dfu.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.bin.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.dfu"
## Append DFU suffix (dfu file)
recipe.hooks.objcopy.postobjcopy.1.pattern="{compiler.platform.path}/{compiler.suffix.cmd}" -v "{build.vid}" -p "{build.pid}" -d "{build.did}" -a "{build.path}/{build.project_name}.dfu"
recipe.output.tmp_file={build.project_name}.dfu
recipe.output.save_file={build.project_name}.{build.variant}.dfu
## Create output (.bin file)
recipe.objcopy.bin.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.elf2bin.flags} {compiler.elf2bin.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
## Save bin
recipe.output.tmp_file={build.project_name}.bin
recipe.output.save_file={build.project_name}.{build.variant}.bin
## Create output (.hex file)
recipe.objcopy.hex.pattern="{compiler.path}{compiler.objcopy.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}.hex
recipe.output.save_file={build.project_name}.{build.variant}.hex
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.text|\.data|\.rodata)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.bss|\._user_heap_stack)\s+([0-9]+).*
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
# Uploader tool
# -------------------
# ST-Link
tools.stlink_upload.cmd=stlink_upload
tools.stlink_upload.cmd.windows=stlink_upload.bat
tools.stlink_upload.path.windows={runtime.platform.path}/tools/windows
tools.stlink_upload.path.macosx={runtime.platform.path}/tools/macosx
tools.stlink_upload.path.linux={runtime.platform.path}/tools/linux
tools.stlink_upload.upload.params.verbose=-vx
tools.stlink_upload.upload.params.quiet=-nvx
tools.stlink_upload.upload.pattern="{path}/{cmd}" {upload.verbose} "{runtime.tools.STM32Tools.path}" "{build.path}/{build.project_name}.bin" {build.baseaddr}
tools.stlink_upload.bootloader.params.verbose=-vx
tools.stlink_upload.bootloader.params.quiet=-nvx
tools.stlink_upload.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} "{runtime.tools.STM32Tools.path}" "{runtime.platform.path}/bootloaders/{bootloader.file}.bin" 0x08000000
tools.stlink_upload.erase.params.verbose=
tools.stlink_upload.erase.params.quiet=
tools.stlink_upload.erase.pattern=
# ST-Link image + bootloader
tools.stlink_upload_bootloader.cmd=stlink_upload
tools.stlink_upload_bootloader.cmd.windows=stlink_upload.bat
tools.stlink_upload_bootloader.path.windows={runtime.platform.path}/tools/windows
tools.stlink_upload_bootloader.path.macosx={runtime.platform.path}/tools/macosx
tools.stlink_upload_bootloader.path.linux={runtime.platform.path}/tools/linux
tools.stlink_upload_bootloader.upload.params.verbose=-vx
tools.stlink_upload_bootloader.upload.params.quiet=-nvx
tools.stlink_upload_bootloader.upload.pattern="{path}/{cmd}" {upload.verbose} "{runtime.tools.STM32Tools.path}" "{build.path}/{build.project_name}.bin" {build.baseaddr} "{runtime.platform.path}/bootloaders/{bootloader.file}.bin"
# DFU
tools.stm32l0_dfu.cmd=stm32l0-upload
tools.stm32l0_dfu.cmd.windows=stm32l0-upload.bat
tools.stm32l0_dfu.path={runtime.platform.path}/tools/windows
tools.stm32l0_dfu.path.macosx={runtime.platform.path}/tools/macosx
tools.stm32l0_dfu.path.linux={runtime.platform.path}/tools/linux
tools.stm32l0_dfu.upload.params.verbose=-vx
tools.stm32l0_dfu.upload.params.quiet=-nvx
tools.stm32l0_dfu.upload.pattern="{path}/{cmd}" {upload.verbose} "{build.vid}" "{build.pid}" "{build.path}/{build.project_name}.dfu" "{build.baseaddr}"
tools.stm32l0_dfu.program.params.verbose=-vx
tools.stm32l0_dfu.program.params.quiet=-nvx
tools.stm32l0_dfu.program.pattern="{path}/{cmd}" {program.verbose} "{build.vid}" "{build.pid}" "{build.path}/{build.project_name}.dfu" "{build.baseaddr}"
tools.stm32l0_dfu.bootloader.params.verbose=-vx
tools.stm32l0_dfu.bootloader.params.quiet=-nvx
tools.stm32l0_dfu.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} "{build.vid}" "{build.pid}" "{runtime.platform.path}/bootloaders/{bootloader.file}.bin" 0x08000000
tools.stm32l0_dfu.erase.params.verbose=
tools.stm32l0_dfu.erase.params.quiet=
tools.stm32l0_dfu.erase.pattern=
# DFU plus bootloader (if enabled)
tools.stm32l0_dfu_bootloader.cmd=stm32l0-upload
tools.stm32l0_dfu_bootloader.cmd.windows=stm32l0-upload.bat
tools.stm32l0_dfu_bootloader.path={runtime.platform.path}/tools/windows
tools.stm32l0_dfu_bootloader.path.macosx={runtime.platform.path}/tools/macosx
tools.stm32l0_dfu_bootloader.path.linux={runtime.platform.path}/tools/linux
tools.stm32l0_dfu_bootloader.upload.params.verbose=-vx
tools.stm32l0_dfu_bootloader.upload.params.quiet=-nvx
tools.stm32l0_dfu_bootloader.upload.pattern="{path}/{cmd}" {upload.verbose} "{build.vid}" "{build.pid}" "{build.path}/{build.project_name}.dfu" "{build.baseaddr}" "{runtime.platform.path}/bootloaders/{bootloader.file}.bin"
# mcccibootloader_image
mccibootloader_image.cmd=mccibootloader_image
mccibootloader_image.path.windows={runtime.platform.path}/tools/mccibootloader/windows
mccibootloader_image.path.macosx={runtime.platform.path}/tools/mccibootloader/macosx
mccibootloader_image.path.linux={runtime.platform.path}/tools/mccibootloader/linux
mccibootloader_keys.path={runtime.platform.path}/tools/mccibootloader/keys
mccibootloader_keys.test=mcci-test.pem