Skip to main content
sMNMS
Associate
Jan 4, 2019 12:32 PM UTC
Solved

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

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

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Jan 4, 2019 1:32 PM UTC

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

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

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Jan 4, 2019 1:32 PM UTC

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

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
sMNMS
sMNMSAuthor
Associate
Jan 7, 2019 5:31 AM UTC

Hi Clive,

Thanks for the link.