HAL GTZC Functions

Securable peripherals attributes configuration functions

group GTZC_Exported_Functions_Group1

This section provides functions allowing to configure the security and privilege attributes of securable peripherals

Functions

hal_status_t HAL_GTZC_SetPeriphAttr ( hal_gtzc_periph_t periph , const hal_gtzc_attr_config_t * p_attr )

Set securable peripherals security and privilege attributes.

Note

Secure and non-secure attributes can only be set from the secure state when TZEN=1.

Note

Privilege and non-privilege attributes can only be set from the privilege state when TZEN=0 or TZEN=1.

Note

Default state of securable peripheral security attributes is non-secure and unprivileged access allowed.

Parameters :
  • periph

    Peripheral identifier

    This parameter is an element of

    hal_gtzc_periph_t enumeration.

  • p_attr

    Security and privilege attributes

    A pointer to

    hal_gtzc_attr_config_t structure that contains the security and privilege attributes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter when the p_attr pointer is NULL.

  • HAL_OK – Securable peripheral security and privilege attributes has been correctly configured.

void HAL_GTZC_GetPeriphAttr ( hal_gtzc_periph_t periph , hal_gtzc_attr_config_t * p_attr )

Get the security and privilege attributes of securable peripherals.

Parameters :
  • periph

    Peripheral identifier

    This parameter is an element of

    hal_gtzc_periph_t enumeration.

  • p_attr

    Security and privilege attributes

    A pointer to

    hal_gtzc_attr_config_t structure that return the security and privilege attributes.

Lock the attributes configurations of securable peripherals functions

group GTZC_Exported_Functions_Group2

This section provides functions allowing to lock the configurations of securable peripherals

Functions

void HAL_GTZC_LockPeriphAttr ( hal_gtzc_lock_periphs_t lock_periphs )

Lock securable peripherals security attributes configuration.

Note

This function locks the configuration of TZSC_SECCFGRx and TZSC_PRIVCFGRx registers until next MCU HW reset.

Parameters :

lock_periphs

Peripherals to be locked either those on GTZC1 instance or those on GTZC2 instance

This parameter is an element of

hal_gtzc_lock_periphs_t enumeration.

hal_gtzc_attr_lock_state_t HAL_GTZC_IsPeriphAttrLocked ( hal_gtzc_lock_periphs_t lock_periphs )

Get lock state of securable peripherals security attributes configuration.

Parameters :

lock_periphs

Peripherals to be locked either those on GTZC1 instance or those on GTZC2 instance

This parameter is an element of

hal_gtzc_lock_periphs_t enumeration.

Return values :
  • HAL_GTZC_ATTR_LOCKED – Securable peripherals security attributes configuration are locked.

  • HAL_GTZC_ATTR_UNLOCKED – Securable peripherals security attributes configuration are unlocked.

Watermark memories subregion attributes configuration functions

group GTZC_Exported_Functions_Group3

This section provides functions allowing to configure the security and privilege attributes of Watermark memories area

Functions

hal_status_t HAL_GTZC_WATERMARK_SetConfigMemSubRegionAttr ( hal_gtzc_watermark_mem_t memory , uint32_t offset_byte , uint32_t size_byte , hal_gtzc_watermark_subregion_t sub_region , const hal_gtzc_attr_config_t * p_attr )

Set watermark memory subregion security and privilege attributes.

Parameters :
  • memory

    Watermark memory

    This parameter is an element of

    hal_gtzc_watermark_mem_t enumeration.

  • offset_byte – Offset in byte of watermark memory subregion.

  • size_byte – Length in byte of watermark memory subregion to be protected.

  • sub_region

    Subregion identifier

    This parameter is an element of

    hal_gtzc_watermark_subregion_t enumeration.

  • p_attr

    Security and privilege attributes

    A pointer to

    hal_gtzc_attr_config_t structure that contains the security and privilege attributes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter when the p_attr pointer is NULL.

  • HAL_OK – Watermark memory subregion security and privilege attributes has been correctly configured.

hal_status_t HAL_GTZC_WATERMARK_GetMemAreaAttr ( hal_gtzc_watermark_mem_t memory , uint32_t offset_byte , uint32_t size_byte , hal_gtzc_attr_config_t * p_attr )

Get watermark memory area security attributes.

Parameters :
  • memory

    Watermark memory

    This parameter is an element of

    hal_gtzc_watermark_mem_t enumeration.

  • offset_byte – Offset in byte of watermark memory area.

  • size_byte – Length in byte of watermark memory area.

  • p_attr

    Security and privilege attributes

    A pointer to

    hal_gtzc_attr_config_t structure that return the security and privilege attributes.

