Skip to content

Commit 2e19868

Browse files
author
Oren Cohen
committed
Prepare postbuild for prebuilt images
1 parent 2df2fc7 commit 2e19868

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7691,6 +7691,7 @@
76917691
"extra_labels_remove": ["CORDIO"],
76927692
"components_add": ["SPM_MAILBOX"],
76937693
"macros_add": ["PSOC6_DYNSRM_DISABLE=1", "MBEDTLS_PSA_CRYPTO_C"],
7694+
"m0_core_img": "psa_release_1.0.hex",
76947695
"overrides": {
76957696
"secure-rom-start": "0x10000000",
76967697
"secure-rom-size": "0x80000",

tools/targets/PSOC6.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,17 @@ def find_cm0_image(toolchain, resources, elf, hexf):
9898
# Locate user-specified image
9999
from tools.resources import FileType
100100
hex_files = resources.get_file_paths(FileType.HEX)
101+
m0hexf = next((f for f in hex_files if os.path.basename(f) == toolchain.target.m0_core_img), None)
101102
if toolchain.target.name.endswith('_PSA'):
102-
m0hexf = next((f for f in hex_files if os.path.basename(f) == os.path.basename(hexf)), None)
103-
else:
104-
m0hexf = next((f for f in hex_files if os.path.basename(f) == toolchain.target.m0_core_img), None)
103+
m0hexf = next((f for f in hex_files if os.path.basename(f) == os.path.basename(hexf)), m0hexf)
105104

106105
if m0hexf:
107-
toolchain.notify.debug("M0 core image file found %s." % os.path.basename(m0hexf))
106+
toolchain.notify.debug("M0 core image file found: %s." % os.path.basename(m0hexf))
108107
else:
109108
toolchain.notify.debug("M0 core hex image file %s not found. Aborting." % toolchain.target.m0_core_img)
110109
raise ConfigException("Required M0 core hex image not found.")
111110

112111
return m0hexf
113112

114-
115113
def complete(toolchain, elf0, hexf0, hexf1=None):
116114
complete_func(toolchain.notify.debug, elf0, hexf0, hexf1)
117-
118-

0 commit comments

Comments
 (0)