Prepare postbuild for prebuilt images

pull/8745/head
Oren Cohen 2018-12-06 09:16:49 +02:00
parent 2df2fc7d29
commit 2e19868ff9
2 changed files with 4 additions and 7 deletions

View File

@ -7691,6 +7691,7 @@
"extra_labels_remove": ["CORDIO"],
"components_add": ["SPM_MAILBOX"],
"macros_add": ["PSOC6_DYNSRM_DISABLE=1", "MBEDTLS_PSA_CRYPTO_C"],
"m0_core_img": "psa_release_1.0.hex",
"overrides": {
"secure-rom-start": "0x10000000",
"secure-rom-size": "0x80000",

View File

@ -98,21 +98,17 @@ def find_cm0_image(toolchain, resources, elf, hexf):
# Locate user-specified image
from tools.resources import FileType
hex_files = resources.get_file_paths(FileType.HEX)
m0hexf = next((f for f in hex_files if os.path.basename(f) == toolchain.target.m0_core_img), None)
if toolchain.target.name.endswith('_PSA'):
m0hexf = next((f for f in hex_files if os.path.basename(f) == os.path.basename(hexf)), None)
else:
m0hexf = next((f for f in hex_files if os.path.basename(f) == toolchain.target.m0_core_img), None)
m0hexf = next((f for f in hex_files if os.path.basename(f) == os.path.basename(hexf)), m0hexf)
if m0hexf:
toolchain.notify.debug("M0 core image file found %s." % os.path.basename(m0hexf))
toolchain.notify.debug("M0 core image file found: %s." % os.path.basename(m0hexf))
else:
toolchain.notify.debug("M0 core hex image file %s not found. Aborting." % toolchain.target.m0_core_img)
raise ConfigException("Required M0 core hex image not found.")
return m0hexf
def complete(toolchain, elf0, hexf0, hexf1=None):
complete_func(toolchain.notify.debug, elf0, hexf0, hexf1)