Return values :
  • HAL_OK – Watermark memory area security and privilege attributes has been returned correctly.

  • HAL_ERROR – Watermark memory area have different security and privilege attributes configuration.

uint32_t HAL_GTZC_WATERMARK_GetMemMapAttr ( hal_gtzc_watermark_mem_t memory , hal_gtzc_watermark_mem_map_t * p_map )

Get watermark memory details (offset_byte, size_byte, security attribute and privilege attribute) of different area and return the number of different area (Up to five different regions according to selected memory).

Parameters :
Return values :

uint32_t – Number of different area.

Enable/Disable watermark memories subregion functions

group GTZC_Exported_Functions_Group4

This section provides functions allowing to enable or disable watermark memories area

Functions

void HAL_GTZC_WATERMARK_EnableMemSubRegionAttr ( hal_gtzc_watermark_mem_t memory , hal_gtzc_watermark_subregion_t sub_region )

Enable watermark memory subregion.

Parameters :
void HAL_GTZC_WATERMARK_DisableMemSubRegionAttr ( hal_gtzc_watermark_mem_t memory , hal_gtzc_watermark_subregion_t sub_region )

Disable watermark memory subregion.

Parameters :
hal_gtzc_watermark_subregion_state_t HAL_GTZC_WATERMARK_IsEnabledMemSubRegionAttr ( hal_gtzc_watermark_mem_t memory , hal_gtzc_watermark_subregion_t sub_region )

Check if watermark memory subregion enbled or disabled.

Parameters :
Return values :
  • HAL_GTZC_WATERMARK_SUBREGION_DISABLED – Watermark memory subregion is disabled.

  • HAL_GTZC_WATERMARK_SUBREGION_ENABLED – Watermark memory subregion is enabled.

Lock the configurations of watermark memories subregion functions

group GTZC_Exported_Functions_Group5

This section provides functions allowing to lock the configurations of watermark memories area

Functions

void HAL_GTZC_WATERMARK_LockMemSubRegionConfig ( hal_gtzc_watermark_mem_t memory , hal_gtzc_watermark_subregion_t sub_region )

Lock watermark memory subregion security and privilege attributes configuration.

Note

This function locks the configurations of GTZC1_TZSC_MPCWMxCFGR, GTZC1_TZSC_MPCWMxAR and GTZC1_TZSC_MPCWMxBR registers until next reset.

Parameters :
hal_gtzc_attr_lock_state_t HAL_GTZC_WATERMARK_IsMemSubRegionConfigLocked ( hal_gtzc_watermark_mem_t memory , hal_gtzc_watermark_subregion_t sub_region )

Get lock state of watermark memory subregion security attributes configuration.

Parameters :
Return values :
  • HAL_GTZC_ATTR_LOCKED – Watermark memory subregion security and privilege attributes are locked.

  • HAL_GTZC_ATTR_UNLOCKED – Watermark memory subregion security and privilege attributes are unlocked.

Block based memories attributes configuration functions

group GTZC_Exported_Functions_Group6

This section provides functions allowing to configure the security and privilege attributes of block based memories

Functions

hal_status_t HAL_GTZC_BLOCKBASED_SetMemBlockAttr ( hal_gtzc_blockbased_mem_t memory , uint32_t block_idx , uint32_t block_nbr , const hal_gtzc_attr_config_t * p_attr )

Set block based memory security attributes by block.

Parameters :
  • memory

    block based memory

    This parameter is an element of

    hal_gtzc_blockbased_mem_t enumeration.

  • block_idx – Memory Block index.

  • block_nbr – Memory Block number.

  • p_attr

    Security and privilege attributes

    A pointer to

    hal_gtzc_attr_config_t structure that contains the security and privilege attributes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter when the p_attr pointer is NULL.

  • HAL_OK – block based memory security and privilege attributes has been correctly configured.

void HAL_GTZC_BLOCKBASED_GetMemBlockAttr ( hal_gtzc_blockbased_mem_t memory , uint32_t block_idx , hal_gtzc_attr_config_t * p_attr )

Get block based memory security attributes by block.

Parameters :
  • memory

    block based memory

    This parameter is an element of

    hal_gtzc_blockbased_mem_t enumeration.

  • block_idx – Memory Block index.

  • p_attr

    Security and privilege attributes

    A pointer to

    hal_gtzc_attr_config_t structure that return the security and privilege attributes.

