Skip to content

Commit 44e9e3c

Browse files
authored
Merge pull request #14324 from hugueskamba/hk_fix_psoc6_post_build_script
PSOC6: Catch possible error in post build script
2 parents e2a5f8f + a8b9d49 commit 44e9e3c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

targets/TARGET_Cypress/scripts/PSOC6.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ def sign_application(message_func, tools, binary, image_id):
256256
# UPGRADE image will be generated automatically by cysecuretools
257257
address, size = tools.flash_map(image_id=image_id, image_type="BOOT")
258258

259+
if not address or not size:
260+
raise AddSignatureError(
261+
f"Cannot find image with id {image_id} and type BOOT in the policy file"
262+
)
263+
259264
tools.sign_image(binary, image_id)
260265
message_func("[PSOC6.sign_image] Slot start address and size for image ID " \
261266
+ str(image_id) + " is " + hex(address) + ", " + hex(size))

0 commit comments

Comments
 (0)