Skip to content

Commit 076a160

Browse files
committed
Add comment for target_config/target_config_ns in flash IAP
1 parent 7a7b634 commit 076a160

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

hal/TARGET_FLASH_CMSIS_ALGO/flash_data.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,17 @@ typedef struct {
4747
} flash_target_config_t;
4848

4949
/** Target flash configuration
50+
* For targets not supporting TrustZone, its flash_set_target_config must define target_config.
51+
* For targets supporting TrustZone, it has the following requirements:
52+
* -# Flash IAP H/W can only configure to secure. It can access both secure/non-secure flash.
53+
* -# Flash IAP port is for secure build only. It exports secure functions for non-secure build.
54+
* -# In Flash IAP port, flash_set_target_config must define both target_config/target_config_ns for secure/non-secure flash respectively.
55+
* -# Non-secure application can access its non-secure flash only through secure flash IAP functions. It cannot access secure flash.
5056
*/
5157
struct flash_s {
52-
const flash_target_config_t *target_config;
58+
const flash_target_config_t *target_config; /**< Normal/secure flash configuration structure for targets not supporting/supporting TrustZone */
5359
#if defined(__CORTEX_M23) || defined(__CORTEX_M33)
54-
const flash_target_config_t *target_config_ns;
60+
const flash_target_config_t *target_config_ns; /**< Non-secure flash configuration structure for targets supporting TrustZone */
5561
#endif
5662
const flash_algo_t *flash_algo;
5763
};

0 commit comments

Comments
 (0)