-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
platform.txt
157 lines (120 loc) · 8.25 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
# Arduino CH55x Core and platform.
# ------------------------------
#
# Part of the ch55xduino project: https://github.com/DeqingSun/ch55xduino
# For more info on this file:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
name=CH55x Boards
version=0.1.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.MCS51Tools.path={runtime.hardware.path}/tools
# CH55x 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.MCS51Tools.path}/wrapper
compiler.wrapper.path.windows={runtime.tools.MCS51Tools.path}/win/busybox" ash "{runtime.tools.MCS51Tools.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} --xram-size {upload.maximum_data_size} --xram-loc {upload.xdata_location}
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=
compiler.ldflags=
#we use mem file directly, because we don't need to use size command
compiler.size.cmd=cat
compiler.size.cmd.windows={runtime.tools.MCS51Tools.path}/win/busybox" cat "
compiler.systemincludes="-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=
# MCS51 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} -mmcs51 -D{build.mcu} -DF_CPU={build.f_cpu} -DF_EXT_OSC={build.f_oscillator_external} -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} -mmcs51 -D{build.mcu} -DF_CPU={build.f_cpu} -DF_EXT_OSC={build.f_oscillator_external} -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} -mmcs51 -D{build.mcu} -DF_CPU={build.f_cpu} -DF_EXT_OSC={build.f_oscillator_external} -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{build.path}" "-L{compiler.syslibs.stdlib.path}/lib/small" {compiler.c.elf.flags} -mmcs51 -D{build.mcu} {compiler.c.elf.extra_flags} {object_files} "{build.path}/{archive_file}" -lmcs51 -llibsdcc -lliblong -lliblonglong -llibint -llibfloat --out-fmt-ihx -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.size.cmd}" "{build.path}/{build.project_name}.mem"
recipe.size.regex=^(?:\s+ROM\/EPROM\/FLASH)\s+0x[A-Fa-f0-9]+\s+0x[A-Fa-f0-9]+\s+([0-9]+).*
recipe.size.regex.data=^(?:\s+EXTERNAL RAM)\s+0x[A-Fa-f0-9]+\s+0x[A-Fa-f0-9]+\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} -mmcs51 -D{build.mcu} -DF_CPU={build.f_cpu} -DF_EXT_OSC={build.f_oscillator_external} -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} -mmcs51 -D{build.mcu} -DF_CPU={build.f_cpu} -DF_EXT_OSC={build.f_oscillator_external} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
# vnproch55x
# -------------------------------------
tools.vnproch55x_usb.cmd=vnproch55x
# these lines are for manual install. For board manager installs they get converted to use
# {runtime.tools.MCS51Tools.path} instead of {runtime.hardware.path}/tools
tools.vnproch55x_usb.path={runtime.tools.MCS51Tools.path}/linux
tools.vnproch55x_usb.path.windows={runtime.tools.MCS51Tools.path}/win
tools.vnproch55x_usb.path.macosx={runtime.tools.MCS51Tools.path}/macosx
tools.vnproch55x_usb.upload.params.verbose=
tools.vnproch55x_usb.upload.params.quiet=
tools.vnproch55x_usb.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.hex" -r2
# ----
tools.vnproch55x_serial.cmd=vnproch55x
tools.vnproch55x_serial.path={runtime.tools.MCS51Tools.path}/linux
tools.vnproch55x_serial.path.windows={runtime.tools.MCS51Tools.path}/win
tools.vnproch55x_serial.path.macosx={runtime.tools.MCS51Tools.path}/macosx
tools.vnproch55x_serial.upload.params.verbose=
tools.vnproch55x_serial.upload.params.quiet=
tools.vnproch55x_serial.upload.pattern="{path}/{cmd}" -s{serial.port} "{build.path}/{build.project_name}.hex"