hal_status_t HAL_GTZC_BLOCKBASED_SetMemAddrAttr ( hal_gtzc_blockbased_mem_t memory , uint32_t offset_byte , uint32_t size_byte , const hal_gtzc_attr_config_t * p_attr )

Set block based memory security attributes by address.

Parameters :
  • memory

    block based memory

    This parameter is an element of

    hal_gtzc_blockbased_mem_t enumeration.

  • offset_byte – offset in byte of block based memory area.

  • size_byte – Length in byte of block based memory area to be protected.

  • p_attr

    Security and privilege attributes

    A pointer to

    hal_gtzc_attr_config_t structure that contains the security and privilege attributes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter when the p_attr pointer is NULL.

  • HAL_OK – block based memory security and privilege attributes has been correctly configured.

void HAL_GTZC_BLOCKBASED_GetMemAddrAttr ( hal_gtzc_blockbased_mem_t memory , uint32_t offset_byte , hal_gtzc_attr_config_t * p_attr )

Get block based memory security attributes by address.

Parameters :
  • memory

    block based memory

    This parameter is an element of

    hal_gtzc_blockbased_mem_t enumeration.

  • offset_byte – Offset in bytes of block based memory.

  • p_attr

    Security and privilege attributes

    A pointer to

    hal_gtzc_attr_config_t structure that return the security and privilege attributes.

Clock security state of block based memories configuration functions

group GTZC_Exported_Functions_Group7

This section provides functions allowing to configure the clock security state of block based memories

Functions

void HAL_GTZC_BLOCKBASED_SetMemClkSecStateInvertion ( hal_gtzc_blockbased_mem_t memory , hal_gtzc_blockbased_mem_clk_sec_state_t clk_sec_state )

Set block based memory clock security state.

Parameters :
hal_gtzc_blockbased_mem_clk_sec_state_t HAL_GTZC_BLOCKBASED_GetMemClkSecStateInvertion ( hal_gtzc_blockbased_mem_t memory )

Get block based memory clock security state.

Parameters :

memory

block based memory

This parameter is an element of

hal_gtzc_blockbased_mem_t enumeration.

Return values :
  • HAL_GTZC_CLK_SEC_NOT_INVERTED – block based memory clock security not inverted.

  • HAL_GTZC_CLK_SEC_INVERTED – block based memory clock security inverted.

Secure access state of block based memories configuration functions

group GTZC_Exported_Functions_Group8

This section provides functions allowing to configure the secure access state of block based memories

Functions

void HAL_GTZC_BLOCKBASED_SetMemSecAccessState ( hal_gtzc_blockbased_mem_t memory , hal_gtzc_blockbased_mem_sec_access_state_t state )

Set block based memory secure access state.

Parameters :
hal_gtzc_blockbased_mem_sec_access_state_t HAL_GTZC_BLOCKBASED_GetMemSecAccessState ( hal_gtzc_blockbased_mem_t memory )

Get block based secure access state.

Parameters :

memory

block based memory

This parameter is an element of

hal_gtzc_blockbased_mem_t enumeration.

Return values :
  • HAL_GTZC_SEC_ACCESS_NOT_ALLOWED – block based memory secure access not allowed.

  • HAL_GTZC_SEC_ACCESS_ALLOWED – block based memory secure access allowed.

Lock the configurations of block based memories functions

group GTZC_Exported_Functions_Group9

This section provides functions allowing to lock the configurations of block based memories

Functions

void HAL_GTZC_BLOCKBASED_LockMemSuperBlockAttr ( hal_gtzc_blockbased_mem_t memory , uint32_t super_blk_idx , uint32_t super_blk_nbr )

Lock block based memory security attributes configuration by super-block.

Note

This function locks the configurations of GTZC1_MPCBBz_SECCFGRy and GTZC1_MPCBBz_PRIVCFGRy registers until next reset.

Parameters :
  • memory

    block based memory

    This parameter is an element of

    hal_gtzc_blockbased_mem_t enumeration.

  • super_blk_idx – Start index of memory super-block.

  • super_blk_nbr – Number of memory super-blocks.

hal_gtzc_attr_lock_state_t HAL_GTZC_BLOCKBASED_IsMemSuperBlockAttrLocked ( hal_gtzc_blockbased_mem_t memory , uint32_t super_blk_idx )

Get lock state of block based memory security attributes configuration by super-block.

