2020# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
2121
2222name=Mysensors SAMD (32-bits ARM Cortex-M0+) Boards
23- version=1.0.3
23+ version=1.0.4
2424
2525# Compile variables
2626# -----------------
@@ -37,18 +37,20 @@ compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g -Os {compiler.warning_flags} -s
3737compiler.c.elf.cmd=arm-none-eabi-gcc
3838compiler.c.elf.flags=-Os -Wl,--gc-sections -save-temps
3939compiler.S.cmd=arm-none-eabi-gcc
40- compiler.S.flags=-c -g -x assembler-with-cpp
40+ compiler.S.flags=-c -g -x assembler-with-cpp -MMD
4141compiler.cpp.cmd=arm-none-eabi-g++
4242compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g -Os {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
4343compiler.ar.cmd=arm-none-eabi-ar
4444compiler.ar.flags=rcs
4545compiler.objcopy.cmd=arm-none-eabi-objcopy
4646compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
47- compiler.elf2hex.flags=-O binary
47+ compiler.elf2hex.bin.flags=-O binary
48+ compiler.elf2hex.hex.flags=-O ihex -R .eeprom
4849compiler.elf2hex.cmd=arm-none-eabi-objcopy
4950compiler.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
5051compiler.size.cmd=arm-none-eabi-size
5152compiler.define=-DARDUINO=
53+ compiler.readelf.cmd=arm-none-eabi-readelf
5254
5355# this can be overriden in boards.txt
5456build.extra_flags=
@@ -62,7 +64,8 @@ compiler.S.extra_flags=
6264compiler.ar.extra_flags=
6365compiler.elf2hex.extra_flags=
6466
65- compiler.arm.cmsis.path="-I{runtime.tools.CMSIS.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS.path}/Device/ATMEL/"
67+ compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS-Atmel-1.0.0.path}/CMSIS/Device/ATMEL/"
68+ compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Lib/GCC/" -larm_cortexM0l_math
6669
6770# USB Flags
6871# ---------
@@ -72,63 +75,86 @@ build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANU
7275# numeric vendor ID if available or by board's specific value.
7376build.usb_manufacturer="Unknown"
7477
75-
7678# Compile patterns
7779# ----------------
7880
7981## Compile c files
80- recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.arm.cmsis.path } {includes} "{source_file}" -o "{object_file}"
82+ recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags } {includes} "{source_file}" -o "{object_file}"
8183
8284## Compile c++ files
83- recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {compiler.arm.cmsis.path } {includes} "{source_file}" -o "{object_file}"
85+ recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags } {includes} "{source_file}" -o "{object_file}"
8486
8587## Compile S files
86- recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {compiler.arm.cmsis.path } {includes} "{source_file}" -o "{object_file}"
88+ recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags } {includes} "{source_file}" -o "{object_file}"
8789
8890## Create archives
89- #recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
91+ # archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
92+ archive_file_path={build.path}/{archive_file}
93+ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
9094
9195## Combine gc-sections, archives, and objects
92- 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} -Wl,--start-group -lm "{build.path}/{archive_file}" -Wl,--end-group
96+ 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} -Wl,--start-group {compiler.arm.cmsis.ldflags} -lm "{build.path}/{archive_file}" -Wl,--end-group
9397
9498## Create output (bin file)
95- 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"
99+ 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"
100+
101+ ## Create output (hex file)
102+ 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"
103+
104+ build.preferred_out_format=bin
96105
97106## Save hex
98- recipe.output.tmp_file={build.project_name}.bin
99- recipe.output.save_file={build.project_name}.{build.variant}.bin
107+ recipe.output.tmp_file={build.project_name}.{build.preferred_out_format}
108+ recipe.output.save_file={build.project_name}.{build.variant}.{build.preferred_out_format}
100109
101110## Compute size
102111recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
103112recipe.size.regex=\.text\s+([0-9]+).*
104113
105-
106114# Uploader tools
107115# --------------
108116
117+ #
118+ # AVRDUDE
119+ #
120+ tools.avrdude.path={runtime.tools.avrdude.path}
121+ tools.avrdude.cmd={path}/bin/avrdude
122+ tools.avrdude.config.path={path}/etc/avrdude.conf
123+
124+ tools.avrdude.upload.params.verbose=-v -v
125+ tools.avrdude.upload.params.quiet=-q -q
126+ tools.avrdude.upload.params.noverify=-V
127+ 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"
128+
129+ #temporary disabled remote upload
130+ tools.avrdude_remote.upload.pattern=/usr/bin/XXX-run-avrdude /tmp/sketch.hex
131+
109132#
110133# BOSSA
111134#
112- tools.bossac.path={runtime.tools.bossac-1.6.1-arduino .path}
135+ tools.bossac.path={runtime.tools.bossac-1.7.0 .path}
113136tools.bossac.cmd=bossac
114137tools.bossac.cmd.windows=bossac.exe
115138
116139tools.bossac.upload.params.verbose=-i -d
117140tools.bossac.upload.params.quiet=
118141tools.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
119142
143+ tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R
144+
120145#
121146# OpenOCD sketch upload
122147#
123148
124- tools.openocd.path={runtime.tools.openocd.path}
149+ tools.openocd.path={runtime.tools.openocd-0.9.0-arduino .path}
125150tools.openocd.cmd=bin/openocd
126151tools.openocd.cmd.windows=bin/openocd.exe
127152
128153tools.openocd.upload.params.verbose=-d2
129154tools.openocd.upload.params.quiet=-d0
130- tools.openocd.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 0x00002000 ; shutdown"
155+ tools.openocd.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 0x2000 ; shutdown"
131156
157+ # Program flashes the binary at 0x0000, so use the linker script without_bootloader
132158tools.openocd.program.params.verbose=-d2
133159tools.openocd.program.params.quiet=-d0
134160tools.openocd.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"
@@ -140,3 +166,29 @@ tools.openocd.erase.pattern=
140166tools.openocd.bootloader.params.verbose=-d2
141167tools.openocd.bootloader.params.quiet=-d0
142168tools.openocd.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"
169+
170+ #
171+ # OpenOCD sketch upload - version with configurable bootloader size
172+ # FIXME: this programmer is a workaround for default options being overwritten by uploadUsingPreferences
173+ #
174+
175+ tools.openocd-withbootsize.path={runtime.tools.openocd-0.9.0-arduino.path}
176+ tools.openocd-withbootsize.cmd=bin/openocd
177+ tools.openocd-withbootsize.cmd.windows=bin/openocd.exe
178+
179+ tools.openocd-withbootsize.upload.params.verbose=-d2
180+ tools.openocd-withbootsize.upload.params.quiet=-d0
181+ 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"
182+
183+ # Program flashes the binary at 0x0000, so use the linker script without_bootloader
184+ tools.openocd-withbootsize.program.params.verbose=-d2
185+ tools.openocd-withbootsize.program.params.quiet=-d0
186+ 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"
187+
188+ tools.openocd-withbootsize.erase.params.verbose=-d3
189+ tools.openocd-withbootsize.erase.params.quiet=-d0
190+ tools.openocd-withbootsize.erase.pattern=
191+
192+ tools.openocd-withbootsize.bootloader.params.verbose=-d2
193+ tools.openocd-withbootsize.bootloader.params.quiet=-d0
194+ 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"
0 commit comments