mirror of https://github.com/ARMmbed/mbed-os.git
PSOC6: Fix post build script
Raise an exception in case of a failure to find an image to use for the binary signature. This prevents the method from assuming the image is always successfully retrieved and crash when attempting to print a messagepull/14324/head
parent
29cfcd6d5f
commit
a8b9d49cfa
|
|
@ -249,6 +249,11 @@ def sign_application(message_func, tools, binary, image_id):
|
||||||
# UPGRADE image will be generated automatically by cysecuretools
|
# UPGRADE image will be generated automatically by cysecuretools
|
||||||
address, size = tools.flash_map(image_id=image_id, image_type="BOOT")
|
address, size = tools.flash_map(image_id=image_id, image_type="BOOT")
|
||||||
|
|
||||||
|
if not address or not size:
|
||||||
|
raise AddSignatureError(
|
||||||
|
f"Cannot find image with id {image_id} and type BOOT in the policy file"
|
||||||
|
)
|
||||||
|
|
||||||
tools.sign_image(binary, image_id)
|
tools.sign_image(binary, image_id)
|
||||||
message_func("[PSOC6.sign_image] Slot start address and size for image ID " \
|
message_func("[PSOC6.sign_image] Slot start address and size for image ID " \
|
||||||
+ str(image_id) + " is " + hex(address) + ", " + hex(size))
|
+ str(image_id) + " is " + hex(address) + ", " + hex(size))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue