Skip to content

Commit

Permalink
Call objcopy.postobjcopy only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Jul 20, 2022
1 parent da3f9ea commit cd0afb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 3 additions & 9 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ edge_control.build.fpu=-mfpu=fpv4-sp-d16
edge_control.build.float-abi=-mfloat-abi=softfp
edge_control.build.board=EDGE_CONTROL
edge_control.build.ldscript=linker_script.ld
edge_control.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
edge_control.compiler.mbed.arch.define=-DARDUINO_ARCH_NRF52840
edge_control.compiler.mbed.defines={build.variant.path}/defines.txt
edge_control.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Expand Down Expand Up @@ -80,11 +79,10 @@ envie_m7.build.slot_size=0x1E0000
envie_m7.build.header_size=0x20000
envie_m7.build.alignment=32
envie_m7.build.version=1.2.3+4
envie_m7.menu.security.sien.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" {tools.imgtool.flags}
envie_m7.menu.security.sien.recipe.hooks.objcopy.postobjcopy.1.pattern="{tools.imgtool.path}/{tools.imgtool.cmd}" {tools.imgtool.flags}
envie_m7.menu.security.sien.build.keys.keychain={runtime.platform.path}/libraries/MCUboot/default_keys
envie_m7.menu.security.sien.build.keys.sign_key=ecdsa-p256-signing-priv-key.pem
envie_m7.menu.security.sien.build.keys.encrypt_key=ecdsa-p256-encrypt-pub-key.pem
envie_m7.menu.security.none.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
envie_m7.compiler.mbed.arch.define=
envie_m7.compiler.mbed.defines={build.variant.path}/defines.txt
envie_m7.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Expand Down Expand Up @@ -167,7 +165,6 @@ envie_m4.menu.split.100_0.build.extra_ldflags=-DCM4_BINARY_START=0x60000000 -DCM
envie_m4.build.architecture=cortex-m4
envie_m4.build.board=PORTENTA_H7_M4
envie_m4.build.ldscript=linker_script.ld
envie_m4.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
envie_m4.compiler.mbed.arch.define=
envie_m4.compiler.mbed.defines={build.variant.path}/defines.txt
envie_m4.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Expand Down Expand Up @@ -279,7 +276,6 @@ nano33ble.build.fpu=-mfpu=fpv4-sp-d16
nano33ble.build.float-abi=-mfloat-abi=softfp
nano33ble.build.board=ARDUINO_NANO33BLE
nano33ble.build.ldscript=linker_script.ld
nano33ble.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
nano33ble.compiler.mbed.arch.define=-DARDUINO_ARCH_NRF52840
nano33ble.compiler.mbed.defines={build.variant.path}/defines.txt
nano33ble.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Expand Down Expand Up @@ -337,7 +333,6 @@ nanorp2040connect.build.float-abi=
nanorp2040connect.build.architecture=cortex-m0plus
nanorp2040connect.build.board=NANO_RP2040_CONNECT
nanorp2040connect.build.ldscript=linker_script.ld
nanorp2040connect.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
nanorp2040connect.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040
nanorp2040connect.compiler.mbed.defines={build.variant.path}/defines.txt
nanorp2040connect.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Expand All @@ -346,6 +341,7 @@ nanorp2040connect.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
nanorp2040connect.compiler.mbed.includes={build.variant.path}/includes.txt
nanorp2040connect.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
nanorp2040connect.compiler.mbed="{build.variant.path}/libs/libmbed.a"
nanorp2040connect.recipe.hooks.objcopy.postobjcopy.1.pattern="{runtime.tools.rp2040tools.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
nanorp2040connect.vid.0=0x2341
nanorp2040connect.pid.0=0x005e
nanorp2040connect.vid.1=0x2341
Expand Down Expand Up @@ -393,7 +389,6 @@ pico.build.float-abi=
pico.build.architecture=cortex-m0plus
pico.build.board=RASPBERRY_PI_PICO
pico.build.ldscript=linker_script.ld
pico.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
pico.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040
pico.compiler.mbed.defines={build.variant.path}/defines.txt
pico.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Expand All @@ -402,6 +397,7 @@ pico.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
pico.compiler.mbed.includes={build.variant.path}/includes.txt
pico.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
pico.compiler.mbed="{build.variant.path}/libs/libmbed.a"
pico.recipe.hooks.objcopy.postobjcopy.1.pattern="{runtime.tools.rp2040tools.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
pico.vid.0=0x2e8a
pico.pid.0=0x00C0
pico.upload_port.0.vid=0x2e8a
Expand Down Expand Up @@ -437,7 +433,6 @@ nicla_sense.build.fpu=-mfpu=fpv4-sp-d16
nicla_sense.build.float-abi=-mfloat-abi=softfp
nicla_sense.build.board=NICLA
nicla_sense.build.ldscript=linker_script.ld
nicla_sense.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
nicla_sense.compiler.mbed.arch.define=-DARDUINO_ARCH_NRF52832
nicla_sense.compiler.mbed.defines={build.variant.path}/defines.txt
nicla_sense.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Expand Down Expand Up @@ -485,7 +480,6 @@ nicla_vision.build.extra_flags=
nicla_vision.build.architecture=cortex-m7
nicla_vision.build.board=NICLA_VISION
nicla_vision.build.ldscript=linker_script.ld
nicla_vision.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
nicla_vision.compiler.mbed.arch.define=
nicla_vision.compiler.mbed.defines={build.variant.path}/defines.txt
nicla_vision.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Expand Down
2 changes: 0 additions & 2 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf
## Create output (hex file)
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"

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

0 comments on commit cd0afb4

Please sign in to comment.