cancel
Showing results for 
Search instead for 
Did you mean: 

Clarification on Flow Protection Value Difference Between STM32H753ZI and STM32H733 Controllers

Denish_Ribadiya
Associate II

In the SBSFU reference code for the STM32H753ZI controller, I came across the following function:

FLOW_CONTROL_CHECK(uFlowProtectValue, FLOW_CTRL_RUNTIME_PROTECT);

This function compares whether the two values are the same. In my implementation for the STM32H753ZI MCU, the uFlowProtectValue is set to 0x000030F1U.

Now, I am implementing the same logic for the STM32H733 controller, but the uFlowProtectValue variable is set to 0x00005776U.

So can you please guide me why I am getting different value for H733, means where this value is updated?

3 REPLIES 3
Bubbles
ST Employee

Hi @Denish_Ribadiya,

it's not unusual to get the control flow alert when modifying or porting the code. That's precisely the purpose of the control check - to detect modifications. I'd normally disable the checkups temporarily, make sure everything works and then update the checkups as the last touch.

To see the exact difference you'd probably need to trace the two executions side-by-side. But I don't think you need to find that difference. There are likely to be more of them and some probably cannot be avoided when porting to another device.

BR,

J

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Denish_Ribadiya
Associate II

Hello, @Bubbles 

Thank you for your quick support.

Please provide the correct initialization value for the uFlowProtectValue variable for the STM32H733VGT6. In the reference code for the STM32H753ZI, the value 0x00005776U is used for this variable.

Could you confirm if this value is suitable for the STM32H733VGT6, or if a different initialization value is recommended for proper operation?

Your assistance would be greatly appreciated!

Bubbles
ST Employee

Hello @Denish_Ribadiya,

the control flow initialization value is just an arbitrary number. The control flow is there to make sure that no important section of code was skipped using a glitch or other attack. The flow value gets incremented at all the essential steps and checked against a reference at the end of the critical section.

When the code is modified you'll get a different final value. When the relevant porting modifications are done, you need to adjust the control flow to pass, it doesn't really matter if the init or reference value are updated.

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.