cancel
Showing results for 
Search instead for 
Did you mean: 

Do we have example codes on how to use fire wall to protect function on Flash and data on SRAM for STM32L073RZTx micro controller ? please share the link

sMNMS
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions

STM32Cube_FW_L0_V1.10.0\Projects\STM32L073Z_EVAL\Examples\FIREWALL\FIREWALL_VolatileData_Shared

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

STM32Cube_FW_L0_V1.10.0\Projects\STM32L073Z_EVAL\Examples\FIREWALL\FIREWALL_VolatileData_Shared

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sMNMS
Associate

Hi Clive,

Thanks for the link.