From 7641f1cb3c93ab5b94dee8220d4f5be315e3b075 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Wed, 4 Nov 2020 18:25:13 +0000 Subject: [PATCH] CYTFM_064B0S2_4343W: use cytfm_flash only if TFM and PSA are present This fixes bare metal builds --- .../TARGET_CYTFM_064B0S2_4343W/cytfm_flash_info.c | 2 +- targets/TARGET_Cypress/TARGET_PSOC6/cy_flash_api.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/cytfm_flash_info.c b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/cytfm_flash_info.c index 3fc889ad59..841b2ff26a 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/cytfm_flash_info.c +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/cytfm_flash_info.c @@ -26,7 +26,7 @@ #include "region_defs.h" #include "cytfm_flash_info.h" -#if DEVICE_FLASH +#if DEVICE_FLASH && defined(TARGET_TFM) && MBED_CONF_PSA_PRESENT #ifdef __cplusplus extern "C" { diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/cy_flash_api.c b/targets/TARGET_Cypress/TARGET_PSOC6/cy_flash_api.c index c9d01d6e7a..3a95e2d4ac 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/cy_flash_api.c +++ b/targets/TARGET_Cypress/TARGET_PSOC6/cy_flash_api.c @@ -17,7 +17,7 @@ #include "flash_api.h" #include "cyhal_flash.h" -#ifdef TARGET_TFM +#if defined(TARGET_TFM) && MBED_CONF_PSA_PRESENT #include "cytfm_flash_info.h" #endif @@ -32,7 +32,7 @@ int32_t flash_init(flash_t *obj) if (CY_RSLT_SUCCESS != cyhal_flash_init(&(obj->flash))) { return -1; } -#ifdef TARGET_TFM +#if defined(TARGET_TFM) && MBED_CONF_PSA_PRESENT cytfm_flash_get_info(&(obj->flash), &(obj->info)); #else /* TARGET_TFM */ cyhal_flash_get_info(&(obj->flash), &(obj->info));