Skip to content

Commit cd0afb4

Browse files
committed
Call objcopy.postobjcopy only when needed
1 parent da3f9ea commit cd0afb4

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

boards.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ edge_control.build.fpu=-mfpu=fpv4-sp-d16
1313
edge_control.build.float-abi=-mfloat-abi=softfp
1414
edge_control.build.board=EDGE_CONTROL
1515
edge_control.build.ldscript=linker_script.ld
16-
edge_control.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
1716
edge_control.compiler.mbed.arch.define=-DARDUINO_ARCH_NRF52840
1817
edge_control.compiler.mbed.defines={build.variant.path}/defines.txt
1918
edge_control.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
@@ -80,11 +79,10 @@ envie_m7.build.slot_size=0x1E0000
8079
envie_m7.build.header_size=0x20000
8180
envie_m7.build.alignment=32
8281
envie_m7.build.version=1.2.3+4
83-
envie_m7.menu.security.sien.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" {tools.imgtool.flags}
82+
envie_m7.menu.security.sien.recipe.hooks.objcopy.postobjcopy.1.pattern="{tools.imgtool.path}/{tools.imgtool.cmd}" {tools.imgtool.flags}
8483
envie_m7.menu.security.sien.build.keys.keychain={runtime.platform.path}/libraries/MCUboot/default_keys
8584
envie_m7.menu.security.sien.build.keys.sign_key=ecdsa-p256-signing-priv-key.pem
8685
envie_m7.menu.security.sien.build.keys.encrypt_key=ecdsa-p256-encrypt-pub-key.pem
87-
envie_m7.menu.security.none.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
8886
envie_m7.compiler.mbed.arch.define=
8987
envie_m7.compiler.mbed.defines={build.variant.path}/defines.txt
9088
envie_m7.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
@@ -167,7 +165,6 @@ envie_m4.menu.split.100_0.build.extra_ldflags=-DCM4_BINARY_START=0x60000000 -DCM
167165
envie_m4.build.architecture=cortex-m4
168166
envie_m4.build.board=PORTENTA_H7_M4
169167
envie_m4.build.ldscript=linker_script.ld
170-
envie_m4.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
171168
envie_m4.compiler.mbed.arch.define=
172169
envie_m4.compiler.mbed.defines={build.variant.path}/defines.txt
173170
envie_m4.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
@@ -279,7 +276,6 @@ nano33ble.build.fpu=-mfpu=fpv4-sp-d16
279276
nano33ble.build.float-abi=-mfloat-abi=softfp
280277
nano33ble.build.board=ARDUINO_NANO33BLE
281278
nano33ble.build.ldscript=linker_script.ld
282-
nano33ble.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
283279
nano33ble.compiler.mbed.arch.define=-DARDUINO_ARCH_NRF52840
284280
nano33ble.compiler.mbed.defines={build.variant.path}/defines.txt
285281
nano33ble.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
@@ -337,7 +333,6 @@ nanorp2040connect.build.float-abi=
337333
nanorp2040connect.build.architecture=cortex-m0plus
338334
nanorp2040connect.build.board=NANO_RP2040_CONNECT
339335
nanorp2040connect.build.ldscript=linker_script.ld
340-
nanorp2040connect.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
341336
nanorp2040connect.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040
342337
nanorp2040connect.compiler.mbed.defines={build.variant.path}/defines.txt
343338
nanorp2040connect.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
@@ -346,6 +341,7 @@ nanorp2040connect.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
346341
nanorp2040connect.compiler.mbed.includes={build.variant.path}/includes.txt
347342
nanorp2040connect.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
348343
nanorp2040connect.compiler.mbed="{build.variant.path}/libs/libmbed.a"
344+
nanorp2040connect.recipe.hooks.objcopy.postobjcopy.1.pattern="{runtime.tools.rp2040tools.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
349345
nanorp2040connect.vid.0=0x2341
350346
nanorp2040connect.pid.0=0x005e
351347
nanorp2040connect.vid.1=0x2341
@@ -393,7 +389,6 @@ pico.build.float-abi=
393389
pico.build.architecture=cortex-m0plus
394390
pico.build.board=RASPBERRY_PI_PICO
395391
pico.build.ldscript=linker_script.ld
396-
pico.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
397392
pico.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040
398393
pico.compiler.mbed.defines={build.variant.path}/defines.txt
399394
pico.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
@@ -402,6 +397,7 @@ pico.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
402397
pico.compiler.mbed.includes={build.variant.path}/includes.txt
403398
pico.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
404399
pico.compiler.mbed="{build.variant.path}/libs/libmbed.a"
400+
pico.recipe.hooks.objcopy.postobjcopy.1.pattern="{runtime.tools.rp2040tools.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
405401
pico.vid.0=0x2e8a
406402
pico.pid.0=0x00C0
407403
pico.upload_port.0.vid=0x2e8a
@@ -437,7 +433,6 @@ nicla_sense.build.fpu=-mfpu=fpv4-sp-d16
437433
nicla_sense.build.float-abi=-mfloat-abi=softfp
438434
nicla_sense.build.board=NICLA
439435
nicla_sense.build.ldscript=linker_script.ld
440-
nicla_sense.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
441436
nicla_sense.compiler.mbed.arch.define=-DARDUINO_ARCH_NRF52832
442437
nicla_sense.compiler.mbed.defines={build.variant.path}/defines.txt
443438
nicla_sense.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
@@ -485,7 +480,6 @@ nicla_vision.build.extra_flags=
485480
nicla_vision.build.architecture=cortex-m7
486481
nicla_vision.build.board=NICLA_VISION
487482
nicla_vision.build.ldscript=linker_script.ld
488-
nicla_vision.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
489483
nicla_vision.compiler.mbed.arch.define=
490484
nicla_vision.compiler.mbed.defines={build.variant.path}/defines.txt
491485
nicla_vision.compiler.mbed.ldflags={build.variant.path}/ldflags.txt

platform.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf
9696
## Create output (hex file)
9797
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"
9898

99-
## Create output secure image (bin file)
100-
recipe.hooks.objcopy.postobjcopy.1.pattern={build.postbuild.cmd}
10199
## Compute size
102100
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
103101
recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).*

0 commit comments

Comments
 (0)