forked from DeqingSun/ch55xduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform.txt
More file actions
195 lines (152 loc) · 9.82 KB
/
platform.txt
File metadata and controls
195 lines (152 loc) · 9.82 KB
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
# Arduino STM8 Core and platform.
# ------------------------------
#
# Part of the sduino project: https://github.com/tenbaht/sduino
# For more info on this file:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
name=STM8S Boards
version=0.4.0
# General folder structure variables
# ----------------------------------
# For Board Manager installs these variables are already predefined and will
# not be overwritten. This assignment is done only for manual installs.
#
# Apparently, this trick only works for compiler settings, not for the
# upload process. The upload process is not handled by arduino-build, but
# the IDE itself and behaves slightly differently.
# Problem is in Arduino/arduino-core/src/processing/app/BaseNoGui.java
# function createToolPreferences():
# PreferencesData.removeAllKeysWithPrefix(prefix);
# FIXME: find a solution to allow for uploads with manual installations.
runtime.tools.sdcc.path={runtime.hardware.path}/tools/sdcc
runtime.tools.STM8Tools.path={runtime.hardware.path}/tools
# STM8 compile variables
# ---------------------
compiler.warning_flags=
compiler.warning_flags.none=--less-pedantic
compiler.warning_flags.default=
compiler.warning_flags.more=-Wp-Wall
compiler.warning_flags.all=-Wp-Wall -V
# Default "compiler.path" is correct, change only if you want to override the initial value
compiler.path={runtime.tools.sdcc.path}/bin
compiler.wrapper.path={runtime.tools.STM8Tools.path}/wrapper
compiler.wrapper.path.windows={runtime.tools.STM8Tools.path}/win/busybox" ash "{runtime.tools.STM8Tools.path}/wrapper
compiler.tools.path={runtime.tools.avr-gcc.path}/bin
compiler.c.cmd=sdcc
compiler.c.wrapper=sdcc.sh
compiler.c.flags=-MMD -c -Ddouble=float -DUSE_STDINT -D__PROG_TYPES_COMPAT__ {compiler.warning_flags}
compiler.c.elf.flags=--code-size {upload.maximum_size} --iram-size {upload.maximum_data_size}
compiler.c.elf.cmd=sdcc
compiler.c.elf.wrapper=sdcc-link.sh
compiler.S.flags=-c -g -x assembler-with-cpp -flto
compiler.cpp.cmd=sdcc
compiler.cpp.wrapper=sdcc.sh
compiler.cpp.flags={compiler.c.flags}
compiler.ar.cmd=sdar
compiler.ar.wrapper=sdar.sh
compiler.ar.flags=rcs
compiler.objcopy.cmd=avr-objcopy
#compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
#compiler.objcopy.eep.flags=-O ihex -j EEPROM EEPROM=0
compiler.elf2hex.cmd=avr-objcopy
compiler.elf2hex.flags=-O ihex -R DATA -R INITIALIZED -R SSEG
compiler.syslibs.stdlib.path={runtime.tools.sdcc.path}/share/sdcc
compiler.syslibs.stdlib.path.windows={runtime.tools.sdcc.path}
compiler.syslibs.spl.path={runtime.platform.path}/STM8S_StdPeriph_Driver
compiler.ldflags=
compiler.size.cmd=avr-size
compiler.systemincludes="-I{compiler.syslibs.spl.path}/inc" "-I{compiler.syslibs.stdlib.path}/include"
# This can be overridden in boards.txt
build.extra_flags=
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
# STM8 compile patterns
# --------------------
## Compile c files (re1)
recipe.c.o.pattern="{compiler.wrapper.path}/{compiler.c.wrapper}" "{compiler.path}/{compiler.c.cmd}" "{source_file}" "{object_file}" re1 {compiler.c.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
## Compile c++ files (re2)
recipe.cpp.o.pattern="{compiler.wrapper.path}/{compiler.cpp.wrapper}" "{compiler.path}/{compiler.cpp.cmd}" "{source_file}" "{object_file}" re2 {compiler.cpp.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
##FIXME Compile S files (re3)
recipe.S.o.pattern="{compiler.path}/{compiler.c.cmd}" re3 {compiler.S.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Create archives (re4)
# 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.wrapper.path}/{compiler.ar.wrapper}" "{compiler.path}/{compiler.ar.cmd}" "{archive_file_path}" "{object_file}" re4 {compiler.ar.flags} {compiler.ar.extra_flags}
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.wrapper.path}/{compiler.c.elf.wrapper}" "{compiler.path}/{compiler.c.elf.cmd}" --nostdlib "-L{compiler.syslibs.spl.path}/lib" "-L{build.path}" "-L{compiler.syslibs.stdlib.path}/lib/stm8" {compiler.c.elf.flags} -mstm8 -D{build.mcu} {compiler.c.elf.extra_flags} {object_files} "{build.path}/{archive_file}" -l{build.mcu} -lstm8 --out-fmt-elf -o "{build.path}/{build.project_name}.elf"
## Create output files (.eep and .hex)
#recipe.objcopy.eep.pattern="{compiler.tools.path}/{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
recipe.objcopy.hex.pattern="{compiler.tools.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}.hex
recipe.output.save_file={build.project_name}.{build.variant}.hex
## Compute size
# flash usage = HOME + GSINIT + GSFINAL + CODE + INITIALIZER
# RAM usage = DATA + INITIALIZED
recipe.size.pattern="{compiler.tools.path}/{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:HOME|GSINIT|GSFINAL|CODE|INITIALIZER)\s+([0-9]+).*
recipe.size.regex.data=^(?:DATA|INITIALIZED)\s+([0-9]+).*
recipe.size.regex.eeprom=^(?:EEPROM)\s+([0-9]+).*
## Preprocessor (re11, re12)
preproc.includes.flags=-M -MG -MP
recipe.preproc.includes="{compiler.path.wrapper}/{compiler.cpp.wrapper}" "{compiler.path}/{compiler.cpp.cmd}" re11 {compiler.cpp.flags} {preproc.includes.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}"
preproc.macros.flags=-E -MC
recipe.preproc.macros="{compiler.wrapper.path}/{compiler.cpp.cmd}.sh" "{compiler.path}/{compiler.cpp.cmd}" "{source_file}" "{preprocessed_file_path}" re12 {compiler.cpp.flags} {preproc.macros.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
# stm8flash for STlink/v1 and STlink/v2
# -------------------------------------
tools.stm8flash.cmd=stm8flash
# these lines are for manual install. For board manager installs they get converted to use
# {runtime.tools.STM8Tools.path} instead of {runtime.hardware.path}/tools
tools.stm8flash.path={runtime.hardware.path}/tools/linux
tools.stm8flash.path.windows={runtime.hardware.path}/tools/win
tools.stm8flash.path.macosx={runtime.hardware.path}/tools/macosx
#tools.stm8flash.upload.params.verify=
tools.stm8flash.upload.params.verbose=
tools.stm8flash.upload.params.quiet=
tools.stm8flash.upload.pattern="{path}/{cmd}" -c{upload.protocol} -p{upload.mcu} -s flash -w "{build.path}/{build.project_name}.hex"
# erase: Unlock a write-protected MCU (this deletes all memories)
# Access this function in the IDE as Tools->Burn bootloader
tools.stm8flash.erase.params.verbose=
tools.stm8flash.erase.params.quiet=
tools.stm8flash.erase.pattern="{path}/{cmd}" -c{upload.protocol} -p{upload.mcu} -u
# dummy definition for programming a bootloader. Needed by the IDE.
tools.stm8flash.bootloader.params.verbose=
tools.stm8flash.bootloader.params.quiet=
tools.stm8flash.bootloader.pattern=echo "no bootloader available"
# Serial upload using the builtin bootloader
# ------------------------------------------
# Some parameter values are selected by the IDE according to preferences:
# - *.verify/*.params.noverify: referenced as {*.verify}
# - *.params.verbose/*.params.quiet: referenced as {*.verbose}
tools.stm8gal.cmd=stm8gal
# these lines are for manual install. For board manager installs they get converted to use
# {runtime.tools.STM8Tools.path} instead of {runtime.hardware.path}/tools
tools.stm8gal.path={runtime.hardware.path}/tools/linux
tools.stm8gal.path.windows={runtime.hardware.path}/tools/win
tools.stm8gal.path.macosx={runtime.hardware.path}/tools/macosx
tools.stm8gal.params.port=-p "{serial.port}"
tools.stm8gal.params.background=-B
tools.stm8gal.upload.command=-w "{build.path}/{build.project_name}.hex"
tools.stm8gal.upload.params.quiet=-v 0
tools.stm8gal.upload.params.verbose=-v 2
tools.stm8gal.upload.verify=
tools.stm8gal.upload.params.noverify=-V
tools.stm8gal.upload.pattern="{path}/{cmd}" {params.port} {params.reset} {params.background} {upload.verbose} {upload.verify} {upload.command}
# The program pattern is used for Sketch->upload using a Programmer
# Same as the upload pattern.
tools.stm8gal.program.command=-w "{build.path}/{build.project_name}.hex"
tools.stm8gal.program.params.quiet=-v 0
tools.stm8gal.program.params.verbose=-v 2
tools.stm8gal.program.verify=
tools.stm8gal.program.params.noverify=-V
tools.stm8gal.program.pattern="{path}/{cmd}" {params.port} {params.reset} {params.background} {program.verbose} {program.verify} {program.command}
tools.stm8gal.erase.command=-e
tools.stm8gal.erase.params.quiet=-v 0
tools.stm8gal.erase.params.verbose=-v 2
tools.stm8gal.erase.pattern="{path}/{cmd}" {params.port} {params.reset} {params.background} {erase.verbose} {erase.command}