2019-01-04 04:32 AM
I am trying to protect code(in flash) and data(sram) using fire wall feature But board is resetting when exucute the function. Following is the code to initiate and enable fire wall.
void firewall_init(void)
{
FIREWALL_InitTypeDef firewall1;
firewall1.CodeSegmentLength =0x00000088;
firewall1.CodeSegmentStartAddress= 0x08003a6c; // Address of "function to protect"
firewall1.VDataSegmentLength=256;
firewall1.VDataSegmentStartAddress=0x200000b4; //address of data to be protected
firewall1.VolatileDataExecution=FIREWALL_VOLATILEDATA_EXECUTABLE;
firewall1.VolatileDataShared=FIREWALL_VOLATILEDATA_NOT_SHARED;
firewall1.NonVDataSegmentStartAddress = 0;
firewall1.NonVDataSegmentLength = 0;
HAL_FIREWALL_Config(&firewall1);
HAL_FIREWALL_EnableFirewall();
}
void function(void)
{
firewall_init();
function_to_protect();
HAL_FIREWALL_EnablePreArmFlag();
}
When it is tried to execute function_to_protect() it is resetting.
Please help me to resolve the issue.
Thanks
Srinivas MNMS
Solved! Go to Solution.
2019-01-04 05:32 AM
STM32Cube_FW_L0_V1.10.0\Projects\STM32L073Z_EVAL\Examples\FIREWALL\FIREWALL_VolatileData_Shared
2019-01-04 05:32 AM
STM32Cube_FW_L0_V1.10.0\Projects\STM32L073Z_EVAL\Examples\FIREWALL\FIREWALL_VolatileData_Shared
2019-01-06 09:31 PM
Hi Clive,
Thanks for the link.