Parameters :
  • memory

    block based memory

    This parameter is an element of

    hal_gtzc_blockbased_mem_t enumeration.

  • super_blk_idx – Start index of memory super-block.

Return values :
  • HAL_GTZC_ATTR_LOCKED – Super-block memory security and privilege attributes configuration are locked.

  • HAL_GTZC_ATTR_UNLOCKED – Super-block memory security and privilege attributes configuration are unlocked.

void HAL_GTZC_BLOCKBASED_LockMemAttr ( hal_gtzc_blockbased_mem_t memory , uint32_t offset_byte , uint32_t size_byte )

Lock block based memory security attributes configuration by address.

Note

This function locks the configurations of GTZC1_MPCBBz_SECCFGRy and GTZC1_MPCBBz_PRIVCFGRy registers until next reset.

Parameters :
  • memory

    block based memory

    This parameter is a element of

    hal_gtzc_blockbased_mem_t enumeration.

  • offset_byte – Offset in byte of block based memory area must be aligned with super_block size.

  • size_byte – Length in byte of block based memory area to be locked must be aligned with super_block size.

hal_gtzc_attr_lock_state_t HAL_GTZC_BLOCKBASED_IsMemAttrLocked ( hal_gtzc_blockbased_mem_t memory , uint32_t offset_byte )

Get lock state of block based memory security attributes configuration by address.

Parameters :
  • memory

    block based memory

    This parameter is an element of

    hal_gtzc_blockbased_mem_t enumeration.

  • offset_byte – Offset in bytes of blockblock basedbased memory must be aligned with super_block size.

Return values :
  • HAL_GTZC_ATTR_LOCKED – Super-block memory security and privilege attributes configuration are locked.

  • HAL_GTZC_ATTR_UNLOCKED – Super-block memory security and privilege attributes configuration are unlocked.

void HAL_GTZC_BLOCKBASED_LockMemConfig ( hal_gtzc_blockbased_mem_t memory )

Lock block based memory configuration.

Note

This function locks the configuration of GTZCx_MPCBBz_CR registers until next reset.

Parameters :

memory

block based memory

This parameter is an element of

hal_gtzc_blockbased_mem_t enumeration.

hal_gtzc_attr_lock_state_t HAL_GTZC_BLOCKBASED_IsMemConfigLocked ( hal_gtzc_blockbased_mem_t memory )

Get lock state of block based memory configuration.

Parameters :

memory

block based memory

This parameter is an element of

hal_gtzc_blockbased_mem_t enumeration.

Return values :
  • HAL_GTZC_ATTR_LOCKED – block based memory configuration is locked.

  • HAL_GTZC_ATTR_UNLOCKED – block based memory configuration is unlocked.

Enable/Disable the illegal access interrupt of peripherals functions

group GTZC_Exported_Functions_Group10

This section provides functions allowing to enable or disable the illegal access interrupt of peripherals

Functions

void HAL_GTZC_ILLEGALACCESS_EnableIT ( hal_gtzc_periph_t periph )

Activate the illegal access interrupt to a peripheral.

Parameters :

periph

Peripheral identifier

This parameter is an element of

hal_gtzc_periph_t enumeration.

void HAL_GTZC_ILLEGALACCESS_DisableIT ( hal_gtzc_periph_t periph )

Deactivate the illegal access interrupt to a peripheral.

Parameters :

periph

Peripheral identifier

This parameter is an element of

hal_gtzc_periph_t enumeration.

hal_gtzc_illegal_access_it_state_t HAL_GTZC_ILLEGALACCESS_IsEnabledIT ( hal_gtzc_periph_t periph )

Check if the illegal access interrupt to a peripheral enabled or disabled.

Parameters :

periph

Peripheral identifier

This parameter is an element of

hal_gtzc_periph_t enumeration.

Return values :
  • HAL_GTZC_ILAC_IT_DISABLED – Illegal access interrupt disabled.

  • HAL_GTZC_ILAC_IT_ENABLED – Illegal access interrupt enabled.

Treat the illegal access interrupt functions

group GTZC_Exported_Functions_Group11

This section provides functions allowing to treat ISR and provide user callback

Functions

void HAL_GTZC_ILLEGALACCESS_IRQHandler ( void )

This function handles GTZC illegal access interrupt request.

void HAL_GTZC_ILLEGALACCESS_Callback ( hal_gtzc_periph_t periph )

GTZC illegal access sub-block interrupt callback.

Parameters :

periph – Peripheral identifier This parameter can be an element of hal_gtzc_periph_t enumeration.