This repository was archived by the owner on Jan 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplatform.txt
155 lines (122 loc) · 8.62 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
# STM32F1xx ARM Core and platform.
# ------------------------------
#
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
name=STM32F1xx Boards
version=1.0.0
# STM compile variables
# ----------------------
compiler.libstm.c.flags="-I{build.system.path}/staticlibstm32f1" "-I{build.system.path}/staticlibstm32f1/include" "-I{build.system.path}/Drivers/STM32F1xx_HAL_Driver/Inc/" "-I{build.system.path}/Drivers/CMSIS/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/STM32F1xx/Include" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/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.c.cmd=arm-none-eabi-gcc
compiler.c.flags=-c -Os -g {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections --param max-inline-insns-single=500 -MMD {compiler.libstm.c.flags} {build.vect-offset}
compiler.c.elf.cmd=arm-none-eabi-gcc
compiler.c.elf.flags=-Os -g -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.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-c -x assembler-with-cpp {compiler.libstm.c.flags}
compiler.cpp.cmd=arm-none-eabi-g++
compiler.cpp.flags=-c -Os -g {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD {compiler.libstm.c.flags}
compiler.ar.cmd=arm-none-eabi-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2hex.flags=-O binary
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.ldflags=
compiler.size.cmd=arm-none-eabi-size
compiler.define=-DARDUINO=
# this can be overriden in boards.txt
build.extra_flags=
build.upload_flags=
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.cpp.extra_flags=
compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.elf2hex.extra_flags=
# 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"
# compile patterns
# ---------------------
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={build.mcu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.upload_flags} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={build.mcu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.upload_flags} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -mcpu={build.mcu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.upload_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}" -mcpu={build.mcu} -mthumb {compiler.c.elf.flags} {compiler.ldflags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--start-group "{build.path}/core/syscalls_stm32.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm --specs=nano.specs
## 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}.bin"
## Save hex
recipe.output.tmp_file={build.project_name}.bin
recipe.output.save_file={build.project_name}.{build.variant}.bin
## 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
# -------------------
#Upload to Nucleo via mass storage
tools.nucleoFlasher.path={runtime.tools.STM32Tools.path}/tools/win/nucleoFlasher
tools.nucleoFlasher.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx/nucleoFlasher
tools.nucleoFlasher.path.linux={runtime.tools.STM32Tools.path}/tools/linux/nucleoFlasher
tools.nucleoFlasher.cmd.linux=nucleoFlasher
tools.nucleoFlasher.cmd.windows=nucleoFlasher.bat
tools.nucleoFlasher.cmd.macosx=nucleoFlasherMacOsX
tools.nucleoFlasher.upload.params.verbose=
tools.nucleoFlasher.upload.params.quiet=
tools.nucleoFlasher.upload.pattern="{path}/{cmd}" {upload.verbose} -I "{build.path}/{build.project_name}.bin" -O "{node}"
# Upload using Maple bootloader over DFU
tools.maple_upload.cmd=maple_upload
tools.maple_upload.cmd.windows=maple_upload.bat
tools.maple_upload.path={runtime.tools.STM32Tools.path}/tools/win
tools.maple_upload.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
tools.maple_upload.path.linux={runtime.tools.STM32Tools.path}/tools/linux
tools.maple_upload.path.linux64={runtime.tools.STM32Tools.path}/tools/linux64
tools.maple_upload.upload.params.verbose=-d
tools.maple_upload.upload.params.quiet=
tools.maple_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
#Added tool for generic STM32 upload via serial to Serial Port 1 (pins PA9 and PA10) - note. Boot0 line needs to high on board reset to enable upload via serial
# at the end up the upload the program is automatically run, without the board being reset
tools.serial_upload.cmd=serial_upload
tools.serial_upload.cmd.windows=serial_upload.bat
tools.serial_upload.cmd.macosx=serial_upload
tools.serial_upload.path={runtime.tools.STM32Tools.path}/tools/win
tools.serial_upload.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
tools.serial_upload.path.linux={runtime.tools.STM32Tools.path}/tools/linux
tools.serial_upload.path.linux64={runtime.tools.STM32Tools.path}/tools/linux64
tools.serial_upload.upload.params.verbose=-d
tools.serial_upload.upload.params.quiet=n
tools.serial_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
# stlink upload
tools.stlink_upload.cmd=stlink_upload
tools.stlink_upload.cmd.windows=stlink_upload.bat
tools.stlink_upload.path.windows={runtime.tools.STM32Tools.path}/tools/win
tools.stlink_upload.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
tools.stlink_upload.path.linux={runtime.tools.STM32Tools.path}/tools/linux
tools.stlink_upload.path.linux64={runtime.tools.STM32Tools.path}/tools/linux64
tools.stlink_upload.upload.params.verbose=-d
tools.stlink_upload.upload.params.quiet=
tools.stlink_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
# blackmagic probe upload
tools.bmp_upload.cmd=arm-none-eabi-gdb
tools.bmp_upload.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
tools.bmp_upload.upload.speed=230400
tools.bmp_upload.upload.params.verbose=
tools.bmp_upload.upload.params.quiet=-q --batch-silent
tools.bmp_upload.upload.pattern="{path}{cmd}" -cd "{build.path}" -b {upload.speed} {upload.verbose} -ex "set debug remote 0" -ex "set target-async off" -ex "set remotetimeout 60" -ex "set mem inaccessible-by-default off" -ex "set confirm off" -ex "set height 0" -ex "target extended-remote {serial.port}" -ex "monitor swdp_scan" -ex "attach 1" -ex "x/wx 0x8000004" -ex "monitor erase_mass" -ex "echo 0x8000004 expect 0xffffffff after erase\n" -ex "x/wx 0x8000004" -ex "file {build.project_name}.elf" -ex "load" -ex "x/wx 0x08000004" -ex "tbreak main" -ex "run" -ex "echo \n\n\nUpload finished!" -ex "quit"