Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 1882f2c

Browse files
authored
Update Packages_Patches
1 parent 446d873 commit 1882f2c

File tree

3 files changed

+436
-0
lines changed
  • Packages_Patches
    • arduino/hardware/samd/1.8.12
    • industrialshields/hardware/avr
      • 1.1.36/cores/industrialshields
      • 1.1.37/cores/industrialshields

3 files changed

+436
-0
lines changed
Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
2+
#
3+
# This library is free software; you can redistribute it and/or
4+
# modify it under the terms of the GNU Lesser General Public
5+
# License as published by the Free Software Foundation; either
6+
# version 2.1 of the License, or (at your option) any later version.
7+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
# See the GNU Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public
14+
# License along with this library; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16+
17+
# Arduino SAMD Core and platform.
18+
#
19+
# For more info:
20+
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
21+
22+
name=Arduino SAMD (32-bits ARM Cortex-M0+) Boards
23+
version=1.8.12
24+
25+
# Compile variables
26+
# -----------------
27+
28+
compiler.warning_flags=-w
29+
compiler.warning_flags.none=-w
30+
compiler.warning_flags.default=
31+
compiler.warning_flags.more=-Wall
32+
compiler.warning_flags.all=-Wall -Wextra
33+
34+
# EXPERIMENTAL feature: optimization flags
35+
# - this is alpha and may be subject to change without notice
36+
compiler.optimization_flags=-Os
37+
compiler.optimization_flags.release=-Os
38+
compiler.optimization_flags.debug=-Og -g3
39+
40+
compiler.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
41+
compiler.c.cmd=arm-none-eabi-gcc
42+
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.optimization_flags} {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD
43+
compiler.c.elf.cmd=arm-none-eabi-g++
44+
compiler.c.elf.flags={compiler.optimization_flags} -Wl,--gc-sections -save-temps
45+
compiler.S.cmd=arm-none-eabi-gcc
46+
compiler.S.flags=-mcpu={build.mcu} -mthumb -c -g -x assembler-with-cpp -MMD
47+
compiler.cpp.cmd=arm-none-eabi-g++
48+
compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.optimization_flags} {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
49+
compiler.ar.cmd=arm-none-eabi-ar
50+
compiler.ar.flags=rcs
51+
compiler.objcopy.cmd=arm-none-eabi-objcopy
52+
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
53+
compiler.elf2hex.bin.flags=-O binary
54+
compiler.elf2hex.hex.flags=-O ihex -R .eeprom
55+
compiler.elf2hex.cmd=arm-none-eabi-objcopy
56+
compiler.ldflags=-mcpu={build.mcu} -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align
57+
compiler.size.cmd=arm-none-eabi-size
58+
compiler.define=-DARDUINO=
59+
compiler.readelf.cmd=arm-none-eabi-readelf
60+
61+
# this can be overriden in boards.txt
62+
build.extra_flags=
63+
64+
# These can be overridden in platform.local.txt
65+
compiler.c.extra_flags=
66+
compiler.c.elf.extra_flags=
67+
#compiler.c.elf.extra_flags=-v
68+
compiler.cpp.extra_flags=
69+
compiler.S.extra_flags=
70+
compiler.ar.extra_flags=
71+
compiler.elf2hex.extra_flags=
72+
73+
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.0.path}/CMSIS/Device/ATMEL/"
74+
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Lib/GCC/" -larm_cortexM0l_math
75+
76+
compiler.libraries.ldflags=
77+
78+
# USB Flags
79+
# ---------
80+
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
81+
82+
# Default usb manufacturer will be replaced at compile time using
83+
# numeric vendor ID if available or by board's specific value.
84+
build.usb_manufacturer="Unknown"
85+
86+
# Compile patterns
87+
# ----------------
88+
89+
## Compile c files
90+
## KH Add -DBOARD_NAME="{build.board}"
91+
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "{source_file}" -o "{object_file}"
92+
93+
## Compile c++ files
94+
## KH Add -DBOARD_NAME="{build.board}"
95+
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "{source_file}" -o "{object_file}"
96+
97+
## Compile S files
98+
## KH Add -DBOARD_NAME="{build.board}"
99+
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "{source_file}" -o "{object_file}"
100+
101+
## Create archives
102+
# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
103+
archive_file_path={build.path}/{archive_file}
104+
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
105+
106+
## Combine gc-sections, archives, and objects
107+
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} -Wl,--start-group {compiler.arm.cmsis.ldflags} -lm "{build.path}/{archive_file}" -Wl,--end-group
108+
109+
## Create output (bin file)
110+
recipe.objcopy.bin.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}.bin"
111+
112+
## Create output (hex file)
113+
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
114+
115+
build.preferred_out_format=bin
116+
117+
## Save hex
118+
recipe.output.tmp_file={build.project_name}.{build.preferred_out_format}
119+
recipe.output.save_file={build.project_name}.{build.variant}.{build.preferred_out_format}
120+
121+
## Compute size
122+
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
123+
recipe.size.regex=^(?:\.text|\.data|)\s+([0-9]+).*
124+
recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).*
125+
126+
# Required discoveries and monitors
127+
# ---------------------------------
128+
pluggable_discovery.required.0=builtin:serial-discovery
129+
pluggable_discovery.required.1=builtin:mdns-discovery
130+
pluggable_monitor.required.serial=builtin:serial-monitor
131+
132+
# Debugger configuration (general options)
133+
# ----------------------------------------
134+
# EXPERIMENTAL feature:
135+
# - this is alpha and may be subject to change without notice
136+
debug.executable={build.path}/{build.project_name}.elf
137+
debug.toolchain=gcc
138+
debug.toolchain.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
139+
debug.toolchain.prefix=arm-none-eabi-
140+
debug.server=openocd
141+
debug.server.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}/bin/openocd
142+
debug.server.openocd.scripts_dir={runtime.tools.openocd-0.10.0-arduino7.path}/share/openocd/scripts/
143+
debug.server.openocd.script={runtime.platform.path}/variants/{build.variant}/{build.openocdscript}
144+
145+
# Upload/Debug tools
146+
# ------------------
147+
148+
#
149+
# AVRDUDE
150+
#
151+
tools.avrdude.path={runtime.tools.avrdude.path}
152+
tools.avrdude.cmd={path}/bin/avrdude
153+
tools.avrdude.config.path={path}/etc/avrdude.conf
154+
155+
tools.avrdude.upload.params.verbose=-v -v
156+
tools.avrdude.upload.params.quiet=-q -q
157+
tools.avrdude.upload.params.noverify=-V
158+
tools.avrdude.upload.pattern="{cmd}" "-C{config.path}" {upload.verbose} -p{build.emu.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} "-Uflash:w:{build.path}/{build.project_name}.hex:i"
159+
160+
tools.avrdude_remote.upload.pattern="openocd --version 2>&1 | grep 2016 && if opkg update; then opkg upgrade openocd; exit 1; else echo 'Please connect your board to the Internet in order to upgrade tools' >&2; exit 1; fi || /usr/bin/run-avrdude /tmp/sketch.hex"
161+
162+
# the following rule is deprecated by pluggable discovery
163+
tools.avrdude.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
164+
165+
#
166+
# BOSSA
167+
#
168+
tools.bossac.path={runtime.tools.bossac-1.7.0-arduino3.path}
169+
tools.bossac.cmd=bossac
170+
tools.bossac.cmd.windows=bossac.exe
171+
172+
tools.bossac.upload.params.verbose=-i -d
173+
tools.bossac.upload.params.quiet=
174+
tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -i -e -w -v "{build.path}/{build.project_name}.bin" -R
175+
176+
tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R
177+
178+
# the following rule is deprecated by pluggable discovery
179+
tools.bossac.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b {arduinoota.extraflags}
180+
181+
#
182+
# BOSSA (ignore binary size)
183+
#
184+
tools.bossacI.path={runtime.tools.bossac-1.7.0-arduino3.path}
185+
tools.bossacI.cmd=bossac
186+
tools.bossacI.cmd.windows=bossac.exe
187+
188+
tools.bossacI.upload.params.verbose=-i -d
189+
tools.bossacI.upload.params.quiet=
190+
tools.bossacI.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -I -U {upload.native_usb} -i -e -w "{build.path}/{build.project_name}.bin" -R
191+
192+
tools.bossacI_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R
193+
194+
# the following rule is deprecated by pluggable discovery
195+
tools.bossacI.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
196+
197+
198+
#
199+
# OpenOCD sketch upload
200+
#
201+
202+
tools.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}
203+
tools.openocd.cmd=bin/openocd
204+
tools.openocd.cmd.windows=bin/openocd.exe
205+
206+
tools.openocd.upload.params.verbose=-d2
207+
tools.openocd.upload.params.quiet=-d0
208+
tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "interface/{protocol}" -c "set telnet_port 0" {extra_params} -f "target/at91samdXX.cfg" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown"
209+
210+
# the following rule is deprecated by pluggable discovery
211+
tools.openocd.upload.network_pattern={tools.arduino_ota.cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
212+
213+
tools.openocd.program.params.verbose=-d2
214+
tools.openocd.program.params.quiet=-d0
215+
tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "interface/{protocol}" -c "set telnet_port 0" {extra_params} -f "target/at91samdXX.cfg" -c "telnet_port disabled; program {{build.path}/{build.project_name}.hex} verify reset; shutdown"
216+
217+
tools.openocd.erase.params.verbose=-d3
218+
tools.openocd.erase.params.quiet=-d0
219+
tools.openocd.erase.pattern=
220+
221+
tools.openocd.bootloader.params.verbose=-d2
222+
tools.openocd.bootloader.params.quiet=-d0
223+
tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "interface/{protocol}" -c "set telnet_port 0" {extra_params} -f "target/at91samdXX.cfg" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
224+
225+
#
226+
# OpenOCD sketch upload - version with configurable bootloader size
227+
# FIXME: this programmer is a workaround for default options being overwritten by uploadUsingPreferences
228+
#
229+
230+
tools.openocd-withbootsize.path={runtime.tools.openocd-0.10.0-arduino7.path}
231+
tools.openocd-withbootsize.cmd=bin/openocd
232+
tools.openocd-withbootsize.cmd.windows=bin/openocd.exe
233+
234+
tools.openocd-withbootsize.upload.params.verbose=-d2
235+
tools.openocd-withbootsize.upload.params.quiet=-d0
236+
tools.openocd-withbootsize.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset {bootloader.size}; shutdown"
237+
238+
# Program flashes the binary at 0x0000, so use the linker script without_bootloader
239+
tools.openocd-withbootsize.program.params.verbose=-d2
240+
tools.openocd-withbootsize.program.params.quiet=-d0
241+
tools.openocd-withbootsize.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
242+
243+
tools.openocd-withbootsize.erase.params.verbose=-d3
244+
tools.openocd-withbootsize.erase.params.quiet=-d0
245+
tools.openocd-withbootsize.erase.pattern=
246+
247+
tools.openocd-withbootsize.bootloader.params.verbose=-d2
248+
tools.openocd-withbootsize.bootloader.params.quiet=-d0
249+
tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
250+
251+
#
252+
# Arduino OTA
253+
#
254+
arduinoota.extraflags=
255+
tools.arduino_ota.cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
256+
tools.arduino_ota.upload.field.password=Password
257+
tools.arduino_ota.upload.field.password.secret=true
258+
tools.arduino_ota.upload.pattern="{cmd}" -address "{upload.port.address}" -port 65280 -username arduino -password "{upload.field.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b {arduinoota.extraflags}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Udp.cpp: Library to send/receive UDP packets.
3+
*
4+
* NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray for mentioning these)
5+
* 1) UDP does not guarantee the order in which assembled UDP packets are received. This
6+
* might not happen often in practice, but in larger network topologies, a UDP
7+
* packet can be received out of sequence.
8+
* 2) UDP does not guard against lost packets - so packets *can* disappear without the sender being
9+
* aware of it. Again, this may not be a concern in practice on small local networks.
10+
* For more information, see http://www.cafeaulait.org/course/week12/35.html
11+
*
12+
* MIT License:
13+
* Copyright (c) 2008 Bjoern Hartmann
14+
* Permission is hereby granted, free of charge, to any person obtaining a copy
15+
* of this software and associated documentation files (the "Software"), to deal
16+
* in the Software without restriction, including without limitation the rights
17+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
* copies of the Software, and to permit persons to whom the Software is
19+
* furnished to do so, subject to the following conditions:
20+
*
21+
* The above copyright notice and this permission notice shall be included in
22+
* all copies or substantial portions of the Software.
23+
*
24+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30+
* THE SOFTWARE.
31+
*
32+
* bjoern@cs.stanford.edu 12/30/2008
33+
*/
34+
35+
#ifndef udp_h
36+
#define udp_h
37+
38+
#include <Stream.h>
39+
#include <IPAddress.h>
40+
41+
class UDP : public Stream {
42+
43+
public:
44+
virtual uint8_t begin(uint16_t) =0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use
45+
virtual uint8_t beginMulticast(IPAddress, uint16_t) { return 0; } // initialize, start listening on specified multicast IP address and port. Returns 1 if successful, 0 on failure
46+
virtual void stop() =0; // Finish with the UDP socket
47+
48+
// Sending UDP packets
49+
50+
// Start building up a packet to send to the remote host specific in ip and port
51+
// Returns 1 if successful, 0 if there was a problem with the supplied IP address or port
52+
virtual int beginPacket(IPAddress ip, uint16_t port) =0;
53+
// Start building up a packet to send to the remote host specific in host and port
54+
// Returns 1 if successful, 0 if there was a problem resolving the hostname or port
55+
virtual int beginPacket(const char *host, uint16_t port) =0;
56+
// Finish off this packet and send it
57+
// Returns 1 if the packet was sent successfully, 0 if there was an error
58+
virtual int endPacket() =0;
59+
// Write a single byte into the packet
60+
virtual size_t write(uint8_t) =0;
61+
// Write size bytes from buffer into the packet
62+
virtual size_t write(const uint8_t *buffer, size_t size) =0;
63+
64+
// Start processing the next available incoming packet
65+
// Returns the size of the packet in bytes, or 0 if no packets are available
66+
virtual int parsePacket() =0;
67+
// Number of bytes remaining in the current packet
68+
virtual int available() =0;
69+
// Read a single byte from the current packet
70+
virtual int read() =0;
71+
// Read up to len bytes from the current packet and place them into buffer
72+
// Returns the number of bytes read, or 0 if none are available
73+
virtual int read(unsigned char* buffer, size_t len) =0;
74+
// Read up to len characters from the current packet and place them into buffer
75+
// Returns the number of characters read, or 0 if none are available
76+
virtual int read(char* buffer, size_t len) =0;
77+
// Return the next byte from the current packet without moving on to the next byte
78+
virtual int peek() =0;
79+
virtual void flush() =0; // Finish reading the current packet
80+
81+
// Return the IP address of the host who sent the current incoming packet
82+
virtual IPAddress remoteIP() =0;
83+
// Return the port of the host who sent the current incoming packet
84+
virtual uint16_t remotePort() =0;
85+
protected:
86+
uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
87+
};
88+
89+
#endif

0 commit comments

Comments
 (0)