@@ -43,7 +43,8 @@ compiler.c.elf.flags=-mcpu={build.mcu} -mthumb {build.flags.optimize} {build.fla
4343
4444compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
4545
46- compiler.elf2hex.flags=-O binary
46+ compiler.elf2bin.flags=-O binary
47+ compiler.elf2hex.flags=-O ihex
4748
4849compiler.ldflags={build.flags.ldspecs}
4950compiler.size.cmd=arm-none-eabi-size
@@ -60,6 +61,7 @@ compiler.cpp.extra_flags=
6061compiler.cpp.std=gnu++14
6162compiler.S.extra_flags=
6263compiler.ar.extra_flags=
64+ compiler.elf2bin.extra_flags=
6365compiler.elf2hex.extra_flags=
6466
6567compiler.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
107109recipe.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
108110
109111## 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"
111113
112- ## Save hex 
114+ ## Save bin 
113115recipe.output.tmp_file={build.project_name}.bin
114116recipe.output.save_file={build.project_name}.{build.variant}.bin
115117
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+ 
116125## Compute size
117126recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
118127recipe.size.regex=^(?:\.text|\.data|\.rodata)\s+([0-9]+).*
0 commit comments