@@ -12,21 +12,22 @@ version=1.5.6
12
12
13
13
compiler.path={runtime.ide.path}/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/
14
14
compiler.c.cmd=arm-none-eabi-gcc
15
- compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf
15
+ compiler.c.flags=-mcpu={build.mcu} -mthumb - c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf
16
16
#-std=gnu99
17
- compiler.c.elf.cmd=arm-none-eabi-g++
18
- compiler.c.elf.flags=-Os -Wl,--gc-sections
17
+ #compiler.c.elf.cmd=arm-none-eabi-g++
18
+ compiler.c.elf.cmd=arm-none-eabi-gcc
19
+ compiler.c.elf.flags=-Os -Wl,--gc-sections -save-temps
19
20
compiler.S.flags=-c -g -x assembler-with-cpp
20
21
compiler.cpp.cmd=arm-none-eabi-g++
21
- compiler.cpp.flags=-c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf
22
+ compiler.cpp.flags=-mcpu={build.mcu} -mthumb - c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf
22
23
#-std=gnu++11
23
24
compiler.ar.cmd=arm-none-eabi-ar
24
25
compiler.ar.flags=rcs
25
26
compiler.objcopy.cmd=arm-none-eabi-objcopy
26
27
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
27
28
compiler.elf2hex.flags=-O binary
28
29
compiler.elf2hex.cmd=arm-none-eabi-objcopy
29
- compiler.ldflags=
30
+ compiler.ldflags=-mcpu={build.mcu} -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols
30
31
compiler.size.cmd=arm-none-eabi-size
31
32
compiler.define=-DARDUINO=
32
33
@@ -36,6 +37,7 @@ build.extra_flags=
36
37
# These can be overridden in platform.local.txt
37
38
compiler.c.extra_flags=
38
39
compiler.c.elf.extra_flags=
40
+ #compiler.c.elf.extra_flags=-v
39
41
compiler.cpp.extra_flags=
40
42
compiler.ar.extra_flags=
41
43
compiler.elf2hex.extra_flags=
@@ -55,16 +57,19 @@ build.usb_manufacturer="Unknown"
55
57
# ---------------------
56
58
57
59
## Compile c files
58
- recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={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} {compiler.arm.cmsis.path} {includes} "{source_file}" -o "{object_file}"
60
+ 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}"
59
61
60
62
## Compile c++ files
61
- recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={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} {compiler.arm.cmsis.path} {includes} "{source_file}" -o "{object_file}"
63
+ 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}"
62
64
63
65
## Create archives
64
- recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
66
+ #recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/lib{archive_file}" "{object_file}"
67
+ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/libarduino_core.a" "{object_file}"
65
68
66
69
## Combine gc-sections, archives, and objects
67
- recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -save-temps -mcpu={build.mcu} "-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" --specs=nano.specs "-L{build.path}" -Wl,--start-group -lm -lgcc -Wl,--end-group -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} "{build.path}/{archive_file}" -Wl,--end-group
70
+ #recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -save-temps -mcpu={build.mcu} "-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" --specs=nano.specs "-L{build.path}" -mthumb {compiler.ldflags} {object_files} -Wl,--start-group -lm -lgcc "{build.path}/{archive_file}" -Wl,--end-group
71
+ #recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} "-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" --specs=nano.specs {compiler.ldflags} {object_files} -Wl,--start-group -lm -lgcc -l{archive_file} -Wl,--end-group
72
+ 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 -larduino_core -Wl,--end-group
68
73
69
74
## Create eeprom
70
75
recipe.objcopy.eep.pattern=
@@ -105,16 +110,16 @@ tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{{{path}/share/
105
110
106
111
tools.openocd.program.params.verbose=-d3
107
112
tools.openocd.program.params.quiet=-d0
108
- tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -v
113
+ tools.openocd.program.pattern=
109
114
110
115
tools.openocd.erase.params.verbose=-d3
111
116
tools.openocd.erase.params.quiet=-d0
112
- tools.openocd.erase.pattern="{path}/{cmd}" {erase.verbose} -v
117
+ tools.openocd.erase.pattern=
113
118
114
- tools.openocd.bootloader.params.verbose=-d3
119
+ tools.openocd.bootloader.params.verbose=-d2
115
120
tools.openocd.bootloader.params.quiet=-d0
116
- # tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{{path}/share/openocd/scripts/}" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset"
117
- tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "../../../../../arduino/samd/variants/{build.variant}/{build.openocdscript}" -c "program {{{runtime.platform.path}/bootloaders/{bootloader.file}}} verify reset"
121
+ tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{{path}/share/openocd/scripts/}" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset"
122
+ # tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "../../../../../arduino/samd/variants/{build.variant}/{build.openocdscript}" -c "program {{{runtime.platform.path}/bootloaders/{bootloader.file}}} verify reset"
118
123
119
124
#
120
125
# OpenOCD burn bootloader
0 commit comments