STM32L486xx HAL User Manual
Functions
Initialization Functions
FIREWALL Exported Functions

Initialization and Configuration Functions. More...

Functions

HAL_StatusTypeDef HAL_FIREWALL_Config (FIREWALL_InitTypeDef *fw_init)
 Initialize the Firewall according to the FIREWALL_InitTypeDef structure parameters.
void HAL_FIREWALL_GetConfig (FIREWALL_InitTypeDef *fw_config)
 Retrieve the Firewall configuration.
void HAL_FIREWALL_EnableFirewall (void)
 Enable FIREWALL.
void HAL_FIREWALL_EnablePreArmFlag (void)
 Enable FIREWALL pre arm.
void HAL_FIREWALL_DisablePreArmFlag (void)
 Disable FIREWALL pre arm.

Detailed Description

Initialization and Configuration Functions.

===============================================================================
            ##### Initialization and Configuration functions #####
 ===============================================================================
    [..]
    This subsection provides the functions allowing to initialize the Firewall.
    Initialization is done by HAL_FIREWALL_Config():

      (+) Enable the Firewall clock thru __HAL_RCC_FIREWALL_CLK_ENABLE() macro.

      (+) Set the protected code segment address start and length.

      (+) Set the protected non-volatile and/or volatile data segments
          address starts and lengths if applicable.

      (+) Set the volatile data segment execution and sharing status.

      (+) Length must be set to 0 for an unprotected segment.


Function Documentation

HAL_StatusTypeDef HAL_FIREWALL_Config ( FIREWALL_InitTypeDef fw_init)

Disable FIREWALL pre arm.

Note:
When FPA bit is reset, any code executed outside the protected segment when the Firewall is opened will generate a system reset.
This API provides the same service as __HAL_FIREWALL_PREARM_DISABLE() macro but can't be executed inside a code area protected by the Firewall.
When the Firewall is disabled, user can resort to HAL_FIREWALL_EnablePreArmFlag() API any time.
When the Firewall is enabled and NVDSL register is equal to 0 (that is, when the non volatile data segment is not defined), ** this API can be executed when the Firewall is closed ** when the Firewall is opened, user should resort to __HAL_FIREWALL_PREARM_DISABLE() macro instead
When the Firewall is enabled and NVDSL register is different from 0 (that is, when the non volatile data segment is defined) ** FW_CR register can be accessed only when the Firewall is opened: user should resort to __HAL_FIREWALL_PREARM_DISABLE() macro instead.
Return values:
None

Definition at line 288 of file stm32l4xx_hal_firewall.c.

void HAL_FIREWALL_EnableFirewall ( void  )

Enable FIREWALL.

Note:
Firewall is enabled in clearing FWDIS bit of SYSCFG CFGR1 register. Once enabled, the Firewall cannot be disabled by software. Only a system reset can set again FWDIS bit.
Return values:
None

Definition at line 237 of file stm32l4xx_hal_firewall.c.

Enable FIREWALL pre arm.

Note:
When FPA bit is set, any code executed outside the protected segment will close the Firewall.
This API provides the same service as __HAL_FIREWALL_PREARM_ENABLE() macro but can't be executed inside a code area protected by the Firewall.
When the Firewall is disabled, user can resort to HAL_FIREWALL_EnablePreArmFlag() API any time.
When the Firewall is enabled and NVDSL register is equal to 0 (that is, when the non volatile data segment is not defined), ** this API can be executed when the Firewall is closed ** when the Firewall is opened, user should resort to __HAL_FIREWALL_PREARM_ENABLE() macro instead
When the Firewall is enabled and NVDSL register is different from 0 (that is, when the non volatile data segment is defined) ** FW_CR register can be accessed only when the Firewall is opened: user should resort to __HAL_FIREWALL_PREARM_ENABLE() macro instead.
Return values:
None

Definition at line 262 of file stm32l4xx_hal_firewall.c.

Retrieve the Firewall configuration.

Parameters:
fw_config,:Firewall configuration, type is same as initialization structure
Note:
This API can't be executed inside a code area protected by the Firewall when the Firewall is enabled
If NVDSL register is different from 0, that is, if the non volatile data segment is defined, this API can't be executed when the Firewall is enabled.
User should resort to __HAL_FIREWALL_GET_PREARM() macro to retrieve FPA bit status
Return values:
None

Definition at line 200 of file stm32l4xx_hal_firewall.c.

References __HAL_RCC_FIREWALL_CLK_ENABLE, FIREWALL_InitTypeDef::CodeSegmentLength, FIREWALL_InitTypeDef::CodeSegmentStartAddress, FIREWALL_InitTypeDef::NonVDataSegmentLength, FIREWALL_InitTypeDef::NonVDataSegmentStartAddress, FIREWALL_InitTypeDef::VDataSegmentLength, FIREWALL_InitTypeDef::VDataSegmentStartAddress, FIREWALL_InitTypeDef::VolatileDataExecution, and FIREWALL_InitTypeDef::VolatileDataShared.