Merge pull request #14324 from hugueskamba/hk_fix_psoc6_post_build_script

PSOC6: Catch possible error in post build script
pull/14367/head
Martin Kojtal 2021-03-02 09:40:57 +00:00 committed by GitHub
commit 44e9e3ca80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -256,6 +256,11 @@ def sign_application(message_func, tools, binary, image_id):
# UPGRADE image will be generated automatically by cysecuretools
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)
message_func("[PSOC6.sign_image] Slot start address and size for image ID " \
+ str(image_id) + " is " + hex(address) + ", " + hex(size))