@@ -43,7 +43,8 @@ compiler.c.elf.flags=-mcpu={build.mcu} -mthumb {build.flags.optimize} {build.fla
43
43
44
44
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
45
45
46
- compiler.elf2hex.flags=-O binary
46
+ compiler.elf2bin.flags=-O binary
47
+ compiler.elf2hex.flags=-O ihex
47
48
48
49
compiler.ldflags={build.flags.ldspecs}
49
50
compiler.size.cmd=arm-none-eabi-size
@@ -60,6 +61,7 @@ compiler.cpp.extra_flags=
60
61
compiler.cpp.std=gnu++14
61
62
compiler.S.extra_flags=
62
63
compiler.ar.extra_flags=
64
+ compiler.elf2bin.extra_flags=
63
65
compiler.elf2hex.extra_flags=
64
66
65
67
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Source/Templates/gcc/"
@@ -107,12 +109,19 @@ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compil
107
109
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} {compiler.ldflags} {compiler.arm.cmsis.ldflags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--start-group {object_files} -Wl,--whole-archive "{archive_file_path}" -Wl,--no-whole-archive -lc -Wl,--end-group -lm -lgcc -lstdc++ --specs=nano.specs
108
110
109
111
## Create output (.bin file)
110
- 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"
112
+ recipe.objcopy.bin.pattern="{compiler.path}{compiler.objcopy .cmd}" {compiler.elf2bin .flags} {compiler.elf2bin .extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
111
113
112
- ## Save hex
114
+ ## Save bin
113
115
recipe.output.tmp_file={build.project_name}.bin
114
116
recipe.output.save_file={build.project_name}.{build.variant}.bin
115
117
118
+ ## Create output (.hex file)
119
+ recipe.objcopy.hex.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
120
+
121
+ ## Save hex
122
+ recipe.output.tmp_file={build.project_name}.hex
123
+ recipe.output.save_file={build.project_name}.{build.variant}.hex
124
+
116
125
## Compute size
117
126
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
118
127
recipe.size.regex=^(?:\.text|\.data|\.rodata)\s+([0-9]+).*
0 commit comments