diff --git a/targets/targets.json b/targets/targets.json index 5a0f8ff674..4c74c3190a 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -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", diff --git a/tools/targets/PSOC6.py b/tools/targets/PSOC6.py index 5cf38c67b3..83115b07f8 100644 --- a/tools/targets/PSOC6.py +++ b/tools/targets/PSOC6.py @@ -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) - -